cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [23/30] cxf git commit: Findbugs work on the transports
Date Sun, 04 Dec 2016 01:12:05 GMT
Findbugs work on the transports


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/a644c5d0
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/a644c5d0
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/a644c5d0

Branch: refs/heads/CXF-6882.nio
Commit: a644c5d06c0bae321e2c669efa0cecf3abdd944d
Parents: 847216a
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Fri Dec 2 11:12:23 2016 +0000
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Fri Dec 2 11:54:36 2016 +0000

----------------------------------------------------------------------
 .../http_undertow/UndertowHTTPServerEngine.java        |  4 ++--
 .../java/org/apache/cxf/transport/http/Headers.java    |  2 +-
 .../org/apache/cxf/transport/http/ProxyFactory.java    |  2 +-
 .../http/auth/AbstractSpnegoAuthSupplier.java          |  2 +-
 .../apache/cxf/transport/http/auth/HttpAuthHeader.java |  7 ++++---
 .../http/osgi/ConfigAdminHttpConduitConfigurer.java    |  2 +-
 .../java/org/apache/cxf/transport/jms/JMSConduit.java  |  2 +-
 .../org/apache/cxf/transport/jms/uri/JMSEndpoint.java  | 13 +++++++------
 .../atmosphere/DefaultProtocolInterceptor.java         |  2 +-
 9 files changed, 19 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/a644c5d0/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/UndertowHTTPServerEngine.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/UndertowHTTPServerEngine.java
b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/UndertowHTTPServerEngine.java
index 7cfed67..ad3a6a6 100644
--- a/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/UndertowHTTPServerEngine.java
+++ b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/UndertowHTTPServerEngine.java
@@ -461,11 +461,11 @@ public class UndertowHTTPServerEngine implements ServerEngine {
             ? SSLContext.getInstance(proto)
                 : SSLContext.getInstance(proto, tlsServerParameters.getJsseProvider());
             
-        KeyManager keyManagers[] = tlsServerParameters.getKeyManagers();
+        KeyManager[] keyManagers = tlsServerParameters.getKeyManagers();
         if (tlsServerParameters.getCertAlias() != null) {
             keyManagers = getKeyManagersWithCertAlias(keyManagers);
         }
-        context.init(tlsServerParameters.getKeyManagers(), 
+        context.init(keyManagers, 
                      tlsServerParameters.getTrustManagers(),
                      tlsServerParameters.getSecureRandom());
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/a644c5d0/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Headers.java
----------------------------------------------------------------------
diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Headers.java b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Headers.java
index 7ec9f4a..3d58112 100644
--- a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Headers.java
+++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Headers.java
@@ -487,7 +487,7 @@ public class Headers {
             return true;
         }
         try {
-            if (Integer.valueOf(ctLen.get(0)) == 0) {
+            if (Integer.parseInt(ctLen.get(0)) == 0) {
                 return false;
             }
         } catch (NumberFormatException ex) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/a644c5d0/rt/transports/http/src/main/java/org/apache/cxf/transport/http/ProxyFactory.java
----------------------------------------------------------------------
diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/ProxyFactory.java
b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/ProxyFactory.java
index 22779db..c53794d 100644
--- a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/ProxyFactory.java
+++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/ProxyFactory.java
@@ -79,7 +79,7 @@ public class ProxyFactory {
                 proxyPort = "8080";
             }
             
-            systemProxyConfiguration.setProxyServerPort(Integer.valueOf(proxyPort));
+            systemProxyConfiguration.setProxyServerPort(Integer.parseInt(proxyPort));
 
             // Load non proxy hosts
             String nonProxyHosts = SystemPropertyAction.getPropertyOrNull(HTTP_NON_PROXY_HOSTS);

http://git-wip-us.apache.org/repos/asf/cxf/blob/a644c5d0/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/AbstractSpnegoAuthSupplier.java
----------------------------------------------------------------------
diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/AbstractSpnegoAuthSupplier.java
b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/AbstractSpnegoAuthSupplier.java
index dc28427..172d110 100644
--- a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/AbstractSpnegoAuthSupplier.java
+++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/AbstractSpnegoAuthSupplier.java
@@ -196,7 +196,7 @@ public abstract class AbstractSpnegoAuthSupplier {
         this.realm = realm;
     }
     
-    private final class CreateServiceTicketAction implements PrivilegedExceptionAction<byte[]>
{
+    private static final class CreateServiceTicketAction implements PrivilegedExceptionAction<byte[]>
{
         private final GSSContext context;
         private final byte[] token;
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/a644c5d0/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/HttpAuthHeader.java
----------------------------------------------------------------------
diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/HttpAuthHeader.java
b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/HttpAuthHeader.java
index 0b331ed..fef7d12 100644
--- a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/HttpAuthHeader.java
+++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/HttpAuthHeader.java
@@ -119,11 +119,12 @@ public final class HttpAuthHeader {
                     if (value.indexOf(".") > 0) {
                         value = value.substring(0, value.indexOf("."));
                     }
-                    String pad = "";
+                    StringBuilder pad = new StringBuilder();
+                    pad.append("");
                     for (int i = 0; i < 8 - value.length(); i++) {
-                        pad = pad + "0";
+                        pad.append("0");
                     }
-                    value = pad + value;
+                    value = pad.toString() + value;
                 } else {
                     value = tok.sval;
                 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/a644c5d0/rt/transports/http/src/main/java/org/apache/cxf/transport/http/osgi/ConfigAdminHttpConduitConfigurer.java
----------------------------------------------------------------------
diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/osgi/ConfigAdminHttpConduitConfigurer.java
b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/osgi/ConfigAdminHttpConduitConfigurer.java
index 1bc01f3..baaeb77 100644
--- a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/osgi/ConfigAdminHttpConduitConfigurer.java
+++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/osgi/ConfigAdminHttpConduitConfigurer.java
@@ -121,7 +121,7 @@ class ConfigAdminHttpConduitConfigurer implements ManagedServiceFactory,
HTTPCon
         String p = (String)properties.get("order");
         int order = 50; 
         if (p != null) {
-            order = Integer.valueOf(p);
+            order = Integer.parseInt(p);
         }
         
         PidInfo info = new PidInfo(properties, matcher, order);

http://git-wip-us.apache.org/repos/asf/cxf/blob/a644c5d0/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
----------------------------------------------------------------------
diff --git a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
index 9a0f4be..814aa2a 100644
--- a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
+++ b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
@@ -232,7 +232,7 @@ public class JMSConduit extends AbstractConduit implements JMSExchangeSender,
Me
                     } catch (InterruptedException e) {
                         throw new JMSException("Interrupted while correlating " +  e.getMessage());
                     }
-                    if (exchange.get(CORRELATED) != Boolean.TRUE) {
+                    if (!Boolean.TRUE.equals(exchange.get(CORRELATED))) {
                         throw new JMSException("Timeout receiving message with correlationId
"
                                                    + correlationId);
                     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/a644c5d0/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSEndpoint.java
----------------------------------------------------------------------
diff --git a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSEndpoint.java
b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSEndpoint.java
index f5e9d03..64a77dd 100644
--- a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSEndpoint.java
+++ b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSEndpoint.java
@@ -22,6 +22,7 @@ package org.apache.cxf.transport.jms.uri;
 import java.lang.reflect.Method;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Map.Entry;
 
 import javax.jms.ConnectionFactory;
 import javax.jms.Message;
@@ -137,9 +138,9 @@ public class JMSEndpoint {
         if (jaxwsProps == null) {
             return;
         }
-        for (String key : jaxwsProps.keySet()) {
-            if (key.startsWith(JAXWS_PROPERTY_PREFIX)) {
-                jmsProps.put(key.substring(JAXWS_PROPERTY_PREFIX.length()), jaxwsProps.get(key));
+        for (Entry<String, Object> entry : jaxwsProps.entrySet()) {
+            if (entry.getKey().startsWith(JAXWS_PROPERTY_PREFIX)) {
+                jmsProps.put(entry.getKey().substring(JAXWS_PROPERTY_PREFIX.length()), entry.getValue());
             }
         }
     }
@@ -312,7 +313,7 @@ public class JMSEndpoint {
         this.timeToLive = timeToLive;
     }
     public void setTimeToLive(String timeToLive) {
-        this.timeToLive = Long.valueOf(timeToLive);
+        this.timeToLive = Long.parseLong(timeToLive);
     }
     public boolean isSetPriority() {
         return priority != null;
@@ -372,7 +373,7 @@ public class JMSEndpoint {
     }
     
     public void setConcurrentConsumers(String concurrentConsumers) {
-        this.concurrentConsumers = Integer.valueOf(concurrentConsumers);
+        this.concurrentConsumers = Integer.parseInt(concurrentConsumers);
     }
     
     public String getPassword() {
@@ -407,7 +408,7 @@ public class JMSEndpoint {
     }
     
     public void setReceiveTimeout(String receiveTimeout) {
-        this.receiveTimeout = Long.valueOf(receiveTimeout);
+        this.receiveTimeout = Long.parseLong(receiveTimeout);
     }
     public String getTargetService() {
         return targetService;

http://git-wip-us.apache.org/repos/asf/cxf/blob/a644c5d0/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/DefaultProtocolInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/DefaultProtocolInterceptor.java
b/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/DefaultProtocolInterceptor.java
index 9646fd6..e2e2d98 100644
--- a/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/DefaultProtocolInterceptor.java
+++ b/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/DefaultProtocolInterceptor.java
@@ -359,7 +359,7 @@ public class DefaultProtocolInterceptor extends AtmosphereInterceptorAdapter
{
     }
 
     // a workaround to flush the header data upon close when no write operation occurs  
-    private class WrappedAtmosphereResponse extends AtmosphereResponseImpl {
+    private static class WrappedAtmosphereResponse extends AtmosphereResponseImpl {
         final AtmosphereResponse response;
         ServletOutputStream sout;
         WrappedAtmosphereResponse(AtmosphereResponse resp, AtmosphereRequest req) throws
IOException {


Mime
View raw message