Use Integer.valueOf() in preference to new Integer()
This commit is contained in:
@@ -28,7 +28,7 @@ public class TargetObject implements ITargetObject {
|
||||
//~ Methods ========================================================================================================
|
||||
|
||||
public Integer computeHashCode(String input) {
|
||||
return new Integer(input.hashCode());
|
||||
return Integer.valueOf(input.hashCode());
|
||||
}
|
||||
|
||||
public int countLength(String input) {
|
||||
|
||||
@@ -74,7 +74,7 @@ public class SecurityConfigTests {
|
||||
MockConfigAttribute mock2 = new MockConfigAttribute("NOT_EQUAL");
|
||||
Assert.assertTrue(!security1.equals(mock2));
|
||||
|
||||
Integer int1 = new Integer(987);
|
||||
Integer int1 = Integer.valueOf(987);
|
||||
Assert.assertTrue(!security1.equals(int1));
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -85,7 +85,7 @@ public class AfterInvocationProviderManagerTests extends TestCase {
|
||||
AfterInvocationProviderManager manager = new AfterInvocationProviderManager();
|
||||
List list = new Vector();
|
||||
list.add(new MockAfterInvocationProvider("swap1", MethodInvocation.class, new SecurityConfig("GIVE_ME_SWAP1")));
|
||||
list.add(new Integer(45));
|
||||
list.add(Integer.valueOf(45));
|
||||
list.add(new MockAfterInvocationProvider("swap3", MethodInvocation.class, new SecurityConfig("GIVE_ME_SWAP3")));
|
||||
|
||||
try {
|
||||
|
||||
+1
-1
@@ -95,7 +95,7 @@ public class AbstractAuthenticationTokenTests {
|
||||
assertTrue(!token1.equals(token7));
|
||||
assertTrue(!token7.equals(token1));
|
||||
|
||||
assertTrue(!token1.equals(new Integer(100)));
|
||||
assertTrue(!token1.equals(Integer.valueOf(100)));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ public class GrantedAuthorityImplTests {
|
||||
MockGrantedAuthority mock2 = new MockGrantedAuthority("NOT_EQUAL");
|
||||
assertTrue(!auth1.equals(mock2));
|
||||
|
||||
Integer int1 = new Integer(222);
|
||||
Integer int1 = Integer.valueOf(222);
|
||||
assertTrue(!auth1.equals(int1));
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ public class KeyBasedPersistenceTokenServiceTests {
|
||||
SecureRandomFactoryBean fb = new SecureRandomFactoryBean();
|
||||
KeyBasedPersistenceTokenService service = new KeyBasedPersistenceTokenService();
|
||||
service.setServerSecret("MY:SECRET$$$#");
|
||||
service.setServerInteger(new Integer(454545));
|
||||
service.setServerInteger(Integer.valueOf(454545));
|
||||
try {
|
||||
SecureRandom rnd = (SecureRandom) fb.getObject();
|
||||
service.setSecureRandom(rnd);
|
||||
|
||||
Reference in New Issue
Block a user