cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [2/2] cxf git commit: Some refactoring
Date Wed, 18 Feb 2015 16:37:32 GMT
Some refactoring


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

Branch: refs/heads/master
Commit: 33083c0682d2bdf2f42df7f4021d18bd7ccc34a4
Parents: ba293c6
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Wed Feb 18 16:37:02 2015 +0000
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Wed Feb 18 16:37:02 2015 +0000

----------------------------------------------------------------------
 .../cxf/jca/cxf/ManagedConnectionFactoryImpl.java |  2 +-
 .../org/apache/cxf/jca/servant/EJBEndpoint.java   |  4 ++--
 .../corba/types/CorbaPrimitiveHandler.java        | 18 +++++++++---------
 .../http_jetty/JettyHTTPServerEngine.java         |  2 +-
 .../apache/cxf/transport/jms/uri/JMSEndpoint.java |  2 +-
 .../main/java/org/apache/cxf/ws/rm/RMManager.java |  2 +-
 .../ws/security/cache/CacheCleanupListener.java   |  4 ++--
 .../apache/cxf/ws/security/trust/STSUtils.java    |  2 +-
 .../wss4j/AbstractWSS4JStaxInterceptor.java       |  2 +-
 .../StaxSymmetricBindingHandler.java              | 14 ++++++++------
 .../cxf/customer/wraped/CustomerService.java      |  2 +-
 .../tools/corba/processors/idl/ArrayVisitor.java  |  4 ++--
 .../tools/corba/processors/idl/FixedVisitor.java  |  4 ++--
 .../tools/corba/processors/idl/StringVisitor.java |  8 ++++----
 14 files changed, 36 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/33083c06/integration/jca/src/main/java/org/apache/cxf/jca/cxf/ManagedConnectionFactoryImpl.java
----------------------------------------------------------------------
diff --git a/integration/jca/src/main/java/org/apache/cxf/jca/cxf/ManagedConnectionFactoryImpl.java
b/integration/jca/src/main/java/org/apache/cxf/jca/cxf/ManagedConnectionFactoryImpl.java
index 60eff36..2bcdc38 100644
--- a/integration/jca/src/main/java/org/apache/cxf/jca/cxf/ManagedConnectionFactoryImpl.java
+++ b/integration/jca/src/main/java/org/apache/cxf/jca/cxf/ManagedConnectionFactoryImpl.java
@@ -87,7 +87,7 @@ public class ManagedConnectionFactoryImpl
     }
 
     public Integer getEJBServicePropertiesPollInterval() {
-        return new Integer(getPluginProps().getProperty(MONITOR_POLL_INTERVAL, 
+        return Integer.valueOf(getPluginProps().getProperty(MONITOR_POLL_INTERVAL, 
                                                         DEFAULT_MONITOR_POLL_INTERVAL));
     }
    

http://git-wip-us.apache.org/repos/asf/cxf/blob/33083c06/integration/jca/src/main/java/org/apache/cxf/jca/servant/EJBEndpoint.java
----------------------------------------------------------------------
diff --git a/integration/jca/src/main/java/org/apache/cxf/jca/servant/EJBEndpoint.java b/integration/jca/src/main/java/org/apache/cxf/jca/servant/EJBEndpoint.java
index 01ea8f7..4f7d6cf 100644
--- a/integration/jca/src/main/java/org/apache/cxf/jca/servant/EJBEndpoint.java
+++ b/integration/jca/src/main/java/org/apache/cxf/jca/servant/EJBEndpoint.java
@@ -141,9 +141,9 @@ public class EJBEndpoint {
             return DEFAULT_HTTP_PORT;
         }
         if (end < index) {
-            return new Integer(address.substring(index + 1)).intValue();
+            return Integer.valueOf(address.substring(index + 1)).intValue();
         } 
-        return new Integer(address.substring(index + 1, end)).intValue();
+        return Integer.valueOf(address.substring(index + 1, end)).intValue();
     }
     
     private static boolean isJaxWsServiceInterface(Class<?> cls) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/33083c06/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaPrimitiveHandler.java
----------------------------------------------------------------------
diff --git a/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaPrimitiveHandler.java
b/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaPrimitiveHandler.java
index 4bf30d3..99a299d 100644
--- a/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaPrimitiveHandler.java
+++ b/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaPrimitiveHandler.java
@@ -192,7 +192,7 @@ public class CorbaPrimitiveHandler extends CorbaObjectHandler {
             break;
         case TCKind._tk_char:
             // A char is mapped to a byte, we need it as a character
-            Byte byteValue = new Byte(data);
+            Byte byteValue = Byte.valueOf(data);
             // for values < 0 + 256 
             // This means that we can directly write out the chars in the normal
             // range 0-127 even when using UTF-8
@@ -205,22 +205,22 @@ public class CorbaPrimitiveHandler extends CorbaObjectHandler {
             obj = Character.valueOf(data.charAt(0));
             break;
         case TCKind._tk_octet:
-            obj = new Short(data).byteValue();
+            obj = Short.valueOf(data).byteValue();
             break;
         case TCKind._tk_short:
-            obj = new Short(data);
+            obj = Short.valueOf(data);
             break;
         case TCKind._tk_ushort:
-            obj = new Integer(data);
+            obj = Integer.valueOf(data);
             break;
         case TCKind._tk_long:
-            obj = new Integer(data);
+            obj = Integer.valueOf(data);
             break;
         case TCKind._tk_longlong:
-            obj = new Long(data);
+            obj = Long.valueOf(data);
             break;
         case TCKind._tk_ulong:
-            obj = new Long(data);
+            obj = Long.valueOf(data);
             break;
         case TCKind._tk_ulonglong:
             obj = new java.math.BigInteger(data);
@@ -231,7 +231,7 @@ public class CorbaPrimitiveHandler extends CorbaObjectHandler {
             } else if ("-INF".equals(data)) {
                 obj = Float.NEGATIVE_INFINITY;
             } else {
-                obj = new Float(data);
+                obj = Float.valueOf(data);
             }
             break;
         case TCKind._tk_double:
@@ -240,7 +240,7 @@ public class CorbaPrimitiveHandler extends CorbaObjectHandler {
             } else if ("-INF".equals(data)) {
                 obj = Double.NEGATIVE_INFINITY;
             } else {
-                obj = new Double(data);
+                obj = Double.valueOf(data);
             }
             break;
         case TCKind._tk_string:

http://git-wip-us.apache.org/repos/asf/cxf/blob/33083c06/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
b/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
index ad21c55..9f793de 100644
--- a/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
+++ b/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
@@ -633,7 +633,7 @@ public class JettyHTTPServerEngine implements ServerEngine {
                 .invoke(result, connectionFactories);
             
             if (getMaxIdleTime() > 0) {
-                result.getClass().getMethod("setIdleTimeout", Long.TYPE).invoke(result, new
Long(getMaxIdleTime()));
+                result.getClass().getMethod("setIdleTimeout", Long.TYPE).invoke(result, Long.valueOf(getMaxIdleTime()));
             }
 
         } catch (RuntimeException rex) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/33083c06/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 9d104ac..0de2066 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
@@ -353,7 +353,7 @@ public class JMSEndpoint {
     }
     
     public void setConcurrentConsumers(String concurrentConsumers) {
-        this.concurrentConsumers = new Integer(concurrentConsumers);
+        this.concurrentConsumers = Integer.valueOf(concurrentConsumers);
     }
     
     public String getPassword() {

http://git-wip-us.apache.org/repos/asf/cxf/blob/33083c06/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java
----------------------------------------------------------------------
diff --git a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java
index 4442ec5..bf68119 100644
--- a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java
+++ b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMManager.java
@@ -261,7 +261,7 @@ public class RMManager {
      */
     public void setConfiguration(RMConfiguration configuration) {
         if (configuration.getBaseRetransmissionInterval() == null) {
-            Long value = new Long(RetransmissionQueue.DEFAULT_BASE_RETRANSMISSION_INTERVAL);
+            Long value = Long.valueOf(RetransmissionQueue.DEFAULT_BASE_RETRANSMISSION_INTERVAL);
             configuration.setBaseRetransmissionInterval(value);
         }
         if (configuration.getRMNamespace() == null) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/33083c06/rt/ws/security/src/main/java/org/apache/cxf/ws/security/cache/CacheCleanupListener.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/cache/CacheCleanupListener.java
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/cache/CacheCleanupListener.java
index 53c5b8c..5f190cf 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/cache/CacheCleanupListener.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/cache/CacheCleanupListener.java
@@ -58,11 +58,11 @@ public class CacheCleanupListener implements ServerLifeCycleListener,
ClientLife
             close((Closeable)ts);
         }
         ReplayCache rc = (ReplayCache)info.getProperty(SecurityConstants.NONCE_CACHE_INSTANCE);
-        if (rc instanceof Closeable) {
+        if (rc != null) {
             close((Closeable)rc);
         }
         rc = (ReplayCache)info.getProperty(SecurityConstants.TIMESTAMP_CACHE_INSTANCE);
-        if (rc instanceof Closeable) {
+        if (rc != null) {
             close((Closeable)rc);
         }
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/33083c06/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSUtils.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSUtils.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSUtils.java
index 20a4434..f55e73f 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSUtils.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSUtils.java
@@ -112,7 +112,7 @@ public final class STSUtils {
         
         
         // Find out if we have an EPR to get the STS Address (possibly via WS-MEX)
-        if (itok != null && itok.getIssuer() != null && message != null)
{
+        if (itok != null && itok.getIssuer() != null) {
             EndpointReferenceType epr = null;
             try {
                 epr = VersionTransformer.parseEndpointReference(itok.getIssuer());

http://git-wip-us.apache.org/repos/asf/cxf/blob/33083c06/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractWSS4JStaxInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractWSS4JStaxInterceptor.java
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractWSS4JStaxInterceptor.java
index bc54fed..7c7f766 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractWSS4JStaxInterceptor.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/AbstractWSS4JStaxInterceptor.java
@@ -184,7 +184,7 @@ public abstract class AbstractWSS4JStaxInterceptor implements SoapInterceptor,
     
     private  Collection<Pattern> convertCertConstraints(String certConstraints) {
         String[] certConstraintsList = certConstraints.split(",");
-        if (certConstraintsList != null) {
+        if (certConstraintsList.length > 0) {
             Collection<Pattern> subjectCertConstraints = 
                 new ArrayList<Pattern>(certConstraintsList.length);
             for (String certConstraint : certConstraintsList) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/33083c06/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/StaxSymmetricBindingHandler.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/StaxSymmetricBindingHandler.java
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/StaxSymmetricBindingHandler.java
index 4b41380..15c106b 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/StaxSymmetricBindingHandler.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/StaxSymmetricBindingHandler.java
@@ -253,12 +253,14 @@ public class StaxSymmetricBindingHandler extends AbstractStaxBindingHandler
{
                 
             if (sigParts.size() > 0) {
                 AbstractTokenWrapper sigAbstractTokenWrapper = getSignatureToken();
-                AbstractToken sigToken = sigAbstractTokenWrapper.getToken();
-                if (sigAbstractTokenWrapper != null && isRequestor()) {
-                    doSignature(sigAbstractTokenWrapper, sigToken, tok, sigParts);
-                } else if (!isRequestor()) {
-                    addSignatureConfirmation(sigParts);
-                    doSignature(sigAbstractTokenWrapper, sigToken, tok, sigParts);
+                if (sigAbstractTokenWrapper != null) {
+                    AbstractToken sigToken = sigAbstractTokenWrapper.getToken();
+                    if (isRequestor()) {
+                        doSignature(sigAbstractTokenWrapper, sigToken, tok, sigParts);
+                    } else {
+                        addSignatureConfirmation(sigParts);
+                        doSignature(sigAbstractTokenWrapper, sigToken, tok, sigParts);
+                    }
                 }
             }
             

http://git-wip-us.apache.org/repos/asf/cxf/blob/33083c06/testutils/src/main/java/org/apache/cxf/customer/wraped/CustomerService.java
----------------------------------------------------------------------
diff --git a/testutils/src/main/java/org/apache/cxf/customer/wraped/CustomerService.java b/testutils/src/main/java/org/apache/cxf/customer/wraped/CustomerService.java
index 81647a1..578980b 100644
--- a/testutils/src/main/java/org/apache/cxf/customer/wraped/CustomerService.java
+++ b/testutils/src/main/java/org/apache/cxf/customer/wraped/CustomerService.java
@@ -70,7 +70,7 @@ public class CustomerService {
 
     @WebMethod
     public void deleteCustomer(String id) {
-        customers.remove(new Long(id));
+        customers.remove(Long.valueOf(id));
     }
 
     final Customer createCustomer() {

http://git-wip-us.apache.org/repos/asf/cxf/blob/33083c06/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ArrayVisitor.java
----------------------------------------------------------------------
diff --git a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ArrayVisitor.java
b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ArrayVisitor.java
index cb2123f..f73a982 100644
--- a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ArrayVisitor.java
+++ b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ArrayVisitor.java
@@ -93,7 +93,7 @@ public class ArrayVisitor extends VisitorBase {
         }
 
         // process first array
-        Long size = new Long(firstSizeNode.toString());
+        Long size = Long.valueOf(firstSizeNode.toString());
         XmlSchemaType stype = null;
         CorbaType ctype = null;
         if (identifierNode != null) {
@@ -153,7 +153,7 @@ public class ArrayVisitor extends VisitorBase {
             result = doAnonarray(next, stype, ctype);
 
             Scope scopedName = TypesUtils.generateAnonymousScopedName(getScope(), schema);
-            Long size = new Long(node.toString());
+            Long size = Long.valueOf(node.toString());
 
             if (result.getSchemaType() == null) {
                 result.setSchemaType(generateSchemaArray(scopedName,

http://git-wip-us.apache.org/repos/asf/cxf/blob/33083c06/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/FixedVisitor.java
----------------------------------------------------------------------
diff --git a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/FixedVisitor.java
b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/FixedVisitor.java
index 46897b4..eb4f1a9 100644
--- a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/FixedVisitor.java
+++ b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/FixedVisitor.java
@@ -82,8 +82,8 @@ public class FixedVisitor extends VisitorBase {
         Scope scopedName = new Scope(getScope(), identifierNode);
 
         // validate digits and scale
-        Long digits = new Long(digitsNode.toString());
-        Long scale = new Long(scaleNode.toString());
+        Long digits = Long.valueOf(digitsNode.toString());
+        Long scale = Long.valueOf(scaleNode.toString());
         if (digits < 1 || digits > 31) {
             //throw IllegalIDLException();
             System.out.println("Digits cannot be greater than 31");

http://git-wip-us.apache.org/repos/asf/cxf/blob/33083c06/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/StringVisitor.java
----------------------------------------------------------------------
diff --git a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/StringVisitor.java
b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/StringVisitor.java
index f4ef3b4..726f43e 100644
--- a/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/StringVisitor.java
+++ b/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/StringVisitor.java
@@ -135,7 +135,7 @@ public class StringVisitor extends VisitorBase {
             // corba:anonstring
             Anonstring anonstring = new Anonstring();
             anonstring.setQName(new QName(typeMap.getTargetNamespace(), stringScopedName.toString()));
-            anonstring.setBound(new Long(boundNode.toString()));
+            anonstring.setBound(Long.valueOf(boundNode.toString()));
             anonstring.setType(simpleType.getQName());
 
             anon = anonstring;
@@ -144,7 +144,7 @@ public class StringVisitor extends VisitorBase {
             // corba:anonwstring
             Anonwstring anonwstring = new Anonwstring();
             anonwstring.setQName(new QName(typeMap.getTargetNamespace(), stringScopedName.toString()));
-            anonwstring.setBound(new Long(boundNode.toString()));
+            anonwstring.setBound(Long.valueOf(boundNode.toString()));
             anonwstring.setType(simpleType.getQName());
 
             anon = anonwstring;
@@ -180,7 +180,7 @@ public class StringVisitor extends VisitorBase {
             // corba:anonstring
             Anonstring anonstring = new Anonstring();
             anonstring.setQName(new QName(typeMap.getTargetNamespace(), anonstringName));
-            anonstring.setBound(new Long(boundNode.toString()));
+            anonstring.setBound(Long.valueOf(boundNode.toString()));
             anonstring.setType(simpleType.getQName());
 
             anon = anonstring;
@@ -189,7 +189,7 @@ public class StringVisitor extends VisitorBase {
             // corba:anonwstring
             Anonwstring anonwstring = new Anonwstring();
             anonwstring.setQName(new QName(typeMap.getTargetNamespace(), anonstringName));
-            anonwstring.setBound(new Long(boundNode.toString()));
+            anonwstring.setBound(Long.valueOf(boundNode.toString()));
             anonwstring.setType(simpleType.getQName());
 
             anon = anonwstring;


Mime
View raw message