geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r580407 - in /geronimo/server/trunk/modules: geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/ geronimo-axis2/src/main/java/org/apache/geronimo/axis2/ geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deploy...
Date Fri, 28 Sep 2007 16:33:18 GMT
Author: gawor
Date: Fri Sep 28 09:33:14 2007
New Revision: 580407

URL: http://svn.apache.org/viewvc?rev=580407&view=rev
Log:
fix minor bugs discovered by FindBugs

Modified:
    geronimo/server/trunk/modules/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java
    geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/WebServiceRefAnnotationHelper.java
    geronimo/server/trunk/modules/geronimo-jaxws-ejb-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSEJBModuleBuilderExtension.java
    geronimo/server/trunk/modules/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/JAXWSUtils.java

Modified: geronimo/server/trunk/modules/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java?rev=580407&r1=580406&r2=580407&view=diff
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java
Fri Sep 28 09:33:14 2007
@@ -180,8 +180,10 @@
         } catch (Exception ex) {
             throw new DeploymentException("Unknown deployment error", ex);
         } finally {
-            try {
+            if (cursor != null) {
                 cursor.dispose();
+            }
+            try {
                 in.close();
             } catch (IOException e) {
                 // ignore

Modified: geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java?rev=580407&r1=580406&r2=580407&view=diff
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java
(original)
+++ geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java
Fri Sep 28 09:33:14 2007
@@ -239,7 +239,7 @@
         return edArray[0];
     }
 
-    private class WSDLGeneratorImpl implements WsdlGenerator {
+    private static class WSDLGeneratorImpl implements WsdlGenerator {
         private Definition def;
 
         public WSDLGeneratorImpl(Definition def) {

Modified: geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/WebServiceRefAnnotationHelper.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/WebServiceRefAnnotationHelper.java?rev=580407&r1=580406&r2=580407&view=diff
==============================================================================
--- geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/WebServiceRefAnnotationHelper.java
(original)
+++ geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/WebServiceRefAnnotationHelper.java
Fri Sep 28 09:33:14 2007
@@ -230,7 +230,7 @@
         //------------------------------------------------------------------------------------------
         Class webServiceRefType = annotation.type();
         Class webServiceRefValue = annotation.value();
-        if (webServiceRefType.equals("") || webServiceRefType.equals(Object.class)) {
+        if (webServiceRefType == null || webServiceRefType.equals(Object.class)) {
             if (method != null) {
                 webServiceRefType = method.getParameterTypes()[0];
             } else if (field != null) {

Modified: geronimo/server/trunk/modules/geronimo-jaxws-ejb-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSEJBModuleBuilderExtension.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jaxws-ejb-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSEJBModuleBuilderExtension.java?rev=580407&r1=580406&r2=580407&view=diff
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jaxws-ejb-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSEJBModuleBuilderExtension.java
(original)
+++ geronimo/server/trunk/modules/geronimo-jaxws-ejb-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSEJBModuleBuilderExtension.java
Fri Sep 28 09:33:14 2007
@@ -59,7 +59,6 @@
     protected Environment defaultEnvironment;
 
     public JAXWSEJBModuleBuilderExtension() throws Exception {
-        this(null, null, null, null, null);
     }
 
     public JAXWSEJBModuleBuilderExtension(WebServiceBuilder wsBuilder,

Modified: geronimo/server/trunk/modules/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/JAXWSUtils.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/JAXWSUtils.java?rev=580407&r1=580406&r2=580407&view=diff
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/JAXWSUtils.java
(original)
+++ geronimo/server/trunk/modules/geronimo-jaxws/src/main/java/org/apache/geronimo/jaxws/JAXWSUtils.java
Fri Sep 28 09:33:14 2007
@@ -231,12 +231,14 @@
         if (webService == null) {
             WebServiceProvider webServiceProvider = 
                 (WebServiceProvider)clazz.getAnnotation(WebServiceProvider.class);
-            if (webServiceProvider == null) //no WebService or WebServiceProvider annotation
+            if (webServiceProvider == null) { //no WebService or WebServiceProvider annotation
                 return "";
-            return webServiceProvider.wsdlLocation().trim();
-            
-        } else
+            } else {
+                return webServiceProvider.wsdlLocation().trim();
+            }
+        } else {
             return webService.wsdlLocation().trim();
+        }
     } 
     
     private static String getServiceInterface(Class clazz) {
@@ -245,37 +247,39 @@
             //WebServiceProvider doesn't support endpointInterface property (JAX-WS 2.0 sec
7.7)
             return "";  
         } else {
-            if (webService.endpointInterface() != null & !webService.endpointInterface().equals(""))

-                return webService.endpointInterface();
-            else 
+            if (webService.endpointInterface() == null || webService.endpointInterface().trim().equals(""))
{       
                 return "";
+            } else {
+                return webService.endpointInterface().trim();
+            }
         }
-
     }
+    
     public static String getServiceWsdlLocation(Class clazz, ClassLoader loader) {
-        if (getWsdlLocation(clazz) != null && !getWsdlLocation(clazz).equals(""))
{
-            return getWsdlLocation(clazz);
-        }
-        else { //check if the interface contains the wsdlLocation value
+        String wsdlLocation = getWsdlLocation(clazz);
+        if (wsdlLocation != null && !wsdlLocation.equals("")) {
+            return wsdlLocation;
+        } else { //check if the interface contains the wsdlLocation value
             String serviceInterfaceClassName = getServiceInterface(clazz);
             if (serviceInterfaceClassName != null && !serviceInterfaceClassName.equals(""))
{
                 try {
-                    Class serviceInterfaceClass = loader.loadClass(getServiceInterface(clazz));
+                    Class serviceInterfaceClass = loader.loadClass(serviceInterfaceClassName);
                     return getWsdlLocation(serviceInterfaceClass);                    
                 } catch (Exception e) {
                     return "";
                 }
             } 
         }
-        return "";
-        
+        return "";        
     }
     
     public static boolean containsWsdlLocation(Class clazz, ClassLoader loader) {
         String wsdlLocSEIFromAnnotation = getServiceWsdlLocation(clazz, loader);
-        if (wsdlLocSEIFromAnnotation != null && !wsdlLocSEIFromAnnotation.equals(""))
+        if (wsdlLocSEIFromAnnotation != null && !wsdlLocSEIFromAnnotation.equals(""))
{
             return true;
-        return false;
+        } else {
+            return false;
+        }
     }
     
     public static String getBindingURIFromAnnot(Class clazz, ClassLoader loader) {



Mime
View raw message