cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1396974 - in /cxf/trunk: api/src/main/java/org/apache/cxf/common/jaxb/ rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/ rt/core/src/main/java/org/apache/cxf/interceptor/security/ rt/frontend/jaxrs/src/main/java/org/apach...
Date Thu, 11 Oct 2012 10:20:18 GMT
Author: coheigea
Date: Thu Oct 11 10:20:17 2012
New Revision: 1396974

URL: http://svn.apache.org/viewvc?rev=1396974&view=rev
Log:
More code cleanup

Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/common/jaxb/JAXBUtils.java
    cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/HandlerIterator.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/security/JAASLoginInterceptor.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServiceFactoryBean.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/XPathProvider.java
    cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser/bootstrapping/BootstrapStorage.java
    cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/atom/AtomPushEngineConfigurator.java
    cxf/trunk/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java
    cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
    cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SourceSequence.java
    cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlConst.java
    cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
    cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/common/jaxb/JAXBUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/common/jaxb/JAXBUtils.java?rev=1396974&r1=1396973&r2=1396974&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/common/jaxb/JAXBUtils.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/common/jaxb/JAXBUtils.java Thu Oct 11 10:20:17
2012
@@ -343,7 +343,7 @@ public final class JAXBUtils {
         boolean conventionalIdentifier = isConventionalIdentifier(buf, type); 
         if (legalIdentifier && conventionalIdentifier) {
             if (JAXBUtils.isJavaKeyword(name) && type == IdentifierType.VARIABLE)
{
-                name = normalizePackageNamePart(name.toString());
+                name = normalizePackageNamePart(name);
             }
             return name;
         }

Modified: cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/HandlerIterator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/HandlerIterator.java?rev=1396974&r1=1396973&r2=1396974&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/HandlerIterator.java
(original)
+++ cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/HandlerIterator.java
Thu Oct 11 10:20:17 2012
@@ -38,25 +38,23 @@ public class HandlerIterator implements 
     }
     
     public boolean hasNext() {
-        if (next == null) {
-            while (next == null && count < params.length) {
-                int mode = params[count].getMode();
-                int value = org.omg.CORBA.ARG_OUT.value;
-                if (isServer) {
-                    value = org.omg.CORBA.ARG_IN.value;
-                }
-                if (mode == value
-                    || mode == org.omg.CORBA.ARG_INOUT.value) {
-                    next = params[count].getObject();
-                }
-                if (!isServer 
-                    && mode == org.omg.CORBA.ARG_INOUT.value
-                    && next instanceof CorbaPrimitiveHandler) {
-                    CorbaPrimitiveHandler prim = (CorbaPrimitiveHandler)next;
-                    prim.clear();
-                }
-                count++;
+        while (next == null && count < params.length) {
+            int mode = params[count].getMode();
+            int value = org.omg.CORBA.ARG_OUT.value;
+            if (isServer) {
+                value = org.omg.CORBA.ARG_IN.value;
             }
+            if (mode == value
+                || mode == org.omg.CORBA.ARG_INOUT.value) {
+                next = params[count].getObject();
+            }
+            if (!isServer 
+                && mode == org.omg.CORBA.ARG_INOUT.value
+                && next instanceof CorbaPrimitiveHandler) {
+                CorbaPrimitiveHandler prim = (CorbaPrimitiveHandler)next;
+                prim.clear();
+            }
+            count++;
         }
         return next != null;
     }

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/security/JAASLoginInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/security/JAASLoginInterceptor.java?rev=1396974&r1=1396973&r2=1396974&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/security/JAASLoginInterceptor.java
(original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/security/JAASLoginInterceptor.java
Thu Oct 11 10:20:17 2012
@@ -143,7 +143,7 @@ public class JAASLoginInterceptor extend
             message.put(SecurityContext.class, createSecurityContext(subject)); 
         } catch (LoginException ex) {
             String errorMessage = "Unauthorized : " + ex.getMessage();
-            LOG.fine(errorMessage.toString());
+            LOG.fine(errorMessage);
             if (reportFault) {
                 throw new AuthenticationException(errorMessage);
             } else {

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServiceFactoryBean.java?rev=1396974&r1=1396973&r2=1396974&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServiceFactoryBean.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServiceFactoryBean.java
Thu Oct 11 10:20:17 2012
@@ -55,7 +55,6 @@ public class JAXRSServiceFactoryBean ext
     
     private Invoker invoker;
     private Executor executor;
-    private Map<String, Object> properties;
     private boolean enableStatic;
     private QName serviceName;
     
@@ -257,10 +256,6 @@ public class JAXRSServiceFactoryBean ext
 
         setService(service);
         sendEvent(Event.SERVICE_SET, service);
-
-        if (properties != null) {
-            service.putAll(properties);
-        }
     }
 
     protected Invoker createInvoker() {

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java?rev=1396974&r1=1396973&r2=1396974&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
Thu Oct 11 10:20:17 2012
@@ -1433,7 +1433,7 @@ public class WadlGenerator implements Re
                         }
                         if (!locs.containsKey(loc)) {
                             locs.put(loc, ui.getBaseUriBuilder().path(
-                                 loc.toString()).build().toString());
+                                 loc).build().toString());
                         }
                     }
                 } catch (Exception ex) {

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/XPathProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/XPathProvider.java?rev=1396974&r1=1396973&r2=1396974&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/XPathProvider.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/XPathProvider.java
Thu Oct 11 10:20:17 2012
@@ -73,7 +73,7 @@ public class XPathProvider<T> implements
     public boolean isReadable(Class<?> cls, Type genericType, Annotation[] annotations,
MediaType mediaType) {
         
         return globalExpression != null && (className == null 
-            || className != null && className.equals(cls.getName()))  
+            || className.equals(cls.getName()))  
             || classExpressions != null && classExpressions.containsKey(cls.getName());
     }
 

Modified: cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser/bootstrapping/BootstrapStorage.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser/bootstrapping/BootstrapStorage.java?rev=1396974&r1=1396973&r2=1396974&view=diff
==============================================================================
--- cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser/bootstrapping/BootstrapStorage.java
(original)
+++ cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser/bootstrapping/BootstrapStorage.java
Thu Oct 11 10:20:17 2012
@@ -27,7 +27,7 @@ import java.net.JarURLConnection;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.Arrays;
-import java.util.HashMap;
+import java.util.Collections;
 import java.util.Locale;
 import java.util.logging.Level;
 import java.util.logging.Logger;
@@ -213,6 +213,7 @@ public class BootstrapStorage {
             setArrayKeys(Arrays.asList(SUBSCRIPTIONS_ARRAY));
 
             // Removes namespace from output
+/*
             setOutTransformElements(new HashMap<String, String>() {
                 private static final long serialVersionUID = -1341932955817405356L;
 
@@ -220,8 +221,12 @@ public class BootstrapStorage {
                     put("{" + LOGGING_NAMESPACE + "}*", "*");
                 }
             });
+*/
+            setOutTransformElements(Collections.singletonMap(
+                "{" + LOGGING_NAMESPACE + "}*", "*"));
 
             // Adds namespace to input
+/*
             setInTransformElements(new HashMap<String, String>() {
                 private static final long serialVersionUID = -1509522821399368946L;
 
@@ -229,6 +234,9 @@ public class BootstrapStorage {
                     put("*", "{" + LOGGING_NAMESPACE + "}*");
                 }
             });
+*/
+            setInTransformElements(Collections.singletonMap(
+                "*", "{" + LOGGING_NAMESPACE + "}*"));
         }
     }
 }

Modified: cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/atom/AtomPushEngineConfigurator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/atom/AtomPushEngineConfigurator.java?rev=1396974&r1=1396973&r2=1396974&view=diff
==============================================================================
--- cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/atom/AtomPushEngineConfigurator.java
(original)
+++ cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/atom/AtomPushEngineConfigurator.java
Thu Oct 11 10:20:17 2012
@@ -201,7 +201,7 @@ final class AtomPushEngineConfigurator {
     }
 
     private <T extends Enum<T>> T parseEnum(String value, T defaultValue, Class<T>
enumClass) {
-        if (value == null | "".equals(value)) {
+        if (value == null || "".equals(value)) {
             return defaultValue;
         }
         try {

Modified: cxf/trunk/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java?rev=1396974&r1=1396973&r2=1396974&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java
(original)
+++ cxf/trunk/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduit.java
Thu Oct 11 10:20:17 2012
@@ -331,23 +331,22 @@ public class AsyncHTTPConduit extends UR
 
         public int copyFrom(InputStream in) throws IOException {
             int count = 0;
-            if (buffer != null) {
-                while (buffer != null) {
-                    int pos = buffer.size();
-                    int i = in.read(buffer.getRawBytes(), pos,
-                                    this.threshold - pos);
-                    if (i > 0) {
-                        buffer.setSize(pos + i);
-                        if (buffer.size() >= threshold) {
-                            thresholdReached();
-                            unBuffer();
-                        }
-                        count += i;
-                    } else {
-                        return count;
+            while (buffer != null) {
+                int pos = buffer.size();
+                int i = in.read(buffer.getRawBytes(), pos,
+                                this.threshold - pos);
+                if (i > 0) {
+                    buffer.setSize(pos + i);
+                    if (buffer.size() >= threshold) {
+                        thresholdReached();
+                        unBuffer();
                     }
+                    count += i;
+                } else {
+                    return count;
                 }
             }
+           
             if (cachingForRetransmission) {
                 count += IOUtils.copy(in, wrappedStream);
             } else {

Modified: cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java?rev=1396974&r1=1396973&r2=1396974&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
(original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConduit.java
Thu Oct 11 10:20:17 2012
@@ -432,7 +432,7 @@ public class JMSConduit extends Abstract
 
     protected static boolean isSetReplyTo(Message message) {         
         Boolean ret = (Boolean)message.get(JMSConstants.JMS_SET_REPLY_TO);
-        return ret == null || (ret != null && ret.booleanValue());
+        return ret == null || ret.booleanValue();
     }
 
     @Override
@@ -441,4 +441,4 @@ public class JMSConduit extends Abstract
         super.finalize();
     }
 
-}
\ No newline at end of file
+}

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SourceSequence.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SourceSequence.java?rev=1396974&r1=1396973&r2=1396974&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SourceSequence.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/SourceSequence.java Thu Oct 11 10:20:17
2012
@@ -94,7 +94,7 @@ public class SourceSequence extends Abst
      * @return the identifier of the rm source
      */
     public String getEndpointIdentifier() {
-        return source.getName().toString();
+        return source.getName();
     }
 
     /**

Modified: cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlConst.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlConst.java?rev=1396974&r1=1396973&r2=1396974&view=diff
==============================================================================
--- cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlConst.java
(original)
+++ cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlConst.java
Thu Oct 11 10:20:17 2012
@@ -47,7 +47,7 @@ public final class IdlConst extends IdlD
 
     public void write(PrintWriter pw) {
         pw.println(indent() + "const " + base.fullName(scopeName()) + " " 
-                   + localName() + " = "  + value.toString() + ";");
+                   + localName() + " = "  + value + ";");
     }
     
 }

Modified: cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java?rev=1396974&r1=1396973&r2=1396974&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
(original)
+++ cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
Thu Oct 11 10:20:17 2012
@@ -101,7 +101,7 @@ public final class CustomizationParser {
             if (wsdlNode == null) {
                 throw new ToolException(new Message("MISSING_WSDL", LOG, wsdlURL));
             }
-            customizedElements.put(wsdlURL.toString(), wsdlNode);
+            customizedElements.put(wsdlURL, wsdlNode);
             bindingFiles = (String[])env.get(ToolConstants.CFG_BINDING);
             if (bindingFiles == null) {
                 return;
@@ -498,7 +498,7 @@ public final class CustomizationParser {
                 targetNode = getTargetNode(wsdlURI);
                 String resolvedLoc = wsdlURI;
                 if (targetNode == null && env.get(ToolConstants.CFG_CATALOG) != null)
{
-                    resolvedLoc = resolveByCatalog(wsdlURI.toString());
+                    resolvedLoc = resolveByCatalog(wsdlURI);
                     targetNode = getTargetNode(resolvedLoc);
                 }
                 if (targetNode == null) {

Modified: cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java?rev=1396974&r1=1396973&r2=1396974&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java
(original)
+++ cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java
Thu Oct 11 10:20:17 2012
@@ -698,7 +698,7 @@ public class ParameterProcessor extends 
             for (MessagePartInfo part : outputParts) {
                 if (!parameterList.contains(part.getName().getLocalPart())) {
                     MessagePartInfo inpart = inputMessage.getMessagePart(part.getName());
-                    if (inpart == null || (inpart != null && !isSamePart(inpart,
part))) {
+                    if (inpart == null || !isSamePart(inpart, part)) {
                         outputUnlistedParts.add(part);
                     }
                 }



Mime
View raw message