hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1769905 - /httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/util/TestLangUtils.java
Date Wed, 16 Nov 2016 02:34:32 GMT
Author: ggregory
Date: Wed Nov 16 02:34:32 2016
New Revision: 1769905

URL: http://svn.apache.org/viewvc?rev=1769905&view=rev
Log:
Update for deprecation in Java 9. Use Integer cache.

Modified:
    httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/util/TestLangUtils.java

Modified: httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/util/TestLangUtils.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/util/TestLangUtils.java?rev=1769905&r1=1769904&r2=1769905&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/util/TestLangUtils.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/test/java/org/apache/hc/core5/util/TestLangUtils.java
Wed Nov 16 02:34:32 2016
@@ -38,7 +38,7 @@ public class TestLangUtils {
 
     @Test
     public void testBasicHash() {
-        final Integer i = new Integer(1234);
+        final Integer i = Integer.valueOf(1234);
         final int h1 = LangUtils.hashCode(LangUtils.HASH_SEED, i.hashCode());
         final int h2 = LangUtils.hashCode(LangUtils.HASH_SEED, i);
         Assert.assertTrue(h1 == h2);
@@ -76,13 +76,13 @@ public class TestLangUtils {
         Assert.assertFalse(LangUtils.equals(new Object[] {}, null));
         Assert.assertTrue(LangUtils.equals(new Object[] {}, new Object[] {}));
         Assert.assertFalse(LangUtils.equals(
-                new Object[] {new Integer(1), new Integer(2)},
-                new Object[] {new Integer(1)}));
+                new Object[] {Integer.valueOf(1), Integer.valueOf(2)},
+                new Object[] {Integer.valueOf(1)}));
         Assert.assertFalse(LangUtils.equals(
-                new Object[] {new Integer(1), new Integer(2)},
-                new Object[] {new Integer(1), new Integer(3)}));
+                new Object[] {Integer.valueOf(1), Integer.valueOf(2)},
+                new Object[] {Integer.valueOf(1), Integer.valueOf(3)}));
         Assert.assertTrue(LangUtils.equals(
-                new Object[] {new Integer(1), new Integer(2)},
-                new Object[] {new Integer(1), new Integer(2)}));
+                new Object[] {Integer.valueOf(1), Integer.valueOf(2)},
+                new Object[] {Integer.valueOf(1), Integer.valueOf(2)}));
     }
 }



Mime
View raw message