]> source.dussan.org Git - jgit.git/commitdiff
Use valueOf rather than constructor for Integer and Boolean 11/83411/2
authorDavid Pursehouse <david.pursehouse@gmail.com>
Tue, 18 Oct 2016 05:05:45 +0000 (14:05 +0900)
committerDavid Pursehouse <david.pursehouse@gmail.com>
Tue, 18 Oct 2016 05:15:53 +0000 (14:15 +0900)
Change-Id: I1c65b2e40ba6ec5860903b11b4631e014f3dc5ce
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnection.java
org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/TemporaryBufferEntity.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/WalkEncryptionTest.java

index c6e557aba4ba2732b65799e9b6f24674817e2dd2..5a53490eed4e03fe25e2fd6914871fec8042ec30 100644 (file)
@@ -295,11 +295,11 @@ public class HttpClientConnection implements HttpConnection {
        }
 
        public void setConnectTimeout(int timeout) {
-               this.timeout = new Integer(timeout);
+               this.timeout = Integer.valueOf(timeout);
        }
 
        public void setReadTimeout(int readTimeout) {
-               this.readTimeout = new Integer(readTimeout);
+               this.readTimeout = Integer.valueOf(readTimeout);
        }
 
        public String getContentType() {
@@ -328,7 +328,7 @@ public class HttpClientConnection implements HttpConnection {
        }
 
        public void setInstanceFollowRedirects(boolean followRedirects) {
-               this.followRedirects = new Boolean(followRedirects);
+               this.followRedirects = Boolean.valueOf(followRedirects);
        }
 
        public void setDoOutput(boolean dooutput) {
index 377e5ca572de7952c22f681e634c63b1437a06d1..93328c96ca818259d59ff83e6313bf10f43fe959 100644 (file)
@@ -105,7 +105,7 @@ public class TemporaryBufferEntity extends AbstractHttpEntity
         * @param contentLength
         */
        public void setContentLength(int contentLength) {
-               this.contentLength = new Integer(contentLength);
+               this.contentLength = Integer.valueOf(contentLength);
        }
 
        /**
index ac2bfd12f986b5187bf74bee30f7ec955d605dd2..cc5870ebfe631ec6e16d8f739ef36e08f966e631 100644 (file)
@@ -576,7 +576,7 @@ public class WalkEncryptionTest {
                                                .forName("javax.crypto.JceSecurity")
                                                .getDeclaredField("isRestricted");
                                isRestricted.setAccessible(true);
-                               isRestricted.set(null, new Boolean(restrictedOn));
+                               isRestricted.set(null, Boolean.valueOf(restrictedOn));
                        } catch (Throwable e) {
                                logger.info(
                                                "Could not setup JCE security policy restrictions.");