Skip to content

File tree

34 files changed

+230
-83
lines changed

34 files changed

+230
-83
lines changed

spring-integration-amqp/src/main/java/org/springframework/integration/amqp/support/MappingUtils.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
*/
3333
public class MappingUtils {
3434

35+
private MappingUtils() {
36+
super();
37+
}
38+
3539
/**
3640
* Map an o.s.Message to an o.s.a.core.Message.
3741
* @param requestMessage the request message.

spring-integration-core/src/main/java/org/springframework/integration/mapping/support/JsonHeaders.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,15 @@
2525
* entries from/to Message Headers and other adapter, e.g. AMQP.
2626
*
2727
* @author Artem Bilan
28+
* @author Gary Russell
2829
* @since 3.0
2930
*/
3031
public class JsonHeaders {
3132

33+
private JsonHeaders() {
34+
super();
35+
}
36+
3237
public static final String PREFIX = "json";
3338

3439
public static final String TYPE_ID = PREFIX + "__TypeId__";

spring-integration-core/src/main/java/org/springframework/integration/support/json/JacksonJsonUtils.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2016 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,6 +28,10 @@
2828
*/
2929
public final class JacksonJsonUtils {
3030

31+
private JacksonJsonUtils() {
32+
super();
33+
}
34+
3135
private static final ClassLoader classLoader = JacksonJsonUtils.class.getClassLoader();
3236

3337
private static final boolean jackson2Present =

spring-integration-core/src/main/java/org/springframework/integration/support/json/JsonObjectMapperProvider.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2016 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -39,6 +39,10 @@ public final class JsonObjectMapperProvider {
3939
private static final boolean boonPresent =
4040
ClassUtils.isPresent("org.boon.json.ObjectMapper", classLoader);
4141

42+
private JsonObjectMapperProvider() {
43+
super();
44+
}
45+
4246
public static JsonObjectMapper<?, ?> newInstance() {
4347
if (JacksonJsonUtils.isJackson2Present()) {
4448
return new Jackson2JsonObjectMapper();

spring-integration-core/src/main/java/org/springframework/integration/support/utils/IntegrationUtils.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ public class IntegrationUtils {
4949
*/
5050
public static final boolean fatalWhenNoBeanFactory = Boolean.valueOf(System.getenv("SI_FATAL_WHEN_NO_BEANFACTORY"));
5151

52+
private IntegrationUtils() {
53+
super();
54+
}
55+
5256
/**
5357
* @param beanFactory BeanFactory for lookup, must not be null.
5458
* @return The {@link ConversionService} bean whose name is "integrationConversionService" if available.

spring-integration-core/src/test/java/org/springframework/integration/core/TimeBasedUUIDGenerator.java

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,52 +29,56 @@
2929
class TimeBasedUUIDGenerator {
3030

3131
private static final Logger logger = Logger.getLogger(TimeBasedUUIDGenerator.class.getName());
32-
32+
3333
public static final Object lock = new Object();
34-
34+
3535
private static boolean canNotDetermineMac = true;
3636
private static long lastTime;
3737
private static long clockSequence = 0;
3838
private static final long macAddress = getMac();
3939

40+
private TimeBasedUUIDGenerator() {
41+
super();
42+
}
43+
4044
/**
41-
* Will generate unique time based UUID where the next UUID is
45+
* Will generate unique time based UUID where the next UUID is
4246
* always greater then the previous.
4347
*/
4448
public final static UUID generateId() {
4549
return generateIdFromTimestamp(System.currentTimeMillis());
4650
}
47-
51+
4852
public final static UUID generateIdFromTimestamp(long currentTimeMillis){
4953
long time;
50-
54+
5155
synchronized (lock) {
5256
if (currentTimeMillis > lastTime) {
5357
lastTime = currentTimeMillis;
5458
clockSequence = 0;
55-
} else {
56-
++clockSequence;
59+
} else {
60+
++clockSequence;
5761
}
5862
}
59-
60-
63+
64+
6165
time = currentTimeMillis;
62-
66+
6367
// low Time
6468
time = currentTimeMillis << 32;
65-
69+
6670
// mid Time
6771
time |= ((currentTimeMillis & 0xFFFF00000000L) >> 16);
6872

6973
// hi Time
7074
time |= 0x1000 | ((currentTimeMillis >> 48) & 0x0FFF); // version 1
71-
72-
long clock_seq_hi_and_reserved = clockSequence;
73-
74-
clock_seq_hi_and_reserved <<=48;
75-
76-
long cls = 0 | clock_seq_hi_and_reserved;
77-
75+
76+
long clock_seq_hi_and_reserved = clockSequence;
77+
78+
clock_seq_hi_and_reserved <<=48;
79+
80+
long cls = 0 | clock_seq_hi_and_reserved;
81+
7882
long lsb = cls | macAddress;
7983
if (canNotDetermineMac){
8084
logger.warning("UUID generation process was not able to determine your MAC address. Returning random UUID (non version 1 UUID)");
@@ -93,12 +97,12 @@ private static long getMac(){
9397
byte[] mac = "01:23:45:67:89:ab".getBytes();
9498
//Converts array of unsigned bytes to an long
9599
if (mac != null) {
96-
for (int i = 0; i < mac.length; i++) {
100+
for (int i = 0; i < mac.length; i++) {
97101
macAddressAsLong <<= 8;
98102
macAddressAsLong ^= (long)mac[i] & 0xFF;
99103
}
100104
}
101-
}
105+
}
102106
canNotDetermineMac = false;
103107
} catch (Exception e) {
104108
e.printStackTrace();

spring-integration-file/src/main/java/org/springframework/integration/file/locking/FileChannelCache.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ final class FileChannelCache {
3737
private static ConcurrentMap<File, FileChannel> channelCache = new ConcurrentHashMap<File, FileChannel>();
3838

3939

40+
private FileChannelCache() {
41+
super();
42+
}
43+
4044
/**
4145
* Try to get a lock for this file while guaranteeing that the same channel will be used for all file locks in this
4246
* VM. If the lock could not be acquired this method will return <code>null</code>.

spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/config/xml/ParserTestUtil.java

Lines changed: 36 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -23,34 +23,42 @@
2323

2424
/**
2525
* @author Dan Oxlade
26+
* @author Gary Russell
2627
*/
2728
class ParserTestUtil {
28-
static ParserContext createFakeParserContext() {
29-
return new ParserContext(new XmlReaderContext(thisClassAsResource(), new FailFastProblemReporter(), null, null, null, null), null);
30-
}
31-
32-
static InputStreamResource thisClassAsResource() {
33-
return new InputStreamResource(ParserTestUtil.class.getResourceAsStream(ParserTestUtil.class.getSimpleName() + ".class"));
34-
}
35-
36-
37-
static org.w3c.dom.Document loadXMLFrom(String xml)
38-
throws org.xml.sax.SAXException, java.io.IOException {
39-
return loadXMLFrom(new java.io.ByteArrayInputStream(xml.getBytes()));
40-
}
41-
42-
static org.w3c.dom.Document loadXMLFrom(java.io.InputStream is)
43-
throws org.xml.sax.SAXException, java.io.IOException {
44-
javax.xml.parsers.DocumentBuilderFactory factory =
45-
javax.xml.parsers.DocumentBuilderFactory.newInstance();
46-
factory.setNamespaceAware(true);
47-
javax.xml.parsers.DocumentBuilder builder = null;
48-
try {
49-
builder = factory.newDocumentBuilder();
50-
} catch (javax.xml.parsers.ParserConfigurationException ex) {
51-
}
52-
org.w3c.dom.Document doc = builder.parse(is);
53-
is.close();
54-
return doc;
55-
}
29+
30+
private ParserTestUtil() {
31+
super();
32+
}
33+
34+
static ParserContext createFakeParserContext() {
35+
return new ParserContext(
36+
new XmlReaderContext(thisClassAsResource(), new FailFastProblemReporter(), null, null, null, null),
37+
null);
38+
}
39+
40+
static InputStreamResource thisClassAsResource() {
41+
return new InputStreamResource(
42+
ParserTestUtil.class.getResourceAsStream(ParserTestUtil.class.getSimpleName() + ".class"));
43+
}
44+
45+
static org.w3c.dom.Document loadXMLFrom(String xml) throws org.xml.sax.SAXException, java.io.IOException {
46+
return loadXMLFrom(new java.io.ByteArrayInputStream(xml.getBytes()));
47+
}
48+
49+
static org.w3c.dom.Document loadXMLFrom(java.io.InputStream is)
50+
throws org.xml.sax.SAXException, java.io.IOException {
51+
javax.xml.parsers.DocumentBuilderFactory factory = javax.xml.parsers.DocumentBuilderFactory.newInstance();
52+
factory.setNamespaceAware(true);
53+
javax.xml.parsers.DocumentBuilder builder = null;
54+
try {
55+
builder = factory.newDocumentBuilder();
56+
}
57+
catch (javax.xml.parsers.ParserConfigurationException ex) {
58+
}
59+
org.w3c.dom.Document doc = builder.parse(is);
60+
is.close();
61+
return doc;
62+
}
63+
5664
}

spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/fork/CacheServerProcess.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013 the original author or authors.
2+
* Copyright 2013-2016 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -32,12 +32,17 @@
3232
* @author David Turanski
3333
* @author Gunnar Hillert
3434
* @author Soby Chacko
35+
* @author Gary Russell
3536
*
3637
* Runs as a standalone Java app.
3738
* Modified from SGF implementation for testing client/server CQ features
3839
*/
3940
public class CacheServerProcess {
4041

42+
private CacheServerProcess() {
43+
super();
44+
}
45+
4146
public static void main(String[] args) throws Exception {
4247

4348
Properties props = new Properties();

spring-integration-gemfire/src/test/java/org/springframework/integration/gemfire/fork/ForkUtil.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ public class ForkUtil {
3737

3838
private static String TEMP_DIR = System.getProperty("java.io.tmpdir");
3939

40+
private ForkUtil() {
41+
super();
42+
}
43+
4044
public static OutputStream cloneJVM(String argument) {
4145
String cp = System.getProperty("java.class.path");
4246
String home = System.getProperty("java.home");

0 commit comments

Comments
 (0)