cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [2/2] cxf git commit: Fix a bunch of warnings in core that the eclipse compiler can catch
Date Thu, 03 Aug 2017 17:38:55 GMT
Fix a bunch of warnings in core that the eclipse compiler can catch


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

Branch: refs/heads/master
Commit: c26e8b9903cfd90ecc99580d23322fd2dfe5be17
Parents: d28828e
Author: Daniel Kulp <dkulp@apache.org>
Authored: Thu Aug 3 13:38:02 2017 -0400
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Thu Aug 3 13:38:38 2017 -0400

----------------------------------------------------------------------
 .../main/java/org/apache/cxf/BusFactory.java    |  3 +-
 .../attachment/LazyAttachmentCollection.java    |  8 +--
 .../apache/cxf/attachment/LazyDataSource.java   |  5 +-
 .../cxf/attachment/MimeBodyPartInputStream.java | 38 +++++------
 .../blueprint/BundleDelegatingClassLoader.java  |  6 +-
 .../org/apache/cxf/bus/extension/Extension.java | 12 ++--
 .../cxf/bus/extension/ExtensionManagerBus.java  |  5 +-
 .../bus/managers/BindingFactoryManagerImpl.java |  2 +-
 .../bus/osgi/CXFExtensionBundleListener.java    |  3 +-
 .../cxf/bus/osgi/ManagedWorkQueueList.java      |  2 +-
 .../apache/cxf/bus/osgi/OSGIBusListener.java    |  2 +-
 .../apache/cxf/bus/osgi/OSGiBeanLocator.java    |  3 +-
 .../cxf/bus/spring/BusEntityResolver.java       |  5 +-
 .../BusWiringBeanFactoryPostProcessor.java      |  2 +-
 .../apache/cxf/bus/spring/SpringBusFactory.java |  3 +-
 .../cxf/bus/spring/TunedDocumentLoader.java     |  5 +-
 .../cxf/common/jaxb/JAXBContextCache.java       |  8 +--
 .../org/apache/cxf/common/jaxb/JAXBUtils.java   |  7 +--
 .../apache/cxf/common/logging/JDKBugHacks.java  |  3 +-
 .../org/apache/cxf/common/logging/LogUtils.java | 19 +++---
 .../org/apache/cxf/common/util/ASMHelper.java   |  3 +-
 .../cxf/common/util/Base64UrlUtility.java       |  3 +-
 .../cxf/common/util/CglibProxyHelper.java       |  5 +-
 .../org/apache/cxf/common/util/ClassHelper.java |  3 +-
 .../cxf/common/util/ClasspathScanner.java       | 14 ++++-
 .../cxf/common/util/CompressionUtils.java       |  3 +-
 .../common/util/ExtensionInvocationHandler.java |  9 ++-
 .../apache/cxf/common/util/PackageUtils.java    |  3 +-
 .../apache/cxf/common/util/PropertyUtils.java   |  6 +-
 .../util/ReflectionInvokationHandler.java       |  2 +-
 .../apache/cxf/common/util/ReflectionUtil.java  | 11 ++--
 .../cxf/common/util/SpringClasspathScanner.java |  3 +-
 .../apache/cxf/common/util/URIParserUtil.java   |  3 +-
 .../org/apache/cxf/common/util/UrlUtils.java    |  7 +--
 .../cxf/common/xmlschema/XmlSchemaUtils.java    | 15 ++---
 .../apache/cxf/configuration/jsse/SSLUtils.java |  6 +-
 .../configuration/jsse/TLSClientParameters.java | 16 +++--
 .../cxf/databinding/AbstractWrapperHelper.java  |  2 +-
 .../cxf/databinding/source/NodeDataReader.java  |  1 -
 .../databinding/source/SourceDataBinding.java   |  7 +--
 .../databinding/source/XMLStreamDataReader.java | 13 ++--
 .../cxf/databinding/stax/StaxDataBinding.java   | 10 ++-
 .../cxf/endpoint/AbstractConduitSelector.java   |  9 +--
 .../org/apache/cxf/endpoint/ClientImpl.java     | 47 +++++++-------
 .../org/apache/cxf/helpers/ServiceUtils.java    |  8 +--
 .../cxf/interceptor/ClientFaultConverter.java   | 17 +++--
 .../cxf/interceptor/FIStaxInInterceptor.java    |  3 +-
 .../cxf/interceptor/FaultOutInterceptor.java    |  4 +-
 .../interceptor/ServiceInvokerInterceptor.java  |  3 +-
 .../cxf/interceptor/StaxInInterceptor.java      |  2 +-
 .../AbstractSecurityContextInInterceptor.java   |  3 +-
 .../security/JAASLoginInterceptor.java          |  6 +-
 .../NameDigestPasswordCallbackHandler.java      |  2 +-
 .../security/NamePasswordCallbackHandler.java   |  2 +-
 .../security/RolePrefixSecurityContextImpl.java |  3 +-
 .../security/SecureAnnotationsInterceptor.java  |  4 +-
 .../security/SimpleAuthorizingInterceptor.java  |  3 +-
 .../CallbackHandlerProviderUsernameToken.java   |  3 +-
 .../org/apache/cxf/io/CachedOutputStream.java   | 47 +++++++-------
 .../java/org/apache/cxf/io/CachedWriter.java    | 66 +++++++++-----------
 .../org/apache/cxf/message/MessageUtils.java    |  3 +-
 .../apache/cxf/phase/PhaseInterceptorChain.java |  7 +--
 .../cxf/resource/ExtendedURIResolver.java       |  3 +-
 .../apache/cxf/resource/SecurityActions.java    | 13 ++--
 .../factory/AnnotationsFactoryBeanListener.java |  2 +-
 .../cxf/service/invoker/AbstractInvoker.java    | 11 ++--
 .../apache/cxf/service/model/BindingInfo.java   |  9 ++-
 .../staxutils/DepthRestrictingStreamReader.java |  3 +-
 .../org/apache/cxf/staxutils/StaxSource.java    |  3 +-
 .../cxf/staxutils/W3CDOMStreamReader.java       |  3 +-
 .../cxf/staxutils/W3CNamespaceContext.java      |  3 +-
 .../staxutils/transform/InTransformReader.java  | 31 ++++-----
 .../ResolvingGrammarReaderController.java       |  3 +-
 .../apache/cxf/transport/TransportFinder.java   |  2 +-
 .../common/annotation/AnnotatedGreeterImpl.java |  5 +-
 .../apache/cxf/resource/URIResolverTest.java    | 17 ++---
 76 files changed, 273 insertions(+), 363 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/BusFactory.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/BusFactory.java b/core/src/main/java/org/apache/cxf/BusFactory.java
index 37113b2..a745ea4 100644
--- a/core/src/main/java/org/apache/cxf/BusFactory.java
+++ b/core/src/main/java/org/apache/cxf/BusFactory.java
@@ -109,9 +109,8 @@ public abstract class BusFactory {
         if (defaultBus == null) {
             // never set up.
             return null;
-        } else {
-            return defaultBus;
         }
+        return defaultBus;
     }
 
     private static BusHolder getThreadBusHolder(boolean set) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/attachment/LazyAttachmentCollection.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/attachment/LazyAttachmentCollection.java b/core/src/main/java/org/apache/cxf/attachment/LazyAttachmentCollection.java
index b9d6ad6..c44ea21 100644
--- a/core/src/main/java/org/apache/cxf/attachment/LazyAttachmentCollection.java
+++ b/core/src/main/java/org/apache/cxf/attachment/LazyAttachmentCollection.java
@@ -95,10 +95,9 @@ public class LazyAttachmentCollection
                     Attachment a = deserializer.readNext();
                     if (a == null) {
                         return false;
-                    } else {
-                        attachments.add(a);
-                        return true;
                     }
+                    attachments.add(a);
+                    return true;
                 } catch (IOException e) {
                     throw new RuntimeException(e);
                 }
@@ -280,9 +279,8 @@ public class LazyAttachmentCollection
                                         DataHandler h = at.getDataHandler();
                                         ((AttachmentImpl)at).setDataHandler(value);
                                         return h;
-                                    } else {
-                                        throw new UnsupportedOperationException();
                                     }
+                                    throw new UnsupportedOperationException();
                                 }
                             };
                         }

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/attachment/LazyDataSource.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/attachment/LazyDataSource.java b/core/src/main/java/org/apache/cxf/attachment/LazyDataSource.java
index 3b1c32d..dc40dd2 100644
--- a/core/src/main/java/org/apache/cxf/attachment/LazyDataSource.java
+++ b/core/src/main/java/org/apache/cxf/attachment/LazyDataSource.java
@@ -65,10 +65,9 @@ public class LazyDataSource implements DataSource {
                     if (dataSource != null) {
                         ids = null;
                         break;
-                    } else {
-                        throw new IllegalStateException("Could not get DataSource for "
-                                                        + "attachment of id " + id);
                     }
+                    throw new IllegalStateException("Could not get DataSource for "
+                                                    + "attachment of id " + id);
                 }
             }
             if (ids != null) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/attachment/MimeBodyPartInputStream.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/attachment/MimeBodyPartInputStream.java b/core/src/main/java/org/apache/cxf/attachment/MimeBodyPartInputStream.java
index 2d9c7da..e6cf9ce 100644
--- a/core/src/main/java/org/apache/cxf/attachment/MimeBodyPartInputStream.java
+++ b/core/src/main/java/org/apache/cxf/attachment/MimeBodyPartInputStream.java
@@ -134,19 +134,17 @@ public class MimeBodyPartInputStream extends InputStream {
                 value = buffer[initialI + 1];
                 if (value != 10) {
                     continue;
-                } else {  //if it comes here then 13, 10 are values and will try to match boundaries
-                    if (!hasData(buffer, initialI, initialI + 2, off, len)) {
-                        return initialI - off;
-                    }
-                    value = buffer[initialI + 2];
-                    if ((byte) value != boundary[0]) {
-                        i++;
-                        continue;
-                    } else { //13, 10, boundaries first value matched
-                        needUnread0d0a = true;
-                        i += 2; //i after this points to boundary[0] element
-                    }
                 }
+                if (!hasData(buffer, initialI, initialI + 2, off, len)) {
+                    return initialI - off;
+                }
+                value = buffer[initialI + 2];
+                if ((byte) value != boundary[0]) {
+                    i++;
+                    continue;
+                }
+                needUnread0d0a = true;
+                i += 2; //i after this points to boundary[0] element
             } else if (value != boundary[0]) {
                 continue;
             }
@@ -221,16 +219,14 @@ public class MimeBodyPartInputStream extends InputStream {
             if (value != 10) {
                 inStream.unread(value);
                 return 13;
-            } else {
-                value = inStream.read();
-                if ((byte) value != boundary[0]) {
-                    inStream.unread(value);
-                    inStream.unread(10);
-                    return 13;
-                } else {
-                    needUnread0d0a = true;
-                }
             }
+            value = inStream.read();
+            if ((byte) value != boundary[0]) {
+                inStream.unread(value);
+                inStream.unread(10);
+                return 13;
+            }
+            needUnread0d0a = true;
         } else if ((byte) value != boundary[0]) {
             return value;
         }

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/bus/blueprint/BundleDelegatingClassLoader.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/bus/blueprint/BundleDelegatingClassLoader.java b/core/src/main/java/org/apache/cxf/bus/blueprint/BundleDelegatingClassLoader.java
index 5cf9979..7743a59 100644
--- a/core/src/main/java/org/apache/cxf/bus/blueprint/BundleDelegatingClassLoader.java
+++ b/core/src/main/java/org/apache/cxf/bus/blueprint/BundleDelegatingClassLoader.java
@@ -59,9 +59,8 @@ public class BundleDelegatingClassLoader extends ClassLoader {
 
             if (cause instanceof ClassNotFoundException) {
                 throw (ClassNotFoundException)cause;
-            } else {
-                throw (RuntimeException)cause;
             }
+            throw (RuntimeException)cause;
         }
     }
 
@@ -91,9 +90,8 @@ public class BundleDelegatingClassLoader extends ClassLoader {
 
             if (cause instanceof IOException) {
                 throw (IOException)cause;
-            } else {
-                throw (RuntimeException)cause;
             }
+            throw (RuntimeException)cause;
         }
 
         if (urls == null) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/bus/extension/Extension.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/bus/extension/Extension.java b/core/src/main/java/org/apache/cxf/bus/extension/Extension.java
index 644a878..ca30aa8 100644
--- a/core/src/main/java/org/apache/cxf/bus/extension/Extension.java
+++ b/core/src/main/java/org/apache/cxf/bus/extension/Extension.java
@@ -251,17 +251,15 @@ public class Extension {
             notFound = true;
             if (!optional) {
                 throw ex;
-            } else {
-                LOG.log(Level.FINE, "Could not load optional extension " + getName(), (Throwable)ex);
             }
+            LOG.log(Level.FINE, "Could not load optional extension " + getName(), ex);
         } catch (InvocationTargetException ex) {
             notFound = true;
             if (!optional) {
                 throw new ExtensionException(new Message("PROBLEM_CREATING_EXTENSION_CLASS", LOG, cls.getName()),
                                              ex.getCause());
-            } else {
-                LOG.log(Level.FINE, "Could not load optional extension " + getName(), (Throwable)ex);
             }
+            LOG.log(Level.FINE, "Could not load optional extension " + getName(), ex);
         } catch (NoSuchMethodException ex) {
             notFound = true;
             List<Object> a = new ArrayList<>();
@@ -274,16 +272,14 @@ public class Extension {
             if (!optional) {
                 throw new ExtensionException(new Message("PROBLEM_FINDING_CONSTRUCTOR", LOG,
                                                          cls.getName(), a), ex);
-            } else {
-                LOG.log(Level.FINE, "Could not load optional extension " + getName(), (Throwable)ex);
             }
+            LOG.log(Level.FINE, "Could not load optional extension " + getName(), ex);
         } catch (Throwable e) {
             notFound = true;
             if (!optional) {
                 throw new ExtensionException(new Message("PROBLEM_CREATING_EXTENSION_CLASS", LOG, cls.getName()), e);
-            } else {
-                LOG.log(Level.FINE, "Could not load optional extension " + getName(), (Throwable)e);
             }
+            LOG.log(Level.FINE, "Could not load optional extension " + getName(), e);
         }
         return obj;
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerBus.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerBus.java b/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerBus.java
index e240998..e86867f 100644
--- a/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerBus.java
+++ b/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerBus.java
@@ -198,10 +198,9 @@ public class ExtensionManagerBus extends AbstractBasicInterceptorProvider implem
         }
         if (null != obj) {
             return extensionType.cast(obj);
-        } else {
-            //record that it couldn't be found to avoid expensive searches again in the future
-            missingExtensions.add(extensionType);
         }
+        //record that it couldn't be found to avoid expensive searches again in the future
+        missingExtensions.add(extensionType);
         return null;
     }
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/bus/managers/BindingFactoryManagerImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/bus/managers/BindingFactoryManagerImpl.java b/core/src/main/java/org/apache/cxf/bus/managers/BindingFactoryManagerImpl.java
index d05398d..08249a7 100644
--- a/core/src/main/java/org/apache/cxf/bus/managers/BindingFactoryManagerImpl.java
+++ b/core/src/main/java/org/apache/cxf/bus/managers/BindingFactoryManagerImpl.java
@@ -112,7 +112,7 @@ public final class BindingFactoryManagerImpl implements BindingFactoryManager {
                             }
                         } else {
                             try {
-                                Method m = bean.getClass().getMethod("getActivationNamespace", new Class[0]);
+                                Method m = bean.getClass().getMethod("getActivationNamespace");
                                 Collection<String> c = CastUtils.cast((Collection<?>)m.invoke(bean));
                                 for (String s : c) {
                                     registerBindingFactory(s, bean);

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/bus/osgi/CXFExtensionBundleListener.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/bus/osgi/CXFExtensionBundleListener.java b/core/src/main/java/org/apache/cxf/bus/osgi/CXFExtensionBundleListener.java
index d065c82..3f3fb95 100644
--- a/core/src/main/java/org/apache/cxf/bus/osgi/CXFExtensionBundleListener.java
+++ b/core/src/main/java/org/apache/cxf/bus/osgi/CXFExtensionBundleListener.java
@@ -160,9 +160,8 @@ public class CXFExtensionBundleListener implements SynchronousBundleListener {
                         throw new ExtensionException(new Message("PROBLEM_LOADING_EXTENSION_CLASS",
                                                                  Extension.LOG, name),
                                                      origExc);
-                    } else {
-                        throw ee;
                     }
+                    throw ee;
                 }
             }
             return c;

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/bus/osgi/ManagedWorkQueueList.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/bus/osgi/ManagedWorkQueueList.java b/core/src/main/java/org/apache/cxf/bus/osgi/ManagedWorkQueueList.java
index ba1469d..6b5a959 100644
--- a/core/src/main/java/org/apache/cxf/bus/osgi/ManagedWorkQueueList.java
+++ b/core/src/main/java/org/apache/cxf/bus/osgi/ManagedWorkQueueList.java
@@ -79,7 +79,7 @@ public class ManagedWorkQueueList implements ManagedServiceFactory, PropertyChan
     public void propertyChange(PropertyChangeEvent evt) {
         try {
             AutomaticWorkQueueImpl queue = (AutomaticWorkQueueImpl)evt.getSource();
-            ConfigurationAdmin configurationAdmin = (ConfigurationAdmin)configAdminTracker.getService();
+            ConfigurationAdmin configurationAdmin = configAdminTracker.getService();
             if (configurationAdmin != null) {
                 Configuration selectedConfig = findConfigForQueueName(queue, configurationAdmin);
                 if (selectedConfig != null) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/bus/osgi/OSGIBusListener.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/bus/osgi/OSGIBusListener.java b/core/src/main/java/org/apache/cxf/bus/osgi/OSGIBusListener.java
index 2891334..41e1e9b 100644
--- a/core/src/main/java/org/apache/cxf/bus/osgi/OSGIBusListener.java
+++ b/core/src/main/java/org/apache/cxf/bus/osgi/OSGIBusListener.java
@@ -121,7 +121,7 @@ public class OSGIBusListener implements BusLifeCycleListener {
             // ignore
         }
         if (refs == null) {
-            refs = new ServiceReference[]{};
+            refs = new ServiceReference<?>[]{};
         }
         return refs;
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/bus/osgi/OSGiBeanLocator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/bus/osgi/OSGiBeanLocator.java b/core/src/main/java/org/apache/cxf/bus/osgi/OSGiBeanLocator.java
index d1c40ea..5c279f8 100644
--- a/core/src/main/java/org/apache/cxf/bus/osgi/OSGiBeanLocator.java
+++ b/core/src/main/java/org/apache/cxf/bus/osgi/OSGiBeanLocator.java
@@ -53,9 +53,8 @@ public class OSGiBeanLocator implements ConfiguredBeanLocator {
         Collection<? extends T> ret = cbl.getBeansOfType(type);
         if (ret == null || ret.isEmpty()) {
             return getBeansFromOsgiService(type);
-        } else {
-            return ret;
         }
+        return ret;
     }
 
     private <T> List<T> getBeansFromOsgiService(Class<T> type) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/bus/spring/BusEntityResolver.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/bus/spring/BusEntityResolver.java b/core/src/main/java/org/apache/cxf/bus/spring/BusEntityResolver.java
index d3d747e..ce7e83c 100644
--- a/core/src/main/java/org/apache/cxf/bus/spring/BusEntityResolver.java
+++ b/core/src/main/java/org/apache/cxf/bus/spring/BusEntityResolver.java
@@ -75,11 +75,14 @@ public class BusEntityResolver extends DelegatingEntityResolver  {
             if (null == source) {
                 source = dtdResolver.resolveEntity(publicId, systemId);
             }
+            if (null == source) {
+                return null;
+            }
         }
         String resourceLocation = schemaMappings.get(systemId);
         if (resourceLocation != null && publicId == null) {
             Resource resource = new ClassPathResource(resourceLocation, classLoader);
-            if (resource != null && resource.exists()) {
+            if (resource.exists()) {
                 source.setPublicId(systemId);
                 source.setSystemId(resource.getURL().toString());
             }

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/bus/spring/BusWiringBeanFactoryPostProcessor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/bus/spring/BusWiringBeanFactoryPostProcessor.java b/core/src/main/java/org/apache/cxf/bus/spring/BusWiringBeanFactoryPostProcessor.java
index aab8ed4..a0ff4cc 100644
--- a/core/src/main/java/org/apache/cxf/bus/spring/BusWiringBeanFactoryPostProcessor.java
+++ b/core/src/main/java/org/apache/cxf/bus/spring/BusWiringBeanFactoryPostProcessor.java
@@ -71,7 +71,7 @@ public class BusWiringBeanFactoryPostProcessor implements BeanFactoryPostProcess
             cctx.getBeanFactory().registerSingleton(name, b);
             b.setApplicationContext(context);
         }
-        return (Bus)context.getBean(name, Bus.class);
+        return context.getBean(name, Bus.class);
     }
     private Object getBusForName(String name,
                                  ConfigurableListableBeanFactory factory,

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/bus/spring/SpringBusFactory.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/bus/spring/SpringBusFactory.java b/core/src/main/java/org/apache/cxf/bus/spring/SpringBusFactory.java
index e1a5c71..1144ac7 100644
--- a/core/src/main/java/org/apache/cxf/bus/spring/SpringBusFactory.java
+++ b/core/src/main/java/org/apache/cxf/bus/spring/SpringBusFactory.java
@@ -166,9 +166,8 @@ public class SpringBusFactory extends BusFactory {
                 } finally {
                     Thread.currentThread().setContextClassLoader(contextLoader);
                 }
-            } else {
-                throw ex;
             }
+            throw ex;
         }
     }
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/bus/spring/TunedDocumentLoader.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/bus/spring/TunedDocumentLoader.java b/core/src/main/java/org/apache/cxf/bus/spring/TunedDocumentLoader.java
index bb8189b..47dcd72 100644
--- a/core/src/main/java/org/apache/cxf/bus/spring/TunedDocumentLoader.java
+++ b/core/src/main/java/org/apache/cxf/bus/spring/TunedDocumentLoader.java
@@ -112,10 +112,9 @@ class TunedDocumentLoader extends DefaultDocumentLoader {
             W3CDOMStreamWriter writer = new W3CDOMStreamWriter();
             StaxUtils.copy(saxSource, writer);
             return writer.getDocument();
-        } else {
-            return super.loadDocument(inputSource, entityResolver, errorHandler, validationMode,
-                                      namespaceAware);
         }
+        return super.loadDocument(inputSource, entityResolver, errorHandler, validationMode,
+                                  namespaceAware);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/common/jaxb/JAXBContextCache.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/common/jaxb/JAXBContextCache.java b/core/src/main/java/org/apache/cxf/common/jaxb/JAXBContextCache.java
index d116af6..abc403a 100644
--- a/core/src/main/java/org/apache/cxf/common/jaxb/JAXBContextCache.java
+++ b/core/src/main/java/org/apache/cxf/common/jaxb/JAXBContextCache.java
@@ -252,7 +252,7 @@ public final class JAXBContextCache {
                     context = AccessController.doPrivileged(new PrivilegedExceptionAction<JAXBContext>() {
                         public JAXBContext run() throws Exception {
                             return JAXBContext.newInstance(classes
-                                                          .toArray(new Class[classes.size()]), null);
+                                                          .toArray(new Class<?>[classes.size()]), null);
                         }
                     });
                 } catch (PrivilegedActionException e) {
@@ -319,7 +319,7 @@ public final class JAXBContextCache {
                         && m.getParameterTypes().length == 9) {
                         try {
                             return (JAXBContext)m.invoke(null,
-                                     classes.toArray(new Class[classes.size()]),
+                                     classes.toArray(new Class<?>[classes.size()]),
                                      typeRefs,
                                      map.get(pfx + "subclassReplacements"),
                                      map.get(pfx + "defaultNamespaceRemap"),
@@ -344,7 +344,7 @@ public final class JAXBContextCache {
         try {
             ctx = AccessController.doPrivileged(new PrivilegedExceptionAction<JAXBContext>() {
                 public JAXBContext run() throws Exception {
-                    return JAXBContext.newInstance(classes.toArray(new Class[classes.size()]), map);
+                    return JAXBContext.newInstance(classes.toArray(new Class<?>[classes.size()]), map);
                 }
             });
         } catch (PrivilegedActionException e2) {
@@ -355,7 +355,7 @@ public final class JAXBContextCache {
                     && ex.getMessage().contains("com.sun.xml.bind.defaultNamespaceRemap")) {
                     map.put("com.sun.xml.internal.bind.defaultNamespaceRemap",
                             map.remove("com.sun.xml.bind.defaultNamespaceRemap"));
-                    ctx = JAXBContext.newInstance(classes.toArray(new Class[classes.size()]), map);
+                    ctx = JAXBContext.newInstance(classes.toArray(new Class<?>[classes.size()]), map);
                 } else {
                     throw ex;
                 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/common/jaxb/JAXBUtils.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/common/jaxb/JAXBUtils.java b/core/src/main/java/org/apache/cxf/common/jaxb/JAXBUtils.java
index 74b2fe2..a8ab707 100644
--- a/core/src/main/java/org/apache/cxf/common/jaxb/JAXBUtils.java
+++ b/core/src/main/java/org/apache/cxf/common/jaxb/JAXBUtils.java
@@ -482,10 +482,9 @@ public final class JAXBUtils {
             index++;
             if (i >= sword.length()) {
                 break;
-            } else {
-                first = i;
-                firstChar = sword.charAt(first);
             }
+            first = i;
+            firstChar = sword.charAt(first);
         }
 
         if (index > (listIndex + 1)) {
@@ -676,7 +675,7 @@ public final class JAXBUtils {
             for (Method m : cls.getDeclaredMethods()) {
                 if (m.getName().equals("newInstance")
                     && m.getParameterTypes().length == 6) {
-                    ctx = m.invoke(null, clses.toArray(new Class[clses.size()]),
+                    ctx = m.invoke(null, clses.toArray(new Class<?>[clses.size()]),
                                          typeRefs, null, null, true, null);
 
                 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/common/logging/JDKBugHacks.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/common/logging/JDKBugHacks.java b/core/src/main/java/org/apache/cxf/common/logging/JDKBugHacks.java
index 3e579ab..a1a5c82 100644
--- a/core/src/main/java/org/apache/cxf/common/logging/JDKBugHacks.java
+++ b/core/src/main/java/org/apache/cxf/common/logging/JDKBugHacks.java
@@ -128,8 +128,7 @@ final class JDKBugHacks {
                         Long l = (Long)method.invoke(null);
                         if (l != null && l.longValue() == 0) {
                             //something already set it, move on
-                            method = clazz.getDeclaredMethod("requestLatency",
-                                new Class[] {Long.TYPE});
+                            method = clazz.getDeclaredMethod("requestLatency", Long.TYPE);
                             method.invoke(null, Long.valueOf(36000000));
                         }
                     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/common/logging/LogUtils.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/common/logging/LogUtils.java b/core/src/main/java/org/apache/cxf/common/logging/LogUtils.java
index 2c59d4f..0efd830 100644
--- a/core/src/main/java/org/apache/cxf/common/logging/LogUtils.java
+++ b/core/src/main/java/org/apache/cxf/common/logging/LogUtils.java
@@ -268,20 +268,17 @@ public final class LogUtils {
                         } catch (InvocationTargetException ite) {
                             if (ite.getTargetException() instanceof MissingResourceException) {
                                 return (Logger) cns.newInstance(loggerName, null);
-                            } else {
-                                throw ite;
                             }
+                            throw ite;
                         }
-                    } else {
-                        try {
-                            return (Logger) cns.newInstance(loggerName, bundleName);
-                        } catch (InvocationTargetException ite) {
-                            if (ite.getTargetException() instanceof MissingResourceException) {
-                                throw (MissingResourceException)ite.getTargetException();
-                            } else {
-                                throw ite;
-                            }
+                    }
+                    try {
+                        return (Logger) cns.newInstance(loggerName, bundleName);
+                    } catch (InvocationTargetException ite) {
+                        if (ite.getTargetException() instanceof MissingResourceException) {
+                            throw (MissingResourceException)ite.getTargetException();
                         }
+                        throw ite;
                     }
                 } catch (Exception e) {
                     throw new RuntimeException(e);

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/common/util/ASMHelper.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/common/util/ASMHelper.java b/core/src/main/java/org/apache/cxf/common/util/ASMHelper.java
index 8c90732..475150f 100644
--- a/core/src/main/java/org/apache/cxf/common/util/ASMHelper.java
+++ b/core/src/main/java/org/apache/cxf/common/util/ASMHelper.java
@@ -229,9 +229,8 @@ public class ASMHelper {
             java.lang.reflect.Type[] bounds = tv.getBounds();
             if (bounds != null && bounds.length == 1) {
                 return getClassCode(bounds[0]);
-            } else {
-                throw new IllegalArgumentException("Unable to determine type for: " + tv);
             }
+            throw new IllegalArgumentException("Unable to determine type for: " + tv);
         } else if (type instanceof ParameterizedType) {
             ParameterizedType pt = (ParameterizedType)type;
             StringBuilder a = new StringBuilder(getClassCode(pt.getRawType()));

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/common/util/Base64UrlUtility.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/common/util/Base64UrlUtility.java b/core/src/main/java/org/apache/cxf/common/util/Base64UrlUtility.java
index 3436208..4d4e400 100644
--- a/core/src/main/java/org/apache/cxf/common/util/Base64UrlUtility.java
+++ b/core/src/main/java/org/apache/cxf/common/util/Base64UrlUtility.java
@@ -53,9 +53,8 @@ public final class Base64UrlUtility {
         char[] chunk = Base64Utility.encodeChunk(id, offset, length, true);
         if (chunk != null) {
             return new String(chunk);
-        } else {
-            return null;
         }
+        return null;
     }
 
     public static void encodeAndStream(byte[] id,

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/common/util/CglibProxyHelper.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/common/util/CglibProxyHelper.java b/core/src/main/java/org/apache/cxf/common/util/CglibProxyHelper.java
index a3fa1ea..fa12576 100644
--- a/core/src/main/java/org/apache/cxf/common/util/CglibProxyHelper.java
+++ b/core/src/main/java/org/apache/cxf/common/util/CglibProxyHelper.java
@@ -59,7 +59,7 @@ class CglibProxyHelper extends ProxyHelper {
             Enhancer enhancer = new Enhancer();
             enhancer.setClassLoader(loader);
             enhancer.setSuperclass(superClass);
-            enhancer.setInterfaces(theInterfaces.toArray(new Class[theInterfaces.size()]));
+            enhancer.setInterfaces(theInterfaces.toArray(new Class<?>[theInterfaces.size()]));
             enhancer.setCallback(new MethodInterceptor() {
 
                 public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy)
@@ -69,9 +69,8 @@ class CglibProxyHelper extends ProxyHelper {
 
             });
             return enhancer.create();
-        } else {
-            return super.getProxyInternal(loader, interfaces, h);
         }
+        return super.getProxyInternal(loader, interfaces, h);
     }
 
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/common/util/ClassHelper.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/common/util/ClassHelper.java b/core/src/main/java/org/apache/cxf/common/util/ClassHelper.java
index 82b6445..4d7c901 100644
--- a/core/src/main/java/org/apache/cxf/common/util/ClassHelper.java
+++ b/core/src/main/java/org/apache/cxf/common/util/ClassHelper.java
@@ -81,8 +81,7 @@ public class ClassHelper {
         if (bus != null && bus.getProperty(ClassUnwrapper.class.getName()) != null) {
             ClassUnwrapper unwrapper = (ClassUnwrapper)bus.getProperty(ClassUnwrapper.class.getName());
             return unwrapper.getRealClass(o);
-        } else {
-            return HELPER.getRealClassInternal(o);
         }
+        return HELPER.getRealClassInternal(o);
     }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/common/util/ClasspathScanner.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/common/util/ClasspathScanner.java b/core/src/main/java/org/apache/cxf/common/util/ClasspathScanner.java
index 6b76e1c..fb87fe4 100644
--- a/core/src/main/java/org/apache/cxf/common/util/ClasspathScanner.java
+++ b/core/src/main/java/org/apache/cxf/common/util/ClasspathScanner.java
@@ -21,7 +21,7 @@ package org.apache.cxf.common.util;
 import java.io.IOException;
 import java.lang.annotation.Annotation;
 import java.net.URL;
-import java.util.Arrays;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashSet;
@@ -75,8 +75,12 @@ public class ClasspathScanner {
     public static Map< Class< ? extends Annotation >, Collection< Class< ? > > > findClasses(
         String basePackage, Class< ? extends Annotation > ... annotations)
         throws IOException, ClassNotFoundException {
+        List<Class<? extends Annotation>> annotationList = new ArrayList<>(annotations.length);
+        for (Class< ? extends Annotation > c : annotations) {
+            annotationList.add(c);
+        }
         return findClasses(parsePackages(basePackage),
-                           Collections.unmodifiableList(Arrays.asList(annotations)));
+                           Collections.unmodifiableList(annotationList));
     }
 
     /**
@@ -91,7 +95,11 @@ public class ClasspathScanner {
     public static Map< Class< ? extends Annotation >, Collection< Class< ? > > > findClasses(
         Collection< String > basePackages, Class< ? extends Annotation > ... annotations)
         throws IOException, ClassNotFoundException {
-        return findClasses(basePackages, Collections.unmodifiableList(Arrays.asList(annotations)));
+        List<Class<? extends Annotation>> annotationList = new ArrayList<>(annotations.length);
+        for (Class< ? extends Annotation > c : annotations) {
+            annotationList.add(c);
+        }
+        return findClasses(basePackages, Collections.unmodifiableList(annotationList));
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/common/util/CompressionUtils.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/common/util/CompressionUtils.java b/core/src/main/java/org/apache/cxf/common/util/CompressionUtils.java
index 769614c..d07a51e 100644
--- a/core/src/main/java/org/apache/cxf/common/util/CompressionUtils.java
+++ b/core/src/main/java/org/apache/cxf/common/util/CompressionUtils.java
@@ -46,9 +46,8 @@ public final class CompressionUtils {
             if (inflateLen == 0 && !inflater.finished()) {
                 if (inflater.needsInput()) {
                     throw new DataFormatException("Inflater can not inflate all the token bytes");
-                } else {
-                    break;
                 }
+                break;
             }
 
             inflatedToken.write(buffer, 0, inflateLen);

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/common/util/ExtensionInvocationHandler.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/common/util/ExtensionInvocationHandler.java b/core/src/main/java/org/apache/cxf/common/util/ExtensionInvocationHandler.java
index 53185e8..4946183 100644
--- a/core/src/main/java/org/apache/cxf/common/util/ExtensionInvocationHandler.java
+++ b/core/src/main/java/org/apache/cxf/common/util/ExtensionInvocationHandler.java
@@ -32,11 +32,10 @@ public class ExtensionInvocationHandler implements InvocationHandler {
     public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
         if (method.getDeclaringClass().isAssignableFrom(obj.getClass())) {
             return method.invoke(obj, args);
-        } else {
-            //in case obj has the required method with exact signature despite its class
-            //not being assignable from the class declaring the specified method
-            Method m = obj.getClass().getMethod(method.getName(), method.getParameterTypes());
-            return m.invoke(obj, args);
         }
+        //in case obj has the required method with exact signature despite its class
+        //not being assignable from the class declaring the specified method
+        Method m = obj.getClass().getMethod(method.getName(), method.getParameterTypes());
+        return m.invoke(obj, args);
     }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/common/util/PackageUtils.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/common/util/PackageUtils.java b/core/src/main/java/org/apache/cxf/common/util/PackageUtils.java
index 4d7187c..afe858b 100644
--- a/core/src/main/java/org/apache/cxf/common/util/PackageUtils.java
+++ b/core/src/main/java/org/apache/cxf/common/util/PackageUtils.java
@@ -37,9 +37,8 @@ public final class PackageUtils {
         int pos = className.lastIndexOf('.');
         if (pos != -1) {
             return className.substring(0, pos);
-        } else {
-            return "";
         }
+        return "";
     }
 
     public static String getPackageName(Class<?> clazz) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/common/util/PropertyUtils.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/common/util/PropertyUtils.java b/core/src/main/java/org/apache/cxf/common/util/PropertyUtils.java
index 7646002..ce65277 100644
--- a/core/src/main/java/org/apache/cxf/common/util/PropertyUtils.java
+++ b/core/src/main/java/org/apache/cxf/common/util/PropertyUtils.java
@@ -33,9 +33,8 @@ public final class PropertyUtils {
     public static boolean isTrue(Map<String, Object> props, String key) {
         if (props == null || key == null) {
             return false;
-        } else {
-            return isTrue(props.get(key));
         }
+        return isTrue(props.get(key));
     }
 
     /**
@@ -50,9 +49,8 @@ public final class PropertyUtils {
     public static boolean isFalse(Map<String, Object> props, String key) {
         if (props == null || key == null) {
             return false;
-        } else {
-            return isFalse(props.get(key));
         }
+        return isFalse(props.get(key));
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/common/util/ReflectionInvokationHandler.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/common/util/ReflectionInvokationHandler.java b/core/src/main/java/org/apache/cxf/common/util/ReflectionInvokationHandler.java
index 893eae1..4c10272 100644
--- a/core/src/main/java/org/apache/cxf/common/util/ReflectionInvokationHandler.java
+++ b/core/src/main/java/org/apache/cxf/common/util/ReflectionInvokationHandler.java
@@ -156,7 +156,7 @@ public class ReflectionInvokationHandler implements InvocationHandler {
 
     public static <T> T createProxyWrapper(Object target, Class<T> inf) {
         InvocationHandler h = new ReflectionInvokationHandler(target);
-        return inf.cast(Proxy.newProxyInstance(inf.getClassLoader(), new Class[] {inf}, h));
+        return inf.cast(Proxy.newProxyInstance(inf.getClassLoader(), new Class<?>[] {inf}, h));
     }
 
     @Target(ElementType.PARAMETER)

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/common/util/ReflectionUtil.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/common/util/ReflectionUtil.java b/core/src/main/java/org/apache/cxf/common/util/ReflectionUtil.java
index d859fbf..b535c39 100644
--- a/core/src/main/java/org/apache/cxf/common/util/ReflectionUtil.java
+++ b/core/src/main/java/org/apache/cxf/common/util/ReflectionUtil.java
@@ -159,9 +159,8 @@ public final class ReflectionUtil {
             Exception e = pae.getException();
             if (e instanceof NoSuchMethodException) {
                 throw (NoSuchMethodException)e;
-            } else {
-                throw new SecurityException(e);
             }
+            throw new SecurityException(e);
         }
     }
     public static Method getMethod(final Class<?> clazz, final String name,
@@ -176,9 +175,8 @@ public final class ReflectionUtil {
             Exception e = pae.getException();
             if (e instanceof NoSuchMethodException) {
                 throw (NoSuchMethodException)e;
-            } else {
-                throw new SecurityException(e);
             }
+            throw new SecurityException(e);
         }
     }
 
@@ -231,7 +229,7 @@ public final class ReflectionUtil {
                 Class<?> cls = ClassLoaderUtils
                     .loadClass("org.springframework.beans.BeanUtils", refClass);
                 springBeanUtilsDescriptorFetcher
-                    = cls.getMethod("getPropertyDescriptor", new Class[] {Class.class, String.class});
+                    = cls.getMethod("getPropertyDescriptor", Class.class, String.class);
             } catch (Exception e) {
                 //ignore - just assume it's an unsupported/unknown annotation
             }
@@ -260,9 +258,8 @@ public final class ReflectionUtil {
                 return descriptors.toArray(new PropertyDescriptor[descriptors.size()]);
             }
             return null;
-        } else {
-            return beanInfo.getPropertyDescriptors();
         }
+        return beanInfo.getPropertyDescriptors();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/common/util/SpringClasspathScanner.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/common/util/SpringClasspathScanner.java b/core/src/main/java/org/apache/cxf/common/util/SpringClasspathScanner.java
index 023f7a6..c3e3f46 100644
--- a/core/src/main/java/org/apache/cxf/common/util/SpringClasspathScanner.java
+++ b/core/src/main/java/org/apache/cxf/common/util/SpringClasspathScanner.java
@@ -194,8 +194,7 @@ class SpringClasspathScanner extends ClasspathScanner {
         throws ClassNotFoundException {
         if (loader == null) {
             return ClassLoaderUtils.loadClass(className, getClass());
-        } else {
-            return loader.loadClass(className);
         }
+        return loader.loadClass(className);
     }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/common/util/URIParserUtil.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/common/util/URIParserUtil.java b/core/src/main/java/org/apache/cxf/common/util/URIParserUtil.java
index 24122f1..ac08fb5 100644
--- a/core/src/main/java/org/apache/cxf/common/util/URIParserUtil.java
+++ b/core/src/main/java/org/apache/cxf/common/util/URIParserUtil.java
@@ -279,9 +279,8 @@ public final class URIParserUtil {
                     return uri.normalize().toString();
                 }
                 return new File("").toURI().resolve(uri.getPath()).toString();
-            } else {
-                return normalize(arg);
             }
+            return normalize(arg);
         } catch (Exception e2) {
             return normalize(arg);
         }

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/common/util/UrlUtils.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/common/util/UrlUtils.java b/core/src/main/java/org/apache/cxf/common/util/UrlUtils.java
index bd78305..6d65b12 100644
--- a/core/src/main/java/org/apache/cxf/common/util/UrlUtils.java
+++ b/core/src/main/java/org/apache/cxf/common/util/UrlUtils.java
@@ -94,8 +94,8 @@ public final class UrlUtils {
                     out.put((byte) ' ');
                 } else if (b == ESCAPE_CHAR) {
                     try {
-                        final int u = digit16((byte) in.get());
-                        final int l = digit16((byte) in.get());
+                        final int u = digit16(in.get());
+                        final int l = digit16(in.get());
                         out.put((byte) ((u << 4) + l));
                     } catch (final BufferUnderflowException e) {
                         throw new IllegalArgumentException(
@@ -107,9 +107,8 @@ public final class UrlUtils {
             }
             out.flip();
             return Charset.forName(enc).decode(out).toString();
-        } else {
-            return value;
         }
+        return value;
     }
 
     private static int digit16(final byte b) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/common/xmlschema/XmlSchemaUtils.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/common/xmlschema/XmlSchemaUtils.java b/core/src/main/java/org/apache/cxf/common/xmlschema/XmlSchemaUtils.java
index ca930bf..6418921 100644
--- a/core/src/main/java/org/apache/cxf/common/xmlschema/XmlSchemaUtils.java
+++ b/core/src/main/java/org/apache/cxf/common/xmlschema/XmlSchemaUtils.java
@@ -250,12 +250,11 @@ public final class XmlSchemaUtils {
             List<XmlSchemaAttributeOrGroupRef> extAttrs = getContentAttributes(type);
             results.addAll(extAttrs);
             return results;
-        } else {
-            // no base type, the simple case.
-            List<XmlSchemaAttributeOrGroupRef> attrs = type.getAttributes();
-            results.addAll(attrs);
-            return results;
         }
+        // no base type, the simple case.
+        List<XmlSchemaAttributeOrGroupRef> attrs = type.getAttributes();
+        results.addAll(attrs);
+        return results;
     }
 
 
@@ -325,9 +324,8 @@ public final class XmlSchemaUtils {
             return isAttributeNameQualified(attribute, attributeSchema)
                 || (localSchema != null
                     && !(attribute.getQName().getNamespaceURI().equals(localSchema.getTargetNamespace())));
-        } else {
-            return isAttributeNameQualified(attribute, attributeSchema);
         }
+        return isAttributeNameQualified(attribute, attributeSchema);
     }
 
     public static boolean isElementNameQualified(XmlSchemaElement element, XmlSchema schema) {
@@ -378,9 +376,8 @@ public final class XmlSchemaUtils {
             return isElementNameQualified(element, elementSchema)
                 || (localSchema != null
                     && !(qn.getNamespaceURI().equals(localSchema.getTargetNamespace())));
-        } else {
-            return isElementNameQualified(element, elementSchema);
         }
+        return isElementNameQualified(element, elementSchema);
     }
 
     public static boolean isParticleArray(XmlSchemaParticle particle) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/configuration/jsse/SSLUtils.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/configuration/jsse/SSLUtils.java b/core/src/main/java/org/apache/cxf/configuration/jsse/SSLUtils.java
index 99716f1..63d1a67 100644
--- a/core/src/main/java/org/apache/cxf/configuration/jsse/SSLUtils.java
+++ b/core/src/main/java/org/apache/cxf/configuration/jsse/SSLUtils.java
@@ -368,9 +368,8 @@ public final class SSLUtils {
                      excludedCipherSuites);
         if (exclude) {
             return getCiphersFromList(excludedCipherSuites, log, exclude);
-        } else {
-            return getCiphersFromList(filteredCipherSuites, log, exclude);
         }
+        return getCiphersFromList(filteredCipherSuites, log, exclude);
     }
 
     private static String[] getSystemCiphersuites(Logger log) {
@@ -378,9 +377,8 @@ public final class SSLUtils {
         if ((jvmCipherSuites != null) && (!jvmCipherSuites.isEmpty())) {
             LogUtils.log(log, Level.FINE, "CIPHERSUITES_SYSTEM_PROPERTY_SET", jvmCipherSuites);
             return jvmCipherSuites.split(",");
-        } else {
-            return null;
         }
+        return null;
 
     }
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/configuration/jsse/TLSClientParameters.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/configuration/jsse/TLSClientParameters.java b/core/src/main/java/org/apache/cxf/configuration/jsse/TLSClientParameters.java
index f880e53..51b85b6 100644
--- a/core/src/main/java/org/apache/cxf/configuration/jsse/TLSClientParameters.java
+++ b/core/src/main/java/org/apache/cxf/configuration/jsse/TLSClientParameters.java
@@ -247,17 +247,15 @@ public class TLSClientParameters extends TLSParameterBase {
     private static boolean equals(final Object[] a1, final Object[] a2) {
         if (a1 == null) {
             return a2 == null;
-        } else {
-            if (a2 != null && a1.length == a2.length) {
-                for (int i = 0; i < a1.length; i++) {
-                    if (!equals(a1[i], a2[i])) {
-                        return false;
-                    }
+        }
+        if (a2 != null && a1.length == a2.length) {
+            for (int i = 0; i < a1.length; i++) {
+                if (!equals(a1[i], a2[i])) {
+                    return false;
                 }
-                return true;
-            } else {
-                return false;
             }
+            return true;
         }
+        return false;
     }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/databinding/AbstractWrapperHelper.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/databinding/AbstractWrapperHelper.java b/core/src/main/java/org/apache/cxf/databinding/AbstractWrapperHelper.java
index 566f20a..86d636d 100644
--- a/core/src/main/java/org/apache/cxf/databinding/AbstractWrapperHelper.java
+++ b/core/src/main/java/org/apache/cxf/databinding/AbstractWrapperHelper.java
@@ -32,7 +32,7 @@ import org.apache.cxf.interceptor.Fault;
  */
 public abstract class AbstractWrapperHelper implements WrapperHelper {
 
-    public static final Class<?> NO_CLASSES[] = new Class[0];
+    public static final Class<?> NO_CLASSES[] = new Class<?>[0];
     public static final Object NO_PARAMS[] = new Object[0];
 
     protected final Class<?> wrapperType;

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/databinding/source/NodeDataReader.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/databinding/source/NodeDataReader.java b/core/src/main/java/org/apache/cxf/databinding/source/NodeDataReader.java
index 04a3acc..b98ec22 100644
--- a/core/src/main/java/org/apache/cxf/databinding/source/NodeDataReader.java
+++ b/core/src/main/java/org/apache/cxf/databinding/source/NodeDataReader.java
@@ -58,7 +58,6 @@ public class NodeDataReader implements DataReader<Node> {
             try (CachedOutputStream out = new CachedOutputStream()) {
                 StaxUtils.writeTo(input, out);
                 InputStream is = out.getInputStream();
-                out.close();
 
                 return new StreamSource(is);
             } catch (IOException e) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/databinding/source/SourceDataBinding.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/databinding/source/SourceDataBinding.java b/core/src/main/java/org/apache/cxf/databinding/source/SourceDataBinding.java
index 4e71968..efa1375 100644
--- a/core/src/main/java/org/apache/cxf/databinding/source/SourceDataBinding.java
+++ b/core/src/main/java/org/apache/cxf/databinding/source/SourceDataBinding.java
@@ -83,7 +83,7 @@ public class SourceDataBinding extends org.apache.cxf.databinding.AbstractDataBi
     }
 
     public Class<?>[] getSupportedReaderFormats() {
-        return new Class[] {XMLStreamReader.class, Node.class};
+        return new Class<?>[] {XMLStreamReader.class, Node.class};
     }
 
     @SuppressWarnings("unchecked")
@@ -92,13 +92,12 @@ public class SourceDataBinding extends org.apache.cxf.databinding.AbstractDataBi
             return (DataWriter<T>) new XMLStreamDataWriter();
         } else if (cls == Node.class) {
             return (DataWriter<T>) new NodeDataWriter();
-        } else {
-            throw new UnsupportedOperationException("The type " + cls.getName() + " is not supported.");
         }
+        throw new UnsupportedOperationException("The type " + cls.getName() + " is not supported.");
     }
 
     public Class<?>[] getSupportedWriterFormats() {
-        return new Class[] {XMLStreamWriter.class, Node.class};
+        return new Class<?>[] {XMLStreamWriter.class, Node.class};
     }
 
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataReader.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataReader.java b/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataReader.java
index 7d7248b..80d8fcf 100644
--- a/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataReader.java
+++ b/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataReader.java
@@ -289,14 +289,13 @@ public class XMLStreamDataReader implements DataReader<XMLStreamReader> {
                 DOMSource o = new DOMSource(domreader.getCurrentElement());
                 domreader.consumeFrame();
                 return o;
-            } else {
-                Document document = StaxUtils.read(reader);
-                if (reader.hasNext()) {
-                    //need to actually consume the END_ELEMENT
-                    reader.next();
-                }
-                return new DOMSource(document);
             }
+            Document document = StaxUtils.read(reader);
+            if (reader.hasNext()) {
+                //need to actually consume the END_ELEMENT
+                reader.next();
+            }
+            return new DOMSource(document);
         } catch (XMLStreamException e) {
             throw new Fault("COULD_NOT_READ_XML_STREAM_CAUSED_BY", LOG, e,
                             e.getClass().getCanonicalName(), e.getMessage());

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/databinding/stax/StaxDataBinding.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/databinding/stax/StaxDataBinding.java b/core/src/main/java/org/apache/cxf/databinding/stax/StaxDataBinding.java
index f2a65a8..a78b691 100644
--- a/core/src/main/java/org/apache/cxf/databinding/stax/StaxDataBinding.java
+++ b/core/src/main/java/org/apache/cxf/databinding/stax/StaxDataBinding.java
@@ -104,26 +104,24 @@ public class StaxDataBinding extends AbstractInterceptorProvidingDataBinding {
     public <T> DataReader<T> createReader(Class<T> cls) {
         if (cls == XMLStreamReader.class) {
             return (DataReader<T>) xsrReader;
-        } else {
-            throw new UnsupportedOperationException("The type " + cls.getName() + " is not supported.");
         }
+        throw new UnsupportedOperationException("The type " + cls.getName() + " is not supported.");
     }
 
     public Class<?>[] getSupportedReaderFormats() {
-        return new Class[] {XMLStreamReader.class};
+        return new Class<?>[] {XMLStreamReader.class};
     }
 
     @SuppressWarnings("unchecked")
     public <T> DataWriter<T> createWriter(Class<T> cls) {
         if (cls == XMLStreamWriter.class) {
             return (DataWriter<T>) xswWriter;
-        } else {
-            throw new UnsupportedOperationException("The type " + cls.getName() + " is not supported.");
         }
+        throw new UnsupportedOperationException("The type " + cls.getName() + " is not supported.");
     }
 
     public Class<?>[] getSupportedWriterFormats() {
-        return new Class[] {XMLStreamWriter.class, Node.class};
+        return new Class<?>[] {XMLStreamWriter.class, Node.class};
     }
 
     public static class XMLStreamDataReader implements DataReader<XMLStreamReader> {

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/endpoint/AbstractConduitSelector.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/endpoint/AbstractConduitSelector.java b/core/src/main/java/org/apache/cxf/endpoint/AbstractConduitSelector.java
index 47c6687..f9c6884 100644
--- a/core/src/main/java/org/apache/cxf/endpoint/AbstractConduitSelector.java
+++ b/core/src/main/java/org/apache/cxf/endpoint/AbstractConduitSelector.java
@@ -272,12 +272,10 @@ public abstract class AbstractConduitSelector implements ConduitSelector, Closea
             //their hosts also match
             if (conduitAddress.equalsIgnoreCase(actualAddress)) {
                 return true;
-            } else {
-                return cbg.isFullComparison() ? false : matchAddressSubstrings(conduitAddress, actualAddress);
             }
-        } else {
             return cbg.isFullComparison() ? false : matchAddressSubstrings(conduitAddress, actualAddress);
         }
+        return cbg.isFullComparison() ? false : matchAddressSubstrings(conduitAddress, actualAddress);
     }
 
     //smart address substring comparison that tries to avoid building and comparing substrings unless strictly required
@@ -290,10 +288,9 @@ public abstract class AbstractConduitSelector implements ConduitSelector, Closea
             conduitAddress = conduitAddress.substring(0, idx);
             actualAddress = actualAddress.substring(0, idx);
             return conduitAddress.equalsIgnoreCase(actualAddress);
-        } else {
-            //no possible match as for sure the substrings before idx will be different
-            return false;
         }
+        //no possible match as for sure the substrings before idx will be different
+        return false;
     }
 
     private static final class ContextualBooleanGetter {

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java b/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
index 6a6181f..8fc116f 100644
--- a/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
+++ b/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
@@ -200,41 +200,37 @@ public class ClientImpl
     }
 
     private EndpointInfo findEndpoint(Service svc, QName port) {
-        EndpointInfo epfo;
         if (port != null) {
-            epfo = svc.getEndpointInfo(port);
+            EndpointInfo epfo = svc.getEndpointInfo(port);
             if (epfo == null) {
                 throw new IllegalArgumentException("The service " + svc.getName()
                                                    + " does not have an endpoint " + port + ".");
             }
-        } else {
-            epfo = null;
-            for (ServiceInfo svcfo : svc.getServiceInfos()) {
-                for (EndpointInfo e : svcfo.getEndpoints()) {
-                    BindingInfo bfo = e.getBinding();
-                    String bid = bfo.getBindingId();
-                    if ("http://schemas.xmlsoap.org/wsdl/soap/".equals(bid)
-                        || "http://schemas.xmlsoap.org/wsdl/soap12/".equals(bid)) {
-                        for (Object o : bfo.getExtensors().get()) {
-                            try {
-                                String s = (String)o.getClass().getMethod("getTransportURI").invoke(o);
-                                if (s != null && s.endsWith("http")) {
-                                    return e;
-                                }
-                            } catch (Throwable t) {
-                                //ignore
+            return epfo;
+        }
+        
+        for (ServiceInfo svcfo : svc.getServiceInfos()) {
+            for (EndpointInfo e : svcfo.getEndpoints()) {
+                BindingInfo bfo = e.getBinding();
+                String bid = bfo.getBindingId();
+                if ("http://schemas.xmlsoap.org/wsdl/soap/".equals(bid)
+                    || "http://schemas.xmlsoap.org/wsdl/soap12/".equals(bid)) {
+                    for (Object o : bfo.getExtensors().get()) {
+                        try {
+                            String s = (String)o.getClass().getMethod("getTransportURI").invoke(o);
+                            if (s != null && s.endsWith("http")) {
+                                return e;
                             }
+                        } catch (Throwable t) {
+                            //ignore
                         }
                     }
                 }
             }
-            if (epfo == null) {
-                throw new UnsupportedOperationException(
-                     "Only document-style SOAP 1.1 and 1.2 http are supported "
-                     + "for auto-selection of endpoint; none were found.");
-            }
         }
-        return epfo;
+        throw new UnsupportedOperationException(
+             "Only document-style SOAP 1.1 and 1.2 http are supported "
+             + "for auto-selection of endpoint; none were found.");
     }
 
     public Endpoint getEndpoint() {
@@ -525,9 +521,8 @@ public class ClientImpl
 
             if (callback != null) {
                 return null;
-            } else {
-                return processResult(message, exchange, oi, resContext);
             }
+            return processResult(message, exchange, oi, resContext);
         } finally {
             if (origLoader != null) {
                 origLoader.reset();

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/helpers/ServiceUtils.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/helpers/ServiceUtils.java b/core/src/main/java/org/apache/cxf/helpers/ServiceUtils.java
index f3a3559..1946082 100644
--- a/core/src/main/java/org/apache/cxf/helpers/ServiceUtils.java
+++ b/core/src/main/java/org/apache/cxf/helpers/ServiceUtils.java
@@ -94,9 +94,8 @@ public final class ServiceUtils {
         if (obj != null) {
             // this method will transform the legacy enabled as well
             return getSchemaValidationType(obj);
-        } else {
-            return null;
         }
+        return null;
     }
 
     private static SchemaValidationType getSchemaValidationTypeFromModel(Message message) {
@@ -111,7 +110,7 @@ public final class ServiceUtils {
                 OperationInfo opInfo = boi.getOperationInfo();
                 EndpointInfo ep = endpoint.getEndpointInfo();
 
-                if (validationType == null && opInfo != null) {
+                if (opInfo != null) {
                     validationType = getSchemaValidationTypeFromModel(opInfo);
 
                     if (validationType == null && ep != null) {
@@ -132,9 +131,8 @@ public final class ServiceUtils {
         Object obj = properties.getProperty(Message.SCHEMA_VALIDATION_TYPE);
         if (obj != null) {
             return getSchemaValidationType(obj);
-        } else {
-            return null;
         }
+        return null;
     }
 
     public static SchemaValidationType getSchemaValidationType(Object obj) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/interceptor/ClientFaultConverter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/interceptor/ClientFaultConverter.java b/core/src/main/java/org/apache/cxf/interceptor/ClientFaultConverter.java
index 61a7a51..3e76995 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/ClientFaultConverter.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/ClientFaultConverter.java
@@ -173,13 +173,13 @@ public class ClientFaultConverter extends AbstractInDatabindingInterceptor {
                     return;
                 }
                 if (e == null) {
-                    Constructor<?> constructor = exClass.getConstructor(new Class[]{String.class});
-                    e = constructor.newInstance(new Object[]{fault.getMessage()});
+                    Constructor<?> constructor = exClass.getConstructor(String.class);
+                    e = constructor.newInstance(fault.getMessage());
                 } else {
 
                     try {
                         Constructor<?> constructor = getConstructor(exClass, e);
-                        e = constructor.newInstance(new Object[]{fault.getMessage(), e});
+                        e = constructor.newInstance(fault.getMessage(), e);
                     } catch (NoSuchMethodException e1) {
                         //Use reflection to convert fault bean to exception
                         e = convertFaultBean(exClass, e, fault);
@@ -215,14 +215,13 @@ public class ClientFaultConverter extends AbstractInDatabindingInterceptor {
             }
         }
         try {
-            return faultClass.getConstructor(new Class[]{String.class, beanClass});
+            return faultClass.getConstructor(String.class, beanClass);
         } catch (NoSuchMethodException ex) {
             Class<?> cls = getPrimitiveClass(beanClass);
             if (cls != null) {
-                return faultClass.getConstructor(new Class[]{String.class, cls});
-            } else {
-                throw ex;
+                return faultClass.getConstructor(String.class, cls);
             }
+            throw ex;
         }
 
     }
@@ -334,8 +333,8 @@ public class ClientFaultConverter extends AbstractInDatabindingInterceptor {
     }
 
     private Exception convertFaultBean(Class<?> exClass, Object faultBean, Fault fault) throws Exception {
-        Constructor<?> constructor = exClass.getConstructor(new Class[]{String.class});
-        Exception e = (Exception)constructor.newInstance(new Object[]{fault.getMessage()});
+        Constructor<?> constructor = exClass.getConstructor(String.class);
+        Exception e = (Exception)constructor.newInstance(fault.getMessage());
 
         //Copy fault bean fields to exception
         for (Class<?> obj = exClass; !obj.equals(Object.class);  obj = obj.getSuperclass()) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/interceptor/FIStaxInInterceptor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/interceptor/FIStaxInInterceptor.java b/core/src/main/java/org/apache/cxf/interceptor/FIStaxInInterceptor.java
index 1ae9b97..d7d56f1 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/FIStaxInInterceptor.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/FIStaxInInterceptor.java
@@ -93,8 +93,7 @@ public class FIStaxInInterceptor extends AbstractPhaseInterceptor<Message> {
         if (isGET(message)) {
             return isRequestor(message)
                 && MessageUtils.isTrue(message.getContextualProperty(FI_GET_SUPPORTED));
-        } else {
-            return true;
         }
+        return true;
     }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/interceptor/FaultOutInterceptor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/interceptor/FaultOutInterceptor.java b/core/src/main/java/org/apache/cxf/interceptor/FaultOutInterceptor.java
index 94ba7f7..bbd9564 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/FaultOutInterceptor.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/FaultOutInterceptor.java
@@ -131,8 +131,8 @@ public class FaultOutInterceptor extends AbstractPhaseInterceptor<Message> {
     protected Object getFaultBean(Throwable cause, FaultInfo faultPart, Message message) {
         if (cause instanceof FaultInfoException) {
             try {
-                Method method = cause.getClass().getMethod("getFaultInfo", new Class[0]);
-                return method.invoke(cause, new Object[0]);
+                Method method = cause.getClass().getMethod("getFaultInfo");
+                return method.invoke(cause);
             } catch (InvocationTargetException e) {
                 throw new Fault(new org.apache.cxf.common.i18n.Message("INVOKE_FAULT_INFO", LOG), e);
             } catch (NoSuchMethodException e) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/interceptor/ServiceInvokerInterceptor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/interceptor/ServiceInvokerInterceptor.java b/core/src/main/java/org/apache/cxf/interceptor/ServiceInvokerInterceptor.java
index 5fee966..ae56e6c 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/ServiceInvokerInterceptor.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/ServiceInvokerInterceptor.java
@@ -140,9 +140,8 @@ public class ServiceInvokerInterceptor extends AbstractPhaseInterceptor<Message>
             } catch (ExecutionException e) {
                 if (e.getCause() instanceof RuntimeException) {
                     throw (RuntimeException)e.getCause();
-                } else {
-                    throw new Fault(e.getCause());
                 }
+                throw new Fault(e.getCause());
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/interceptor/StaxInInterceptor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/interceptor/StaxInInterceptor.java b/core/src/main/java/org/apache/cxf/interceptor/StaxInInterceptor.java
index 4e0a091..ca035ef 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/StaxInInterceptor.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/StaxInInterceptor.java
@@ -93,7 +93,7 @@ public class StaxInInterceptor extends AbstractPhaseInterceptor<Message> {
                         LOG, "(none)"));
             }
             throw new Fault(new org.apache.cxf.common.i18n.Message("INVALID_HTML_RESPONSETYPE",
-                    LOG, (htmlMessage == null || htmlMessage.length() == 0) ? "(none)" : htmlMessage));
+                    LOG, (htmlMessage.length() == 0) ? "(none)" : htmlMessage));
         }
         if (contentType == null) {
             //if contentType is null, this is likely a an empty post/put/delete/similar, lets see if it's

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/interceptor/security/AbstractSecurityContextInInterceptor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/interceptor/security/AbstractSecurityContextInInterceptor.java b/core/src/main/java/org/apache/cxf/interceptor/security/AbstractSecurityContextInInterceptor.java
index 76fd924..6066f6b 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/security/AbstractSecurityContextInInterceptor.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/security/AbstractSecurityContextInInterceptor.java
@@ -72,9 +72,8 @@ public abstract class AbstractSecurityContextInInterceptor extends AbstractPhase
         Principal[] ps = subject.getPrincipals().toArray(new Principal[subject.getPrincipals().size()]);
         if (ps != null && ps.length > 0 && !(ps[0] instanceof Group)) {
             return ps[0];
-        } else {
-            return originalPrincipal;
         }
+        return originalPrincipal;
     }
 
     protected SecurityContext createSecurityContext(Principal p, Subject subject) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/interceptor/security/JAASLoginInterceptor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/interceptor/security/JAASLoginInterceptor.java b/core/src/main/java/org/apache/cxf/interceptor/security/JAASLoginInterceptor.java
index f91f96e..1aa4225 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/security/JAASLoginInterceptor.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/security/JAASLoginInterceptor.java
@@ -167,9 +167,8 @@ public class JAASLoginInterceptor extends AbstractPhaseInterceptor<Message> {
                 aex.initCause(ex);
                 throw aex;
 
-            } else {
-                throw new AuthenticationException("Authentication failed (details can be found in server log)");
             }
+            throw new AuthenticationException("Authentication failed (details can be found in server log)");
         }
     }
 
@@ -194,9 +193,8 @@ public class JAASLoginInterceptor extends AbstractPhaseInterceptor<Message> {
         if (getRoleClassifier() != null) {
             return new RolePrefixSecurityContextImpl(subject, getRoleClassifier(),
                                                      getRoleClassifierType());
-        } else {
-            return new DefaultSecurityContext(name, subject);
         }
+        return new DefaultSecurityContext(name, subject);
     }
 
     public Configuration getLoginConfig() {

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/interceptor/security/NameDigestPasswordCallbackHandler.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/interceptor/security/NameDigestPasswordCallbackHandler.java b/core/src/main/java/org/apache/cxf/interceptor/security/NameDigestPasswordCallbackHandler.java
index 5380b56..3f8c374 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/security/NameDigestPasswordCallbackHandler.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/security/NameDigestPasswordCallbackHandler.java
@@ -38,7 +38,7 @@ public class NameDigestPasswordCallbackHandler implements CallbackHandler {
     private static final Logger LOG = LogUtils.getL7dLogger(NameDigestPasswordCallbackHandler.class);
     private static final String PASSWORD_CALLBACK_NAME = "setObject";
     private static final Class<?>[] PASSWORD_CALLBACK_TYPES =
-        new Class[]{Object.class, char[].class, String.class};
+        new Class<?>[]{Object.class, char[].class, String.class};
 
     private String username;
     private String password;

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/interceptor/security/NamePasswordCallbackHandler.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/interceptor/security/NamePasswordCallbackHandler.java b/core/src/main/java/org/apache/cxf/interceptor/security/NamePasswordCallbackHandler.java
index f03dd0f..81c34a3 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/security/NamePasswordCallbackHandler.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/security/NamePasswordCallbackHandler.java
@@ -38,7 +38,7 @@ public class NamePasswordCallbackHandler implements CallbackHandler {
     private static final Logger LOG = LogUtils.getL7dLogger(NamePasswordCallbackHandler.class);
     private static final String PASSWORD_CALLBACK_NAME = "setObject";
     private static final Class<?>[] PASSWORD_CALLBACK_TYPES =
-        new Class[]{Object.class, char[].class, String.class};
+        new Class<?>[]{Object.class, char[].class, String.class};
 
     private String username;
     private String password;

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/interceptor/security/RolePrefixSecurityContextImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/interceptor/security/RolePrefixSecurityContextImpl.java b/core/src/main/java/org/apache/cxf/interceptor/security/RolePrefixSecurityContextImpl.java
index 125d6e0..74d3acc 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/security/RolePrefixSecurityContextImpl.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/security/RolePrefixSecurityContextImpl.java
@@ -83,9 +83,8 @@ public class RolePrefixSecurityContextImpl implements LoginSecurityContext {
     private static boolean isRole(Principal p, String roleClassifier, String roleClassifierType) {
         if (JAASLoginInterceptor.ROLE_CLASSIFIER_PREFIX.equals(roleClassifierType)) {
             return p.getName().startsWith(roleClassifier);
-        } else {
-            return p.getClass().getName().endsWith(roleClassifier);
         }
+        return p.getClass().getName().endsWith(roleClassifier);
     }
 
     public Subject getSubject() {

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/interceptor/security/SecureAnnotationsInterceptor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/interceptor/security/SecureAnnotationsInterceptor.java b/core/src/main/java/org/apache/cxf/interceptor/security/SecureAnnotationsInterceptor.java
index 5aca185..9b5a47d 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/security/SecureAnnotationsInterceptor.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/security/SecureAnnotationsInterceptor.java
@@ -114,8 +114,8 @@ public class SecureAnnotationsInterceptor extends SimpleAuthorizingInterceptor {
         for (Annotation ann : anns) {
             if (ann.annotationType().getName().equals(annName)) {
                 try {
-                    Method valueMethod = ann.annotationType().getMethod("value", new Class[]{});
-                    String[] roles = (String[])valueMethod.invoke(ann, new Object[]{});
+                    Method valueMethod = ann.annotationType().getMethod("value");
+                    String[] roles = (String[])valueMethod.invoke(ann);
                     StringBuilder sb = new StringBuilder();
                     for (int i = 0; i < roles.length; i++) {
                         sb.append(roles[i]);

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/interceptor/security/SimpleAuthorizingInterceptor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/interceptor/security/SimpleAuthorizingInterceptor.java b/core/src/main/java/org/apache/cxf/interceptor/security/SimpleAuthorizingInterceptor.java
index df2a907..1c5e1df 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/security/SimpleAuthorizingInterceptor.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/security/SimpleAuthorizingInterceptor.java
@@ -60,9 +60,8 @@ public class SimpleAuthorizingInterceptor extends AbstractAuthorizingInIntercept
                 }
             }
             return false;
-        } else {
-            return !checkConfiguredRolesOnly;
         }
+        return !checkConfiguredRolesOnly;
     }
 
     protected String createMethodSig(Method method) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/c26e8b99/core/src/main/java/org/apache/cxf/interceptor/security/callback/CallbackHandlerProviderUsernameToken.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/interceptor/security/callback/CallbackHandlerProviderUsernameToken.java b/core/src/main/java/org/apache/cxf/interceptor/security/callback/CallbackHandlerProviderUsernameToken.java
index de66c49..0488873 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/security/callback/CallbackHandlerProviderUsernameToken.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/security/callback/CallbackHandlerProviderUsernameToken.java
@@ -40,9 +40,8 @@ public class CallbackHandlerProviderUsernameToken implements CallbackHandlerProv
                                                          ut.getPassword(),
                                                          ut.getNonce(),
                                                          ut.getCreatedTime());
-        } else {
-            return new NamePasswordCallbackHandler(ut.getName(), ut.getPassword());
         }
+        return new NamePasswordCallbackHandler(ut.getName(), ut.getPassword());
     }
 
 }


Mime
View raw message