cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [13/30] cxf git commit: More FindBugs work
Date Sun, 04 Dec 2016 01:11:55 GMT
More FindBugs work


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

Branch: refs/heads/CXF-6882.nio
Commit: 01fdc40526185ee89202692088fd5367f0690af0
Parents: 75093fe
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Tue Nov 29 11:45:51 2016 +0000
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Tue Nov 29 11:45:51 2016 +0000

----------------------------------------------------------------------
 .../management/web/logging/ReadOnlyFileStorage.java    |  2 +-
 .../jmx/export/runtime/ModelMBeanAssembler.java        |  2 +-
 .../java/org/apache/cxf/wsdl/JAXBExtensionHelper.java  |  5 ++---
 .../cxf/wsdl/interceptors/WrappedOutInterceptor.java   |  2 +-
 .../service/factory/XercesSchemaValidationUtils.java   |  6 +++---
 .../org/apache/cxf/wsdl11/PartialWSDLProcessor.java    | 13 +++++++------
 .../org/apache/cxf/customer/book/BookServiceImpl.java  |  4 ++--
 .../cxf/customer/book/BookServiceWrappedImpl.java      |  1 -
 8 files changed, 17 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/01fdc405/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/ReadOnlyFileStorage.java
----------------------------------------------------------------------
diff --git a/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/ReadOnlyFileStorage.java
b/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/ReadOnlyFileStorage.java
index 2754cd3..79849e7 100644
--- a/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/ReadOnlyFileStorage.java
+++ b/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/ReadOnlyFileStorage.java
@@ -612,7 +612,7 @@ public class ReadOnlyFileStorage implements ReadableLogStorage {
         private int getLogIndex(String name) {
             int index = name.lastIndexOf('.');
             try {
-                return Integer.valueOf(name.substring(index + 1));
+                return Integer.parseInt(name.substring(index + 1));
             } catch (Exception ex) {
                 return 0;
             }    

http://git-wip-us.apache.org/repos/asf/cxf/blob/01fdc405/rt/management/src/main/java/org/apache/cxf/management/jmx/export/runtime/ModelMBeanAssembler.java
----------------------------------------------------------------------
diff --git a/rt/management/src/main/java/org/apache/cxf/management/jmx/export/runtime/ModelMBeanAssembler.java
b/rt/management/src/main/java/org/apache/cxf/management/jmx/export/runtime/ModelMBeanAssembler.java
index 884ee3f..480c40f 100644
--- a/rt/management/src/main/java/org/apache/cxf/management/jmx/export/runtime/ModelMBeanAssembler.java
+++ b/rt/management/src/main/java/org/apache/cxf/management/jmx/export/runtime/ModelMBeanAssembler.java
@@ -116,7 +116,7 @@ public class ModelMBeanAssembler {
         return result;
     }
     
-    class ManagedAttributeInfo {
+    static class ManagedAttributeInfo {
         String fname;
         String ftype;
         String description;

http://git-wip-us.apache.org/repos/asf/cxf/blob/01fdc405/rt/wsdl/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java
----------------------------------------------------------------------
diff --git a/rt/wsdl/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java b/rt/wsdl/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java
index 9b77c26..5548bbc 100644
--- a/rt/wsdl/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java
+++ b/rt/wsdl/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java
@@ -359,9 +359,8 @@ public class JAXBExtensionHelper implements ExtensionSerializer, ExtensionDeseri
                 reader = new MappingReaderDelegate(reader);
                 o = u.unmarshal(reader, extensionClass);
             }
-            if (o instanceof JAXBElement<?>) {
-                JAXBElement<?> el = (JAXBElement<?>)o;
-                o = el.getValue();
+            if (o != null) {
+                o = ((JAXBElement<?>)o).getValue();
             }
             
             ExtensibilityElement el = o instanceof ExtensibilityElement ? (ExtensibilityElement)o


http://git-wip-us.apache.org/repos/asf/cxf/blob/01fdc405/rt/wsdl/src/main/java/org/apache/cxf/wsdl/interceptors/WrappedOutInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/wsdl/src/main/java/org/apache/cxf/wsdl/interceptors/WrappedOutInterceptor.java
b/rt/wsdl/src/main/java/org/apache/cxf/wsdl/interceptors/WrappedOutInterceptor.java
index 73db9ed..b00ccfc 100644
--- a/rt/wsdl/src/main/java/org/apache/cxf/wsdl/interceptors/WrappedOutInterceptor.java
+++ b/rt/wsdl/src/main/java/org/apache/cxf/wsdl/interceptors/WrappedOutInterceptor.java
@@ -90,7 +90,7 @@ public class WrappedOutInterceptor extends AbstractOutDatabindingInterceptor
{
         }
     }
     
-    public class WrappedOutEndingInterceptor extends AbstractOutDatabindingInterceptor {
+    public static class WrappedOutEndingInterceptor extends AbstractOutDatabindingInterceptor
{
         public WrappedOutEndingInterceptor(String phase) {
             super(phase);
         }

http://git-wip-us.apache.org/repos/asf/cxf/blob/01fdc405/rt/wsdl/src/main/java/org/apache/cxf/wsdl/service/factory/XercesSchemaValidationUtils.java
----------------------------------------------------------------------
diff --git a/rt/wsdl/src/main/java/org/apache/cxf/wsdl/service/factory/XercesSchemaValidationUtils.java
b/rt/wsdl/src/main/java/org/apache/cxf/wsdl/service/factory/XercesSchemaValidationUtils.java
index 0456671..4b79611 100644
--- a/rt/wsdl/src/main/java/org/apache/cxf/wsdl/service/factory/XercesSchemaValidationUtils.java
+++ b/rt/wsdl/src/main/java/org/apache/cxf/wsdl/service/factory/XercesSchemaValidationUtils.java
@@ -50,7 +50,7 @@ import org.apache.ws.commons.schema.XmlSchemaSerializer;
 class XercesSchemaValidationUtils {
 
    
-    class DOMLSInput implements LSInput {
+    static class DOMLSInput implements LSInput {
         private String systemId;
         private String data;
         
@@ -144,8 +144,8 @@ class XercesSchemaValidationUtils {
 
     
     Method findMethod(Object o, String name) {
-        for (Method m: o.getClass().getMethods()) {
-            if (m.getName() == name) {
+        for (Method m : o.getClass().getMethods()) {
+            if (m.getName() != null && m.getName().equals(name)) {
                 m.setAccessible(true);
                 return m;
             }

http://git-wip-us.apache.org/repos/asf/cxf/blob/01fdc405/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/PartialWSDLProcessor.java
----------------------------------------------------------------------
diff --git a/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/PartialWSDLProcessor.java b/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/PartialWSDLProcessor.java
index 389dbcd..0b2432e 100644
--- a/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/PartialWSDLProcessor.java
+++ b/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/PartialWSDLProcessor.java
@@ -21,6 +21,7 @@ package org.apache.cxf.wsdl11;
 
 import java.util.List;
 import java.util.Map;
+import java.util.Map.Entry;
 
 import javax.wsdl.Binding;
 import javax.wsdl.BindingFault;
@@ -68,10 +69,10 @@ public final class PartialWSDLProcessor  {
         String existPortTypeName = null;
         PortType portType = null;
         try {
-            for (QName existPortTypeQName : portTypes.keySet()) {
-                existPortTypeName = existPortTypeQName.getLocalPart();
+            for (Entry<QName, PortType> entry : portTypes.entrySet()) {
+                existPortTypeName = entry.getKey().getLocalPart();
                 if (name.getLocalPart().contains(existPortTypeName)) {
-                    portType = portTypes.get(existPortTypeQName);
+                    portType = entry.getValue();
                     break;
                 }
             }  
@@ -88,9 +89,9 @@ public final class PartialWSDLProcessor  {
             return false;
         }
         try {
-            for (QName existBindingQName : bindings.keySet()) {
-                if (existBindingQName.getLocalPart().contains(name.getLocalPart())) {
-                    binding = bindings.get(existBindingQName);
+            for (Entry<QName, Binding> entry : bindings.entrySet()) {
+                if (entry.getKey().getLocalPart().contains(name.getLocalPart())) {
+                    binding = entry.getValue();
                     break;
                 }
             }

http://git-wip-us.apache.org/repos/asf/cxf/blob/01fdc405/testutils/src/main/java/org/apache/cxf/customer/book/BookServiceImpl.java
----------------------------------------------------------------------
diff --git a/testutils/src/main/java/org/apache/cxf/customer/book/BookServiceImpl.java b/testutils/src/main/java/org/apache/cxf/customer/book/BookServiceImpl.java
index d8fdd2f..6907409 100644
--- a/testutils/src/main/java/org/apache/cxf/customer/book/BookServiceImpl.java
+++ b/testutils/src/main/java/org/apache/cxf/customer/book/BookServiceImpl.java
@@ -51,7 +51,7 @@ public class BookServiceImpl implements BookService {
                                + me.getValue().getName() + ", " + me.getValue().getId());
         }
         System.out.println("Book de id " + getBook.getId());
-        Book b = books.get(((Long)getBook.getId()).longValue());
+        Book b = books.get(getBook.getId());
 
         if (b == null) {
             BookNotFoundDetails details = new BookNotFoundDetails();
@@ -67,7 +67,7 @@ public class BookServiceImpl implements BookService {
                                + me.getValue().getName() + ", " + me.getValue().getId());
         }
         System.out.println("Book de id " + getAnotherBook.getId());
-        Book b = books.get(((Long)getAnotherBook.getId()).longValue());
+        Book b = books.get(getAnotherBook.getId());
 
         if (b == null) {
             BookNotFoundDetails details = new BookNotFoundDetails();

http://git-wip-us.apache.org/repos/asf/cxf/blob/01fdc405/testutils/src/main/java/org/apache/cxf/customer/book/BookServiceWrappedImpl.java
----------------------------------------------------------------------
diff --git a/testutils/src/main/java/org/apache/cxf/customer/book/BookServiceWrappedImpl.java
b/testutils/src/main/java/org/apache/cxf/customer/book/BookServiceWrappedImpl.java
index 5295da2..bf38d54 100644
--- a/testutils/src/main/java/org/apache/cxf/customer/book/BookServiceWrappedImpl.java
+++ b/testutils/src/main/java/org/apache/cxf/customer/book/BookServiceWrappedImpl.java
@@ -27,7 +27,6 @@ import javax.jws.WebService;
 
 @WebService(endpointInterface = "org.apache.cxf.customer.book.BookService")
 public class BookServiceWrappedImpl implements BookServiceWrapped {
-    long currentId = 1;
     Map<Long, Book> books = new HashMap<Long, Book>();
     
     public BookServiceWrappedImpl() {


Mime
View raw message