Author: azeez
Date: Wed Dec 22 16:10:45 2010
New Revision: 1051967

URL: http://svn.apache.org/viewvc?rev=1051967&view=rev
Log:
FindBugs improvements based on suggestions AXIS2-4661[A

Modified:
    
axis/axis2/java/core/trunk/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
    
axis/axis2/java/core/trunk/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/CEmitter.java
    
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/message/util/Reader.java
    
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/context/externalize/DebugObjectOutputStream.java
    
axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/builder/ActionAnnot.java
    
axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/AttachmentDescriptionImpl.java
    
axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java
    
axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/URIResolverImpl.java
    
axis/axis2/java/core/trunk/modules/saaj/src/org/apache/axis2/saaj/SOAPHeaderImpl.java

Modified: 
axis/axis2/java/core/trunk/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java?rev=1051967&r1=1051966&r2=1051967&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
 Wed Dec 22 16:10:45 2010
@@ -113,17 +113,18 @@ public class AxisServiceBasedMultiLangua
     protected static final String MESSAGE_RECEIVER_SUFFIX = "MessageReceiver";
     protected static final String DATABINDING_SUPPORTER_NAME_SUFFIX = 
"DatabindingSupporter";
 
-    protected static Map mepToClassMap;
-    protected static Map mepToSuffixMap;
+    protected static final Map mepToClassMap;
+    protected static final Map mepToSuffixMap;
 
     protected AxisBinding axisBinding;
     protected AxisEndpoint axisEndpoint;
 
     protected int uniqueFaultNameCounter = 0;
+
     /**
      * Field constructorMap
      */
-    protected static HashMap constructorMap = new HashMap(50);
+    protected static final HashMap constructorMap = new HashMap(50);
 
     //~--- static initializers ------------------------------------------------
 
@@ -2635,11 +2636,9 @@ public class AxisServiceBasedMultiLangua
             outputDir = new File(outputDir, dir2);
         }
 
-        if (!outputDir.exists()) {//$NON-SEC-3
-            outputDir.mkdirs();//$NON-SEC-2
+        if (!outputDir.exists() && !outputDir.mkdirs()){
+            log.warn("Cannot create output directory " + 
outputDir.getAbsolutePath());
         }
-
-
         return outputDir;
     }
 
@@ -3218,30 +3217,26 @@ public class AxisServiceBasedMultiLangua
      * @param operation
      * @return Returns Element.
      */
-    protected Element   getOutputParamElement(Document doc, AxisOperation 
operation) {
+    protected Element getOutputParamElement(Document doc, AxisOperation 
operation) {
         Element paramElement = doc.createElement("param");
         AxisMessage outputMessage = 
operation.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
-        String typeMappingStr;
+        if (outputMessage == null) {
+            return null;
+        }
         String parameterName;
+        String typeMappingStr;
+        parameterName = 
this.mapper.getParameterName(outputMessage.getElementQName());
+        String typeMapping = 
this.mapper.getTypeMappingName(outputMessage.getElementQName());
+        typeMappingStr = (typeMapping == null) ? "" : typeMapping;
 
-        if (outputMessage != null) {
-            parameterName = 
this.mapper.getParameterName(outputMessage.getElementQName());
-            String typeMapping = 
this.mapper.getTypeMappingName(outputMessage.getElementQName());
-            typeMappingStr = (typeMapping == null)
-                    ? ""
-                    : typeMapping;
-        } else {
-            parameterName = "";
-            typeMappingStr = "";
-        }
 
         addAttribute(doc, "name", parameterName, paramElement);
         addAttribute(doc, "type", typeMappingStr, paramElement);
 
         //adds the short type
         addShortType(paramElement,
-                (outputMessage.getElementQName() == null) ? null :
-                        outputMessage.getElementQName().getLocalPart());
+                     (outputMessage.getElementQName() == null) ? null :
+                     outputMessage.getElementQName().getLocalPart());
 
         // add an extra attribute to say whether the type mapping is the 
default
         if (mapper.getDefaultMappingName().equals(typeMappingStr)) {
@@ -3256,7 +3251,7 @@ public class AxisServiceBasedMultiLangua
         //if the unwrapping or backWordCompatibility flag is on then we have to
         //put the element complex type if it exits
         if (this.codeGenConfiguration.isBackwordCompatibilityMode() ||
-                !this.codeGenConfiguration.isParametersWrapped()) {
+            !this.codeGenConfiguration.isParametersWrapped()) {
             if (outputMessage.getParameter(Constants.COMPLEX_TYPE) != null) {
                 Parameter parameter = 
outputMessage.getParameter(Constants.COMPLEX_TYPE);
                 addAttribute(doc, "complextype", (String) 
parameter.getValue(), paramElement);
@@ -3291,22 +3286,19 @@ public class AxisServiceBasedMultiLangua
             // in out put params we only intersted if there is only one 
parameter
             // otherwise we can not unwrap it.
             // this logic handles at the template level
-             QName qName = null;
+            QName qName;
             for (Iterator iter = partsList.iterator(); iter.hasNext();) {
                 qName = (QName) iter.next();
-                paramElement.appendChild(generateParamComponent(doc,
-                        this.mapper.getParameterName(qName),
-                        this.mapper.getTypeMappingName(
-                                qName),
-                        operation.getName(),
-                        qName,
-                        qName.getLocalPart(),
-                        (this.mapper.getTypeMappingStatus(
-                                qName) != null),
-                        Constants.ARRAY_TYPE.equals(
-                                this.mapper.getTypeMappingStatus(
-                                        qName)))
-                );
+                paramElement.
+                        appendChild(generateParamComponent(doc,
+                                                           
this.mapper.getParameterName(qName),
+                                                           
this.mapper.getTypeMappingName(qName),
+                                                           operation.getName(),
+                                                           qName,
+                                                           
qName.getLocalPart(),
+                                                           
(this.mapper.getTypeMappingStatus(qName) != null),
+                                                           
Constants.ARRAY_TYPE.equals(this.mapper.getTypeMappingStatus(qName)))
+                        );
             }
 
         }

Modified: 
axis/axis2/java/core/trunk/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/CEmitter.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/CEmitter.java?rev=1051967&r1=1051966&r2=1051967&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/CEmitter.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/CEmitter.java
 Wed Dec 22 16:10:45 2010
@@ -596,7 +596,6 @@ public class CEmitter extends AxisServic
                     opsFound = true;
                     List soapHeaderInputParameterList = new ArrayList();
                     List soapHeaderOutputParameterList = new ArrayList();
-                    List soapHeaderFaultParameterList = new ArrayList();
                     methodElement = doc.createElement("method");
                     String localPart = axisOperation.getName().getLocalPart();
                     String opCName = makeCClassName(localPart);
@@ -765,27 +764,19 @@ public class CEmitter extends AxisServic
         String typeMappingStr;
         AxisMessage message;
 
-        if (messageType.equals(WSDLConstants.MESSAGE_LABEL_IN_VALUE))
+        if (messageType.equals(WSDLConstants.MESSAGE_LABEL_IN_VALUE)) {
             message = 
operation.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
-        else
+        } else {
             message = 
operation.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
-
-        QName typeMapping = message.getElementQName();
+        }
 
         String paramType = 
this.mapper.getTypeMappingName(message.getElementQName());
         if (doc == null || paramType == null || param == null) {
             return;
         }
 
-        if (message != null) {
-            String type = 
this.mapper.getTypeMappingName(message.getElementQName());
-            typeMappingStr = (type == null)
-                    ? ""
-                    : type;
-        } else {
-            typeMappingStr = "";
-        }
-
+        String type = 
this.mapper.getTypeMappingName(message.getElementQName());
+        typeMappingStr = (type == null) ? "" : type;
         addAttribute(doc, "caps-type", paramType.toUpperCase(), param);
 
         if (!paramType.equals("") && !paramType.equals("void") &&
@@ -833,8 +824,8 @@ public class CEmitter extends AxisServic
             }
         }
 
-        if (!outputDir.exists()) {
-            outputDir.mkdirs();
+        if (!outputDir.exists() && !outputDir.mkdirs()){
+            log.warn("Could not create output directory " + 
outputDir.getAbsolutePath());
         }
 
         return outputDir;

Modified: 
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/message/util/Reader.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/message/util/Reader.java?rev=1051967&r1=1051966&r2=1051967&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/message/util/Reader.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/message/util/Reader.java
 Wed Dec 22 16:10:45 2010
@@ -30,6 +30,8 @@ import javax.xml.stream.Location;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.ws.WebServiceException;
+import java.util.Arrays;
+
 /**
  * Reader In many situations, you want the ability to reset an 
XMLStreamReader. (Or at least ask if
  * the XMLStreamReader is resettable).
@@ -44,7 +46,6 @@ public abstract class Reader implements 
     protected XMLStreamReader reader;
     private final boolean resettable;
     private static final Log log = LogFactory.getLog(Reader.class);
-    private static final boolean isDebug = log.isDebugEnabled();
 
     /**
      * @param reader
@@ -69,7 +70,7 @@ public abstract class Reader implements 
      */
     public boolean isResettable() {
        debug("Entering isResettable....");
-       debug("resettable = "+resettable);
+       debug("resettable = ", resettable);
         return resettable;
     }
 
@@ -92,314 +93,317 @@ public abstract class Reader implements 
     public int getAttributeCount() {
        debug("Entering getAttributeCount....");
        int ac = reader.getAttributeCount();
-       debug("reader.getAttributeCount() = "+ac);
+       debug("reader.getAttributeCount() = ", ac);
         return ac;
     }
 
     public String getAttributeLocalName(int arg0) {
        debug("Entering getAttributeLocalName....");
        String aln = reader.getAttributeLocalName(arg0);
-       debug("reader.getAttributeLocalName(arg0) = "+aln);
+       debug("reader.getAttributeLocalName(arg0) = ", aln);
         return aln;
     }
 
     public QName getAttributeName(int arg0) {
        debug("Entering getAttributeName....");
        QName q = reader.getAttributeName(arg0);
-       debug("reader.getAttributeName(arg0) = "+q);
+       debug("reader.getAttributeName(arg0) = ", q);
         return q;
     }
 
     public String getAttributeNamespace(int arg0) {
        debug("Entering getAttributeNamespace....");
        String an = reader.getAttributeNamespace(arg0);
-       debug("reader.getAttributeNamespace(arg0) = "+an);
+       debug("reader.getAttributeNamespace(arg0) = ", an);
         return an;
     }
 
     public String getAttributePrefix(int arg0) {
        debug("Entering getAttributePrefix....");
        String ap = reader.getAttributePrefix(arg0);
-       debug("reader.getAttributePrefix(arg0) = "+ap);
+       debug("reader.getAttributePrefix(arg0) = ", ap);
         return ap;
     }
 
     public String getAttributeType(int arg0) {
        debug("Entering getAttributeType....");
        String at = reader.getAttributeType(arg0);
-       debug("reader.getAttributeType(arg0) = "+at);
+       debug("reader.getAttributeType(arg0) = ", at);
         return at;
     }
 
     public String getAttributeValue(int arg0) {
        debug("Entering getAttributeValue....");
        String av = reader.getAttributeValue(arg0);
-       debug("reader.getAttributeValue(arg0) = "+av);
+       debug("reader.getAttributeValue(arg0) = ", av);
         return av;
     }
 
     public String getAttributeValue(String arg0, String arg1) {
        debug("Entering getAttributeValue....");
        String av = reader.getAttributeValue(arg0, arg1);
-       debug("reader.getAttributeValue(arg0, arg1) = "+av);
+       debug("reader.getAttributeValue(arg0, arg1) = ", av);
         return av;
     }
 
     public String getCharacterEncodingScheme() {
        debug("Entering getCharacterEncodingScheme....");
        String ces = reader.getCharacterEncodingScheme();
-       debug("reader.getCharacterEncodingScheme = "+ces);
+       debug("reader.getCharacterEncodingScheme = ", ces);
         return ces;
     }
 
     public String getElementText() throws XMLStreamException {
        debug("Entering getElementText....");
        String et = reader.getElementText();
-       debug("reader.getElementText = "+et);
+       debug("reader.getElementText = ", et);
         return et;
     }
 
     public String getEncoding() {
        debug("Entering getEncoding....");
        String e = reader.getEncoding();
-       debug("reader.getEncoding() = "+e);
+       debug("reader.getEncoding() = ", e);
         return e;
     }
 
     public int getEventType() {
        debug("Entering getEventType....");
        int et = reader.getEventType();
-       debug("reader.getEventType() = "+et);
+       debug("reader.getEventType() = ", et);
         return et;
     }
 
     public String getLocalName() {
        debug("Entering getLocation....");
        String ln = reader.getLocalName();
-       debug("reader.getLocalName() = "+ln);
+       debug("reader.getLocalName() = ", ln);
         return ln;
     }
 
     public Location getLocation() {
        debug("Entering getLocation....");
        Location l = reader.getLocation();
-       debug("reader.getLocation() = "+l);
+       debug("reader.getLocation() = ", l);
         return l;
     }
 
     public QName getName() {
        debug("Entering getName....");
        QName qn = reader.getName();
-       debug("reader.getName() = "+qn);
+       debug("reader.getName() = ", qn);
         return qn;
     }
 
     public NamespaceContext getNamespaceContext() {
        debug("Entering getNamespaceContext....");
        NamespaceContext nsContext = reader.getNamespaceContext();
-       debug("reader.getNamespaceContext() = "+nsContext);
+       debug("reader.getNamespaceContext() = ", nsContext);
         return nsContext;
     }
 
     public int getNamespaceCount() {
        debug("Entering getNamespaceCount....");
        int nsCount = reader.getNamespaceCount();
-       debug("reader.getNamespaceCount() = "+nsCount);
+       debug("reader.getNamespaceCount() = ", nsCount);
         return nsCount;
     }
 
     public String getNamespacePrefix(int arg0) {
        debug("Entering getNamespacePrefix....");
        String nsPrefix = reader.getNamespacePrefix(arg0);
-       debug("reader.getNamespacePrefix(arg0 = "+nsPrefix);
+       debug("reader.getNamespacePrefix(arg0 = ", nsPrefix);
         return nsPrefix;
     }
 
     public String getNamespaceURI() {
        debug("Entering getNamespaceURI....");
        String nsUri = reader.getNamespaceURI();
-       debug("reader.getNamespaceURI() = "+nsUri);
+       debug("reader.getNamespaceURI() = ", nsUri);
         return nsUri;
     }
 
     public String getNamespaceURI(int arg0) {
        debug("Entering getNamespaceURI....");
        String nsUri = reader.getNamespaceURI(arg0);
-       debug("reader.getNamespaceURI(arg0) = "+nsUri);
+       debug("reader.getNamespaceURI(arg0) = ", nsUri);
         return nsUri;
     }
 
     public String getNamespaceURI(String arg0) {
        debug("Entering getNamespaceURI....");
        String nsUri = reader.getNamespaceURI(arg0);
-       debug("reader.getNamespaceURI(arg0) = "+nsUri);
+       debug("reader.getNamespaceURI(arg0) = ", nsUri);
         return nsUri;
     }
 
     public String getPIData() {
        debug("Entering getPIData....");
        String pid = reader.getPIData();
-       debug("reader.getPIData() = "+pid);
+       debug("reader.getPIData() = ", pid);
         return pid;
     }
 
     public String getPITarget() {
        debug("Entering getPITarget....");
        String pit = reader.getPITarget();
-       debug("reader.getPITarget() = "+pit);
+       debug("reader.getPITarget() = ", pit);
         return pit;
     }
 
     public String getPrefix() {
        debug("Entering getPrefix....");
        String gpf = reader.getPrefix();
-       debug("reader.getPrefix() = "+gpf);
+       debug("reader.getPrefix() = ", gpf);
         return gpf;
     }
 
     public Object getProperty(String arg0) throws IllegalArgumentException {
        debug("Entering getProperty for ..." + arg0);
        Object o = reader.getProperty(arg0);
-       debug("reader.getProperty(arg0) = "+o);
+       debug("reader.getProperty(arg0) = ", o);
         return o;
     }
 
     public String getText() {
        debug("Entering getText....");
        String gt = reader.getText();
-       debug("reader.getText() = "+gt);
+       debug("reader.getText() = ", gt);
         return gt;
     }
 
     public char[] getTextCharacters() {
        debug("Entering getTextCharacters....");
        char[] gtc = reader.getTextCharacters();
-       debug("reader.getTextCharacters() = "+gtc.toString());
+       debug("reader.getTextCharacters() = ", Arrays.toString(gtc));
         return gtc;
     }
 
     public int getTextCharacters(int arg0, char[] arg1, int arg2, int arg3) 
throws XMLStreamException {
        debug("Entering getTextCharacters....");
        int gtc = reader.getTextCharacters(arg0, arg1, arg2, arg3);
-       debug("reader.getTextCharacters() = "+gtc);
+       debug("reader.getTextCharacters() = ", gtc);
         return gtc;
     }
 
     public int getTextLength() {
        debug("Entering getTextLength....");
        int gtl = reader.getTextLength();
-       debug("reader.getTextLength() = "+gtl);
+       debug("reader.getTextLength() = ", gtl);
         return gtl;
     }
 
     public int getTextStart() {
        debug("Entering getTextStart....");
        int gts = reader.getTextStart();
-       debug("reader.getTextStart() = "+gts);
+       debug("reader.getTextStart() = ", gts);
         return reader.getTextStart();
     }
 
     public String getVersion() {
        debug("Entering getVersion....");
        String gv = reader.getVersion();
-       debug("reader.getVersion() = "+gv);
+       debug("reader.getVersion() = ", gv);
         return gv;
     }
 
     public boolean hasName() {
        debug("Entering hasName....");
        boolean b = reader.hasName();
-       debug("reader.hasName() = "+b);
+       debug("reader.hasName() = ", b);
         return b;
     }
 
     public boolean hasNext() throws XMLStreamException {
        debug("Entering hasNext....");
        boolean b = reader.hasNext();
-       debug("reader.hasNext() = "+b);
+       debug("reader.hasNext() = ", b);
         return b;
     }
 
     public boolean hasText() {
        debug("Entering hasText....");
        boolean b = reader.hasText();
-       debug("reader.hasText() = "+b);
+       debug("reader.hasText() = ", b);
         return b;
     }
 
     public boolean isAttributeSpecified(int arg0) {
        debug("Entering isAttributeSpecified....");
        boolean b = reader.isAttributeSpecified(arg0);
-       debug("Entering reader.isAttributeSpecified(arg0) "+b);
+       debug("Entering reader.isAttributeSpecified(arg0) ", b);
         return b;
     }
 
     public boolean isCharacters() {
        debug("Entering isCharacters....");
        boolean b = reader.isCharacters();
-       debug("reader.isCharacters() = "+b);
+       debug("reader.isCharacters() = ", b);
         return b;
     }
 
     public boolean isEndElement() {
        debug("Entering isEndElement....");
        boolean b = reader.isEndElement();
-       debug("reader.isEndElement() = "+b);
+       debug("reader.isEndElement() = ", b);
         return b;
     }
 
     public boolean isStandalone() {
        debug("Entering isStandalone....");
        boolean b = reader.isStandalone();
-       debug("reader.isStandalone() = "+b);
+       debug("reader.isStandalone() = ", b);
         return b;
     }
 
     public boolean isStartElement() {
        debug("Entering isStartElement....");
        boolean b = reader.isStartElement();
-       debug("reader.isStartElement() = "+b);
+       debug("reader.isStartElement() = ", b);
         return b;
     }
 
     public boolean isWhiteSpace() {
        debug("Entering isWhiteSpace....");
        boolean b = reader.isWhiteSpace();
-       debug("reader.isWhiteSpace() = "+b);
+       debug("reader.isWhiteSpace() = ", b);
         return b;
     }
 
     public int next() throws XMLStreamException {
        debug("Entering next....");
        int nxt = reader.next();
-       debug("reader.next() = "+nxt);
+       debug("reader.next() = ", nxt);
         return nxt;
     }
 
     public int nextTag() throws XMLStreamException {
        debug("Entering nextTag....");
        int tag = reader.nextTag();
-       debug("reader.nextTag() = "+tag);
+       debug("reader.nextTag() = ", tag);
         return tag;
     }
 
     public void require(int arg0, String arg1, String arg2) throws 
XMLStreamException {
        debug("Entering require....");
-       debug("reader.require -> arg0 = "+arg0+" ,arg1 = "+arg1+" ,arg2 = 
"+arg2);
+       debug("reader.require -> arg0 = ", arg0, " ,arg1 = ",arg1, " ,arg2 = ", 
arg2);
         reader.require(arg0, arg1, arg2);
     }
 
     public boolean standaloneSet() {
        debug("Entering standaloneSet....");
        boolean b = reader.standaloneSet();
-       debug("reader.standaloneSet() = "+b);
+       debug("reader.standaloneSet() = ", b);
         return b;
     }
-    
-    public void debug(String str) {
-        if (isDebug) {
-            log.debug(str);
+
+    private void debug(Object... messages) {
+        if (log.isDebugEnabled()) {
+            StringBuffer sbuff = new StringBuffer();
+            for (Object msg : messages) {
+                sbuff.append(msg);
+            }
+            log.debug(sbuff.toString());
         }
     }
-
 }

Modified: 
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/context/externalize/DebugObjectOutputStream.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/context/externalize/DebugObjectOutputStream.java?rev=1051967&r1=1051966&r2=1051967&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/context/externalize/DebugObjectOutputStream.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/context/externalize/DebugObjectOutputStream.java
 Wed Dec 22 16:10:45 2010
@@ -30,132 +30,187 @@ import java.io.ObjectStreamConstants;
  * DebugObjectOutputStream delegates to an ObjectOutput object.
  * Each method logs in/out trace information
  */
-public class DebugObjectOutputStream implements ObjectStreamConstants, 
ObjectOutput
-        {
+public class DebugObjectOutputStream implements ObjectStreamConstants, 
ObjectOutput {
     private static final Log log = 
LogFactory.getLog(DebugObjectOutputStream.class);
     private static final boolean isDebug = log.isDebugEnabled();
     ObjectOutput out;
-    
+
     DebugObjectOutputStream(ObjectOutput out) throws IOException {
         super();
-        trace("--START DebugOutputStream--");
+        if (log.isDebugEnabled()) {
+            log.debug("--START DebugOutputStream--");
+        }
         this.out = out;
     }
 
     public void close() throws IOException {
-        trace("--CLOSE DebugOutputStream--");
+        if (log.isDebugEnabled()) {
+            log.debug("--CLOSE DebugOutputStream--");
+        }
         out.close();
     }
 
     public void flush() throws IOException {
-        trace ("start flush()");
+        if (log.isDebugEnabled()) {
+            log.debug("start flush()");
+        }
         out.flush();
-        trace ("end flush()");
+        if (log.isDebugEnabled()) {
+            log.debug("end flush()");
+        }
     }
 
     public void write(byte[] b, int off, int len) throws IOException {
-        trace ("start write(b, off, len) off=" + off + " len=" + len);
+        if (log.isDebugEnabled()) {
+            log.debug("start write(b, off, len) off=" + off + " len=" + len);
+        }
         if (len > 4) {
-            trace (" first four bytes = '" + 
-                   b[off] + "' '" + 
-                   b[off+1] + "' '" +
-                   b[off+2] + "' '" +
-                   b[off+3] + "'");
+            if (log.isDebugEnabled()) {
+                log.debug(" first four bytes = '" +
+                          b[off] + "' '" +
+                          b[off + 1] + "' '" +
+                          b[off + 2] + "' '" +
+                          b[off + 3] + "'");
+            }
         }
         out.write(b, off, len);
-        trace ("end write(b, off, len)");
+        if (log.isDebugEnabled()) {
+            log.debug("end write(b, off, len)");
+        }
     }
 
     public void write(byte[] b) throws IOException {
-        trace ("start write(byte) byte=" + b);
+        if (log.isDebugEnabled()) {
+            log.debug("start write byte[]");
+        }
         out.write(b);
-        trace ("end write(b)");
+        if (log.isDebugEnabled()) {
+            log.debug("end write(b)");
+        }
     }
 
     public void write(int b) throws IOException {
-        trace ("start write(int) int=" + b);
+        if (log.isDebugEnabled()) {
+            log.debug("start write(int) int=" + b);
+        }
         out.write(b);
-        trace ("end write(int)");
+        if (log.isDebugEnabled()) {
+            log.debug("end write(int)");
+        }
     }
 
     public void writeBoolean(boolean v) throws IOException {
-        trace ("start writeBoolean(v) v=" + v);
+        if (log.isDebugEnabled()) {
+            log.debug("start writeBoolean(v) v=" + v);
+        }
         out.writeBoolean(v);
-        trace ("end writeBoolean(v)");
+        if (log.isDebugEnabled()) {
+            log.debug("end writeBoolean(v)");
+        }
     }
 
     public void writeByte(int v) throws IOException {
-        trace ("start writeByte(v) v=" + v);
+        if (log.isDebugEnabled()) {
+            log.debug("start writeByte(v) v=" + v);
+        }
         out.writeByte(v);
-        trace ("end writeByte(v)");
+        if (log.isDebugEnabled()) {
+            log.debug("end writeByte(v)");
+        }
     }
 
     public void writeBytes(String s) throws IOException {
-        trace ("start writeBytes(s) s=" + s);
+        log.debug("start writeBytes(s) s=" + s);
         out.writeBytes(s);
-        trace ("end writeBytes(s)");
+        log.debug("end writeBytes(s)");
     }
 
     public void writeChar(int v) throws IOException {
-        trace ("start writeChar(v) v=" + v);
+        log.debug("start writeChar(v) v=" + v);
         out.writeChar(v);
-        trace ("end writeChar(v)");
+        log.debug("end writeChar(v)");
     }
 
     public void writeChars(String s) throws IOException {
-        trace ("start writeChars(s) s=" + s);
+        if (log.isDebugEnabled()) {
+            log.debug("start writeChars(s) s=" + s);
+        }
         out.writeChars(s);
-        trace ("end writeChars(s)");
+        if (log.isDebugEnabled()) {
+            log.debug("end writeChars(s)");
+        }
     }
 
     public void writeDouble(double v) throws IOException {
-        trace ("start writeDouble(v) v=" + v);
+        if (log.isDebugEnabled()) {
+            log.debug("start writeDouble(v) v=" + v);
+        }
         out.writeDouble(v);
-        trace ("end writeDouble(v)");
+        if (log.isDebugEnabled()) {
+            log.debug("end writeDouble(v)");
+        }
     }
 
     public void writeFloat(float v) throws IOException {
-        trace ("start writeFloat(v) v=" + v);
-        out.writeFloat(v); 
-        trace ("end writeFloat(v)");
+        if (log.isDebugEnabled()) {
+            log.debug("start writeFloat(v) v=" + v);
+        }
+        out.writeFloat(v);
+        if (log.isDebugEnabled()) {
+            log.debug("end writeFloat(v)");
+        }
     }
 
     public void writeInt(int v) throws IOException {
-        trace ("start writeInt(v) v=" + v);
+        if (log.isDebugEnabled()) {
+            log.debug("start writeInt(v) v=" + v);
+        }
         out.writeInt(v);
-        trace ("end writeInt(v)");
+        if (log.isDebugEnabled()) {
+            log.debug("end writeInt(v)");
+        }
     }
 
     public void writeLong(long v) throws IOException {
-        trace ("start writeLong(v) v=" + v);
+        if (log.isDebugEnabled()) {
+            log.debug("start writeLong(v) v=" + v);
+        }
         out.writeLong(v);
-        trace ("end writeLong(v)");
+        if (log.isDebugEnabled()) {
+            log.debug("end writeLong(v)");
+        }
     }
 
     public void writeObject(Object obj) throws IOException {
-        trace ("start writeObject(v) v=" + valueName(obj));
+        if (log.isDebugEnabled()) {
+            log.debug("start writeObject(v) v=" + valueName(obj));
+        }
         out.writeObject(obj);
-        trace ("end writeObject(v)");
+        if (log.isDebugEnabled()) {
+            log.debug("end writeObject(v)");
+        }
     }
 
     public void writeShort(int v) throws IOException {
-        trace ("start writeShort(v) v=" + v);
+        if (log.isDebugEnabled()) {
+            log.debug("start writeShort(v) v=" + v);
+        }
         out.writeShort(v);
-        trace ("end writeShort(v)");
+        if (log.isDebugEnabled()) {
+            log.debug("end writeShort(v)");
+        }
     }
 
     public void writeUTF(String str) throws IOException {
-        trace ("start writeUTF(v) v=" + str);
+        if (log.isDebugEnabled()) {
+            log.debug("start writeUTF(v) v=" + str);
+        }
         out.writeUTF(str);
-        trace ("end writeUTF(v)");
-    }
-    
-    public void trace(String str) {
-        if (isDebug) {
-            log.debug(str);
+        if (log.isDebugEnabled()) {
+            log.debug("end writeUTF(v)");
         }
     }
-    
+
     private String valueName(Object obj) {
         if (obj == null) {
             return "null";

Modified: 
axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/builder/ActionAnnot.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/builder/ActionAnnot.java?rev=1051967&r1=1051966&r2=1051967&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/builder/ActionAnnot.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/builder/ActionAnnot.java
 Wed Dec 22 16:10:45 2010
@@ -22,6 +22,7 @@ package org.apache.axis2.jaxws.descripti
 import javax.xml.ws.Action;
 import javax.xml.ws.FaultAction;
 import java.lang.annotation.Annotation;
+import java.util.Arrays;
 
 public class ActionAnnot implements Action {
     
@@ -80,7 +81,7 @@ public class ActionAnnot implements Acti
         StringBuffer sb = new StringBuffer();
         String newLine = "\n";
         sb.append(newLine);
-        sb.append("@Action.fault= " + fault);
+        sb.append("@Action.fault= " + Arrays.toString(fault));
         sb.append(newLine);
         sb.append("@Action.input= " + input);
         sb.append(newLine);

Modified: 
axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/AttachmentDescriptionImpl.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/AttachmentDescriptionImpl.java?rev=1051967&r1=1051966&r2=1051967&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/AttachmentDescriptionImpl.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/AttachmentDescriptionImpl.java
 Wed Dec 22 16:10:45 2010
@@ -23,6 +23,8 @@ import org.apache.axis2.jaxws.descriptio
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
+import java.util.Arrays;
+
 public class AttachmentDescriptionImpl implements
         org.apache.axis2.jaxws.description.AttachmentDescription {
 
@@ -63,7 +65,7 @@ public class AttachmentDescriptionImpl i
         string.append("  Attachment Type: " + getAttachmentType());
         //
         string.append(newline);
-        string.append("  Mime Types: " + getMimeTypes());
+        string.append("  Mime Types: " + Arrays.toString(getMimeTypes()));
         return string.toString();
     }
 

Modified: 
axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java?rev=1051967&r1=1051966&r2=1051967&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/OperationDescriptionImpl.java
 Wed Dec 22 16:10:45 2010
@@ -81,6 +81,7 @@ import java.lang.reflect.Type;
 import java.net.URL;
 import java.security.PrivilegedAction;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -158,7 +159,7 @@ class OperationDescriptionImpl
     public static final String WebMethod_Action_DEFAULT = "";
     private String webMethodAction;
     // Default value per JSR-181 MR sec 4.2, pg 17
-    public static final Boolean WebMethod_Exclude_DEFAULT = new Boolean(false);
+    public static final Boolean WebMethod_Exclude_DEFAULT = Boolean.FALSE;
     private Boolean webMethodExclude;
 
     // ANNOTATION: @WebParam
@@ -175,7 +176,7 @@ class OperationDescriptionImpl
     public static final String WebResult_TargetNamespace_DEFAULT = "";
     private String webResultTargetNamespace;
     // Default value per JSR-181 MR sec 4.5, pg 24
-    public static final Boolean WebResult_Header_DEFAULT = new Boolean(false);
+    public static final Boolean WebResult_Header_DEFAULT = Boolean.FALSE;
     private Boolean webResultHeader;
     
     //  Web Result Attachment Description information
@@ -228,6 +229,7 @@ class OperationDescriptionImpl
         partAttachmentMap = new HashMap<String, AttachmentDescription>();
         axisOperation = operation;
         if(this.axisOperation != null) {
+            this.operationQName = axisOperation.getName();
             try {
                 this.axisOperation.addParameter(new 
Parameter(OperationDescription.AXIS_OPERATION_PARAMETER,
                                                          this));  
@@ -236,7 +238,6 @@ class OperationDescriptionImpl
                 throw 
ExceptionFactory.makeWebServiceException(Messages.getMessage("operationDescriptionErr1"));
             }
         }
-        this.operationQName = axisOperation.getName();
         buildAttachmentInformation();
     }
 
@@ -762,9 +763,6 @@ class OperationDescriptionImpl
             }
 
         } else {
-            ParameterDescriptionComposite pdc = null;
-            Iterator<ParameterDescriptionComposite> iter =
-                    
methodComposite.getParameterDescriptionCompositeList().iterator();
 
             for (int i = 0; i < 
methodComposite.getParameterDescriptionCompositeList().size(); i++)
             {
@@ -1005,7 +1003,7 @@ class OperationDescriptionImpl
             // Unlike the elements with a String value, if the annotation is 
present, exclude will always 
             // return a usable value since it will default to FALSE if the 
element is not present.
             if (getAnnoWebMethod() != null) {
-                webMethodExclude = new Boolean(getAnnoWebMethod().exclude());
+                webMethodExclude = 
Boolean.valueOf(getAnnoWebMethod().exclude());
             } else {
                 webMethodExclude = WebMethod_Exclude_DEFAULT;
             }
@@ -1529,7 +1527,7 @@ class OperationDescriptionImpl
             if (getAnnoWebResult() != null) {
                 // Unlike the elements with a String value, if the annotation 
is present, exclude will always 
                 // return a usable value since it will default to FALSE if the 
element is not present.
-                webResultHeader = new Boolean(getAnnoWebResult().header());
+                webResultHeader = Boolean.valueOf(getAnnoWebResult().header());
             } else {
                 webResultHeader = WebResult_Header_DEFAULT;
             }
@@ -1671,7 +1669,7 @@ class OperationDescriptionImpl
         }
         
         if (log.isDebugEnabled()) {
-            log.debug("getFaultActions: " + faultActions);
+            log.debug("getFaultActions: " + Arrays.toString(faultActions));
         }
         
         return faultActions;
@@ -1707,10 +1705,10 @@ class OperationDescriptionImpl
         if (onewayIsOneway == null) {
             if (getAnnoOneway() != null) {
                 // The presence of the annotation indicates the method is 
oneway
-                onewayIsOneway = new Boolean(true);
+                onewayIsOneway = Boolean.TRUE;
             } else {
                 // If the annotation is not present, the default is this is 
NOT a One Way method
-                onewayIsOneway = new Boolean(false);
+                onewayIsOneway = Boolean.FALSE;
             }
         }
         return onewayIsOneway.booleanValue();
@@ -2079,7 +2077,7 @@ class OperationDescriptionImpl
             return partAttachmentMap.get(partName);
         }
         if (log.isDebugEnabled()) {
-            log.debug("Did not find result AttachmentDescription for partName: 
" + partName);
+            log.debug("Did not find result AttachmentDescription for 
partName");
         }
         return null;
     }
@@ -2255,7 +2253,7 @@ class OperationDescriptionImpl
             string.append(newline);
             string.append("Java method name: " + getJavaMethodName());
             string.append(newline);
-            string.append("Java paramaters: " + getJavaParameters());
+            string.append("Java paramaters: " + 
Arrays.toString(getJavaParameters()));
             string.append(newline);
             string.append("Service Implementation method: " + 
getMethodFromServiceImpl());
             string.append(newline);

Modified: 
axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/URIResolverImpl.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/URIResolverImpl.java?rev=1051967&r1=1051966&r2=1051967&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/URIResolverImpl.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/URIResolverImpl.java
 Wed Dec 22 16:10:45 2010
@@ -286,7 +286,7 @@ public class URIResolverImpl implements 
     }
 
     private String constructPath(URL baseURL, URI resolvedURI) {
-        String importLocation = null;
+        String importLocation;
         URL url = null;
         try {
             // Allow for http or https

Modified: 
axis/axis2/java/core/trunk/modules/saaj/src/org/apache/axis2/saaj/SOAPHeaderImpl.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/saaj/src/org/apache/axis2/saaj/SOAPHeaderImpl.java?rev=1051967&r1=1051966&r2=1051967&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/saaj/src/org/apache/axis2/saaj/SOAPHeaderImpl.java
 (original)
+++ 
axis/axis2/java/core/trunk/modules/saaj/src/org/apache/axis2/saaj/SOAPHeaderImpl.java
 Wed Dec 22 16:10:45 2010
@@ -367,7 +367,7 @@ public class SOAPHeaderImpl extends SOAP
     }
 
     public SOAPHeaderElement addUpgradeHeaderElement(String s) throws 
SOAPException {
-        if (s == null && s.trim().length() > 0) {
+        if (s == null || s.trim().length() == 0) {
             return null;
         }
         ArrayList supportedEnvelops = new ArrayList();


Reply via email to