cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [2/3] cxf git commit: Update to latest PMD to match what eclipse pulls in now.
Date Fri, 05 May 2017 16:24:50 GMT
Update to latest PMD to match what eclipse pulls in now.


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

Branch: refs/heads/master
Commit: d49f3f2468cde9aa1f34d6448c6e35e717ded676
Parents: 4a418df
Author: Daniel Kulp <dkulp@apache.org>
Authored: Fri May 5 11:28:55 2017 -0400
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Fri May 5 11:29:11 2017 -0400

----------------------------------------------------------------------
 .../bus/managers/ConduitInitiatorManagerImpl.java    |  4 +---
 .../bus/managers/DestinationFactoryManagerImpl.java  |  4 +---
 .../org/apache/cxf/catalog/OASISCatalogManager.java  |  3 +--
 .../common/jaxb/SchemaCollectionContextProxy.java    |  3 +--
 .../cxf/transport/MultipleEndpointObserver.java      |  4 +---
 .../cxf/common/injection/ResourceInjectorTest.java   |  7 +++----
 .../java/org/apache/cxf/jca/servant/EJBEndpoint.java |  4 +---
 parent/pom.xml                                       |  2 +-
 .../corba/interceptors/CorbaStreamInInterceptor.java | 11 ++++-------
 .../soap/jms/interceptor/SoapFaultFactory.java       |  5 ++---
 .../SoapPreProtocolOutInterceptorTest.java           |  4 +---
 .../cxf/aegis/type/java5/Java5TypeCreator.java       |  4 +---
 .../apache/cxf/aegis/services/ComplexService.java    |  4 +---
 .../cxf/clustering/FailoverTargetSelector.java       |  7 +++----
 .../org/apache/cxf/jaxrs/utils/InjectionUtils.java   |  3 +--
 .../cxf/jaxws/handler/HandlerResolverImpl.java       |  3 +--
 .../handler/soap/SOAPHandlerFaultInInterceptor.java  |  3 +--
 .../handler/soap/SOAPHandlerFaultOutInterceptor.java |  3 +--
 .../jaxws/handler/soap/SOAPHandlerInterceptor.java   |  3 +--
 .../java/org/apache/cxf/jaxws/spi/ProviderImpl.java  |  5 +----
 .../management/jmx/InstrumentationManagerImpl.java   |  5 +----
 .../cxf/jaxrs/provider/json/utils/JSONUtils.java     |  3 +--
 .../cxf/jaxrs/provider/dom4j/DOM4JProviderTest.java  |  6 ++----
 .../jaxrs/ext/search/hbase/HBaseQueryVisitor.java    |  9 ++++-----
 .../ext/search/jpa/AbstractJPATypedQueryVisitor.java |  4 +---
 .../search/SearchContextImplCustomParserTest.java    |  9 ++++-----
 .../cxf/rs/security/jose/jwe/JweJsonConsumer.java    | 15 +++++++--------
 .../oauth2/client/JoseClientCodeStateManager.java    |  4 ++--
 .../oauth2/tokens/hawk/HawkAuthorizationScheme.java  |  8 ++------
 .../oidc/idp/OidcDynamicRegistrationService.java     |  4 +---
 .../sso/AbstractRequestAssertionConsumerHandler.java | 11 ++++-------
 .../authorization/SecurityContextProviderImpl.java   |  4 +---
 .../http_jetty/spring/JettySpringTypesFactory.java   |  8 ++------
 .../netty/server/spring/NettySpringTypesFactory.java |  8 ++------
 .../spring/UndertowSpringTypesFactory.java           |  8 ++------
 .../java/org/apache/cxf/transport/http/Cookie.java   |  3 +--
 .../cxf/transport/servlet/CXFNonSpringServlet.java   |  8 +++-----
 .../apache/cxf/transport/jms/JMSConfiguration.java   |  3 +--
 .../cxf/transport/jms/SecurityContextFactory.java    |  3 +--
 .../transport/websocket/ahc/AhcWebSocketConduit.java |  6 ++----
 .../cxf/ws/addressing/impl/MAPAggregatorTest.java    |  4 +---
 .../org/apache/cxf/ws/policy/PolicyEngineTest.java   |  3 +--
 .../java/org/apache/cxf/ws/rm/ManagedRMEndpoint.java | 10 ++++------
 .../org/apache/cxf/ws/rm/soap/SoapFaultFactory.java  |  3 +--
 .../cxf/ws/security/wss4j/WSS4JInInterceptor.java    |  4 +---
 .../policyhandlers/AbstractStaxBindingHandler.java   |  4 +---
 .../policyvalidators/X509TokenPolicyValidator.java   |  4 +---
 .../ws/security/wss4j/SecurityActionTokenTest.java   |  4 +---
 .../apache/cxf/ws/security/wss4j/WSS4JInOutTest.java |  4 +---
 .../apache/cxf/sts/operation/AbstractOperation.java  |  4 +---
 .../cxf/sts/operation/TokenIssueOperation.java       |  4 +---
 .../sts/token/provider/DefaultSubjectProvider.java   |  4 +---
 .../sts/operation/IssueJWTOnbehalfofUnitTest.java    |  5 +----
 .../cxf/sts/operation/IssueOnbehalfofUnitTest.java   |  5 +----
 .../ValidateTokenTransformationUnitTest.java         | 10 ++--------
 .../apache/cxf/sts/operation/ValidateUnitTest.java   |  4 +---
 .../sts/operation/ValidateUsernameTokenUnitTest.java |  4 +---
 .../cxf/sts/operation/ValidateX509TokenUnitTest.java |  5 +----
 .../sts/token/provider/CustomSubjectProvider.java    |  5 +----
 .../java/org/apache/cxf/xkms/client/XKMSInvoker.java |  3 +--
 .../java/org/apache/cxf/systest/jaxrs/BookStore.java |  8 ++------
 .../apache/cxf/systest/jaxrs/BookStoreSpring.java    |  4 +---
 .../org/apache/cxf/systest/jaxrs/MultipartStore.java | 10 ++--------
 .../jaxrs/tracing/brave/BraveTracingTest.java        |  3 +--
 .../apache/cxf/jms/testsuite/util/JMSTestUtil.java   |  3 +--
 .../clustering/LoadDistributorStaticStrategy.java    |  4 +---
 .../org/apache/cxf/systest/ws/util/MessageFlow.java  |  2 +-
 .../WSSecurity10UsernameAuthorizationLegacyTest.java |  4 +---
 .../WSSecurity10UsernameAuthorizationTest.java       |  8 ++------
 .../ws/addr_feature/WSAFaultToClientServerTest.java  |  4 +---
 .../org/apache/cxf/systest/ws/util/MessageFlow.java  |  2 +-
 .../main/java/org/apache/cxf/test/TestUtilities.java |  5 ++---
 .../corba/processors/idl/ConstrTypeSpecVisitor.java  |  4 +---
 .../corba/processors/idl/SimpleTypeSpecVisitor.java  |  4 +---
 .../processors/idl/TemplateTypeSpecVisitor.java      |  4 +---
 .../tools/corba/processors/idl/TypeDclVisitor.java   |  4 +---
 .../idlpreprocessor/IdlPreprocessorReaderTest.java   |  6 +-----
 .../jaxws/customization/CustomNodeSelector.java      |  8 ++------
 .../jaxws/processor/internal/FaultProcessor.java     |  3 +--
 .../jaxws/processor/internal/ProcessorUtil.java      |  8 ++------
 80 files changed, 122 insertions(+), 284 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/core/src/main/java/org/apache/cxf/bus/managers/ConduitInitiatorManagerImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/bus/managers/ConduitInitiatorManagerImpl.java b/core/src/main/java/org/apache/cxf/bus/managers/ConduitInitiatorManagerImpl.java
index 0ccfbb3..141154c 100644
--- a/core/src/main/java/org/apache/cxf/bus/managers/ConduitInitiatorManagerImpl.java
+++ b/core/src/main/java/org/apache/cxf/bus/managers/ConduitInitiatorManagerImpl.java
@@ -118,11 +118,9 @@ public final class ConduitInitiatorManagerImpl implements ConduitInitiatorManage
     }
 
     public ConduitInitiator getConduitInitiatorForUri(String uri) {
-        ConduitInitiator factory = new TransportFinder<ConduitInitiator>(bus,
+        return new TransportFinder<ConduitInitiator>(bus,
             conduitInitiators,
             loaded,
             ConduitInitiator.class).findTransportForURI(uri);
-
-        return factory;
     }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/core/src/main/java/org/apache/cxf/bus/managers/DestinationFactoryManagerImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/bus/managers/DestinationFactoryManagerImpl.java b/core/src/main/java/org/apache/cxf/bus/managers/DestinationFactoryManagerImpl.java
index c348253..57478c4 100644
--- a/core/src/main/java/org/apache/cxf/bus/managers/DestinationFactoryManagerImpl.java
+++ b/core/src/main/java/org/apache/cxf/bus/managers/DestinationFactoryManagerImpl.java
@@ -125,12 +125,10 @@ public final class DestinationFactoryManagerImpl implements DestinationFactoryMa
     }
 
     public DestinationFactory getDestinationFactoryForUri(String uri) {
-        DestinationFactory factory = new TransportFinder<DestinationFactory>(bus,
+        return new TransportFinder<DestinationFactory>(bus,
                 destinationFactories,
                 loaded,
                 DestinationFactory.class).findTransportForURI(uri);
-
-        return factory;
     }
 
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java b/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java
index d971c1a..bd6d85b 100644
--- a/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java
+++ b/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java
@@ -95,7 +95,7 @@ public class OASISCatalogManager {
             }
             catalogManager.setUseStaticCatalog(false);
             catalogManager.setIgnoreMissingProperties(true);
-            CatalogResolver catalogResolver = new CatalogResolver(catalogManager) {
+            return new CatalogResolver(catalogManager) {
                 public String getResolvedEntity(String publicId, String systemId) {
                     String s = super.getResolvedEntity(publicId, systemId);
                     if (s != null && s.startsWith("classpath:")) {
@@ -112,7 +112,6 @@ public class OASISCatalogManager {
                     return s;
                 }
             };
-            return catalogResolver;
         } catch (Throwable t) {
             //ignore
         }

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/core/src/main/java/org/apache/cxf/common/jaxb/SchemaCollectionContextProxy.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/common/jaxb/SchemaCollectionContextProxy.java b/core/src/main/java/org/apache/cxf/common/jaxb/SchemaCollectionContextProxy.java
index 4841cda..cdc3b14 100644
--- a/core/src/main/java/org/apache/cxf/common/jaxb/SchemaCollectionContextProxy.java
+++ b/core/src/main/java/org/apache/cxf/common/jaxb/SchemaCollectionContextProxy.java
@@ -175,7 +175,7 @@ public class SchemaCollectionContextProxy implements JAXBContextProxy {
         }
         final QName typeName = type == null ? null : type.getQName();
 
-        JAXBBeanInfo bi = new JAXBBeanInfo() {
+        return new JAXBBeanInfo() {
             public boolean isElement() {
                 return el == null ? false : true;
             }
@@ -189,7 +189,6 @@ public class SchemaCollectionContextProxy implements JAXBContextProxy {
                 return qname.getLocalPart();
             }
         };
-        return bi;
     }
 
     private QName getTypeQName(Class<?> cls, String namespace) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/core/src/main/java/org/apache/cxf/transport/MultipleEndpointObserver.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/transport/MultipleEndpointObserver.java b/core/src/main/java/org/apache/cxf/transport/MultipleEndpointObserver.java
index 30d41834..3a7d804 100644
--- a/core/src/main/java/org/apache/cxf/transport/MultipleEndpointObserver.java
+++ b/core/src/main/java/org/apache/cxf/transport/MultipleEndpointObserver.java
@@ -114,9 +114,7 @@ public class MultipleEndpointObserver implements MessageObserver {
     }
 
     protected PhaseInterceptorChain createChain() {
-        PhaseInterceptorChain chain = new PhaseInterceptorChain(bus.getExtension(PhaseManager.class)
-            .getInPhases());
-        return chain;
+        return new PhaseInterceptorChain(bus.getExtension(PhaseManager.class).getInPhases());
     }
 
     protected void setExchangeProperties(Exchange exchange, Message m) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/core/src/test/java/org/apache/cxf/common/injection/ResourceInjectorTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/cxf/common/injection/ResourceInjectorTest.java b/core/src/test/java/org/apache/cxf/common/injection/ResourceInjectorTest.java
index 9f87e84..c320a0a 100644
--- a/core/src/test/java/org/apache/cxf/common/injection/ResourceInjectorTest.java
+++ b/core/src/test/java/org/apache/cxf/common/injection/ResourceInjectorTest.java
@@ -154,10 +154,9 @@ public class ResourceInjectorTest extends Assert {
     }
 
     private Target getProxyObject() {
-        Target t = (Target)Proxy.newProxyInstance(ISetterTarget.class.getClassLoader(),
-                                                  new Class[] {ISetterTarget.class},
-                                                  new ProxyClass(new SetterTarget()));
-        return t;
+        return (Target)Proxy.newProxyInstance(ISetterTarget.class.getClassLoader(),
+                                              new Class[] {ISetterTarget.class},
+                                              new ProxyClass(new SetterTarget()));
     }
 
     private FieldTarget getEnhancedObject() {

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/integration/jca/src/main/java/org/apache/cxf/jca/servant/EJBEndpoint.java
----------------------------------------------------------------------
diff --git a/integration/jca/src/main/java/org/apache/cxf/jca/servant/EJBEndpoint.java b/integration/jca/src/main/java/org/apache/cxf/jca/servant/EJBEndpoint.java
index cb3494e..4a185dd 100644
--- a/integration/jca/src/main/java/org/apache/cxf/jca/servant/EJBEndpoint.java
+++ b/integration/jca/src/main/java/org/apache/cxf/jca/servant/EJBEndpoint.java
@@ -118,9 +118,7 @@ public class EJBEndpoint {
 
     public String getServiceClassName() throws Exception {
         String packageName = PackageUtils.parsePackageName(config.getServiceName().getNamespaceURI(), null);
-        String interfaceName = packageName + "."
-                               + config.getJNDIName().substring(0, config.getJNDIName().length() - 4);
-        return interfaceName;
+        return packageName + "." + config.getJNDIName().substring(0, config.getJNDIName().length() - 4);
     }
 
     public String getDefaultEJBServantBaseURL() throws Exception {

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index 5b04d9b..48efa1e 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -365,7 +365,7 @@
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-pmd-plugin</artifactId>
-                    <version>3.7</version>
+                    <version>3.8</version>
                     <dependencies>
                         <dependency>
                             <groupId>org.apache.cxf.build-utils</groupId>

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/CorbaStreamInInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/CorbaStreamInInterceptor.java b/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/CorbaStreamInInterceptor.java
index 96532cd..f5a24db 100644
--- a/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/CorbaStreamInInterceptor.java
+++ b/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/CorbaStreamInInterceptor.java
@@ -231,13 +231,10 @@ public class CorbaStreamInInterceptor extends AbstractPhaseInterceptor<Message>
 
         List<ParamType> paramTypes = opType.getParam();
         CorbaStreamable[] arguments = new CorbaStreamable[paramTypes.size()];
-        NVList list = prepareDIIArgsList(corbaMsg, bOpInfo,
-                                         arguments, paramTypes,
-                                         typeMap,
-                                         exg.get(ORB.class), service);
-
-        return list;
-
+        return prepareDIIArgsList(corbaMsg, bOpInfo,
+                                  arguments, paramTypes,
+                                  typeMap,
+                                  exg.get(ORB.class), service);
     }
 
     protected NVList prepareDIIArgsList(CorbaMessage corbaMsg,

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/jms/interceptor/SoapFaultFactory.java
----------------------------------------------------------------------
diff --git a/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/jms/interceptor/SoapFaultFactory.java b/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/jms/interceptor/SoapFaultFactory.java
index 1d8c774..757c0ea 100644
--- a/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/jms/interceptor/SoapFaultFactory.java
+++ b/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/jms/interceptor/SoapFaultFactory.java
@@ -55,9 +55,8 @@ public class SoapFaultFactory  {
     }
 
     Fault createSoap11Fault(JMSFault jmsFault) {
-        SoapFault fault = new SoapFault(jmsFault.getReason(),
-            jmsFault.getSubCode());
-        return fault;
+        return new SoapFault(jmsFault.getReason(),
+                             jmsFault.getSubCode());
     }
 
     Fault createSoap12Fault(JMSFault jmsFault) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapPreProtocolOutInterceptorTest.java
----------------------------------------------------------------------
diff --git a/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapPreProtocolOutInterceptorTest.java b/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapPreProtocolOutInterceptorTest.java
index 77e9762..fe9937e 100755
--- a/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapPreProtocolOutInterceptorTest.java
+++ b/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapPreProtocolOutInterceptorTest.java
@@ -102,9 +102,7 @@ public class SoapPreProtocolOutInterceptorTest extends Assert {
         opInfo.setInput(opreq, opInfo.createMessage(new QName(nsuri, opreq), Type.INPUT));
         opInfo.setOutput(opresp, opInfo.createMessage(new QName(nsuri, opresp), Type.INPUT));
 
-        BindingOperationInfo bindingOpInfo = new BindingOperationInfo(null, opInfo);
-
-        return bindingOpInfo;
+        return new BindingOperationInfo(null, opInfo);
     }
 
     private interface SEI {

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/Java5TypeCreator.java
----------------------------------------------------------------------
diff --git a/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/Java5TypeCreator.java b/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/Java5TypeCreator.java
index e49431f..3c74b87 100644
--- a/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/Java5TypeCreator.java
+++ b/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/java5/Java5TypeCreator.java
@@ -204,9 +204,7 @@ public class Java5TypeCreator extends AbstractTypeCreator {
         info.setDescription(clazz.toString());
         info.setType(paramType, paramType instanceof ParameterizedType ? pm : null);
 
-        AegisType type = createTypeForClass(info);
-
-        return type;
+        return createTypeForClass(info);
     }
 
     protected Type getComponentType(Type genericType, int index) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/ComplexService.java
----------------------------------------------------------------------
diff --git a/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/ComplexService.java b/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/ComplexService.java
index 1e67cd8..5339c5e 100644
--- a/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/ComplexService.java
+++ b/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/services/ComplexService.java
@@ -22,9 +22,7 @@ import org.apache.cxf.aegis.services.ns1.Complex1;
 
 public class ComplexService {
     public Complex1 getComplex1() {
-        Complex1 c1 = new Complex1();
-
-        return c1;
+        return new Complex1();
     }
 
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/features/clustering/src/main/java/org/apache/cxf/clustering/FailoverTargetSelector.java
----------------------------------------------------------------------
diff --git a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/FailoverTargetSelector.java b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/FailoverTargetSelector.java
index 7ab8b6f..d468ae1 100644
--- a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/FailoverTargetSelector.java
+++ b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/FailoverTargetSelector.java
@@ -302,10 +302,9 @@ public class FailoverTargetSelector extends AbstractConduitSelector {
 
     private Exception getExceptionIfPresent(Exchange exchange) {
         Message outMessage = exchange.getOutMessage();
-        Exception ex = outMessage.get(Exception.class) != null
-                       ? outMessage.get(Exception.class)
-                       : exchange.get(Exception.class);
-        return ex;
+        return outMessage.get(Exception.class) != null
+            ? outMessage.get(Exception.class)
+                : exchange.get(Exception.class);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
index a038422..ff82da4 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
@@ -440,11 +440,10 @@ public final class InjectionUtils {
         }
         if (pClass.isPrimitive()) {
             try {
-                T ret = (T)PrimitiveUtils.read(value, pClass);
                 // cannot us pClass.cast as the pClass is something like
                 // Boolean.TYPE (representing the boolean primitive) and
                 // the object is a Boolean object
-                return ret;
+                return (T)PrimitiveUtils.read(value, pClass);
             } catch (NumberFormatException nfe) {
                 throw createParamConversionException(pType, nfe);
             }

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/HandlerResolverImpl.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/HandlerResolverImpl.java b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/HandlerResolverImpl.java
index 94cba80..6052f08 100644
--- a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/HandlerResolverImpl.java
+++ b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/HandlerResolverImpl.java
@@ -85,11 +85,10 @@ public class HandlerResolverImpl implements HandlerResolver {
     private List<Handler> getHandlersFromAnnotation(Class<?> clazz, PortInfo portInfo) {
         AnnotationHandlerChainBuilder builder = new AnnotationHandlerChainBuilder();
 
-        List<Handler> chain = builder.buildHandlerChainFromClass(clazz,
+        return builder.buildHandlerChainFromClass(clazz,
             portInfo != null ? portInfo.getPortName() : null,
             portInfo != null ? portInfo.getServiceName() : null,
             portInfo != null ? portInfo.getBindingID() : null);
-        return chain;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerFaultInInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerFaultInInterceptor.java b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerFaultInInterceptor.java
index a18029d..497e4ca 100644
--- a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerFaultInInterceptor.java
+++ b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerFaultInInterceptor.java
@@ -52,9 +52,8 @@ public class SOAPHandlerFaultInInterceptor extends
     }
 
     public Set<URI> getRoles() {
-        Set<URI> roles = new HashSet<>();
         // TODO
-        return roles;
+        return new HashSet<>();
     }
 
     public Set<QName> getUnderstoodHeaders() {

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerFaultOutInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerFaultOutInterceptor.java b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerFaultOutInterceptor.java
index f309da2..872fe59 100644
--- a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerFaultOutInterceptor.java
+++ b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerFaultOutInterceptor.java
@@ -67,9 +67,8 @@ public class SOAPHandlerFaultOutInterceptor extends
     }
 
     public Set<URI> getRoles() {
-        Set<URI> roles = new HashSet<>();
         // TODO
-        return roles;
+        return new HashSet<>();
     }
 
     public Set<QName> getUnderstoodHeaders() {

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java
index b0143cd..2122eff 100644
--- a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java
+++ b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java
@@ -87,9 +87,8 @@ public class SOAPHandlerInterceptor extends
     }
 
     public Set<URI> getRoles() {
-        Set<URI> roles = new HashSet<>();
         //TODO
-        return roles;
+        return new HashSet<>();
     }
 
     public Set<QName> getUnderstoodHeaders() {

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spi/ProviderImpl.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spi/ProviderImpl.java b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spi/ProviderImpl.java
index 502a0f9..4223d37 100644
--- a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spi/ProviderImpl.java
+++ b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spi/ProviderImpl.java
@@ -204,10 +204,7 @@ public class ProviderImpl extends javax.xml.ws.spi.Provider {
                 JAXBContext context = JAXBContext
                     .newInstance(new Class[] {org.apache.cxf.ws.addressing.ObjectFactory.class});
                 um = context.createUnmarshaller();
-                EndpointReferenceType internal = um
-                    .unmarshal(reader, EndpointReferenceType.class)
-                    .getValue();
-                return internal;
+                return um.unmarshal(reader, EndpointReferenceType.class).getValue();
             } catch (JAXBException e) {
                 // TODO Auto-generated catch block
                 e.printStackTrace();

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/management/src/main/java/org/apache/cxf/management/jmx/InstrumentationManagerImpl.java
----------------------------------------------------------------------
diff --git a/rt/management/src/main/java/org/apache/cxf/management/jmx/InstrumentationManagerImpl.java b/rt/management/src/main/java/org/apache/cxf/management/jmx/InstrumentationManagerImpl.java
index 9156b2c..c7898c8 100644
--- a/rt/management/src/main/java/org/apache/cxf/management/jmx/InstrumentationManagerImpl.java
+++ b/rt/management/src/main/java/org/apache/cxf/management/jmx/InstrumentationManagerImpl.java
@@ -237,15 +237,12 @@ public class InstrumentationManagerImpl extends JMXConnectorPolicyType
     }
 
     public ObjectName register(ManagedComponent i) throws JMException {
-        ObjectName name = register(i, false);
-
-        return name;
+        return register(i, false);
     }
 
     public ObjectName register(ManagedComponent i, boolean forceRegistration) throws JMException {
         ObjectName name = i.getObjectName();
         register(i, name, forceRegistration);
-
         return name;
     }
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/utils/JSONUtils.java
----------------------------------------------------------------------
diff --git a/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/utils/JSONUtils.java b/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/utils/JSONUtils.java
index a84962b..7f76d0b 100644
--- a/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/utils/JSONUtils.java
+++ b/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/utils/JSONUtils.java
@@ -94,10 +94,9 @@ public final class JSONUtils {
                 xsw.serializeAsArray(key);
             }
         }
-        XMLStreamWriter writer = !writeXsiType || dropRootElement
+        return !writeXsiType || dropRootElement
             ? new IgnoreContentJettisonWriter(xsw, writeXsiType, dropRootElement) : xsw;
 
-        return writer;
     }
 
     public static Configuration createConfiguration(ConcurrentHashMap<String, String> namespaceMap,

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/dom4j/DOM4JProviderTest.java
----------------------------------------------------------------------
diff --git a/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/dom4j/DOM4JProviderTest.java b/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/dom4j/DOM4JProviderTest.java
index a31bb80..b69c5c1 100644
--- a/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/dom4j/DOM4JProviderTest.java
+++ b/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/dom4j/DOM4JProviderTest.java
@@ -71,19 +71,17 @@ public class DOM4JProviderTest extends Assert {
                                                  new ByteArrayInputStream(strBytes));
         DOM4JProvider p = new DOM4JProvider();
         p.setProviders(new ProvidersImpl(createMessage(false)));
-        org.dom4j.Document dom = p.readFrom(org.dom4j.Document.class, org.dom4j.Document.class,
+        return p.readFrom(org.dom4j.Document.class, org.dom4j.Document.class,
             new Annotation[] {}, MediaType.valueOf("text/xml;a=b"),
             new MetadataMap<String, String>(),
             is);
-        return dom;
     }
     private org.dom4j.Document readXML(MediaType ct, final String xml) throws Exception {
         DOM4JProvider p = new DOM4JProvider();
         p.setProviders(new ProvidersImpl(createMessage(false)));
-        org.dom4j.Document dom = p.readFrom(org.dom4j.Document.class, org.dom4j.Document.class,
+        return p.readFrom(org.dom4j.Document.class, org.dom4j.Document.class,
             new Annotation[] {}, ct, new MetadataMap<String, String>(),
             new ByteArrayInputStream(xml.getBytes(StandardCharsets.UTF_8)));
-        return dom;
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/hbase/HBaseQueryVisitor.java
----------------------------------------------------------------------
diff --git a/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/hbase/HBaseQueryVisitor.java b/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/hbase/HBaseQueryVisitor.java
index d11fa83..0bc0d29 100644
--- a/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/hbase/HBaseQueryVisitor.java
+++ b/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/hbase/HBaseQueryVisitor.java
@@ -120,11 +120,10 @@ public class HBaseQueryVisitor<T> extends AbstractSearchConditionVisitor<T, Filt
             ? new RegexStringComparator(value.toString().replace("*", "."))
             : new BinaryComparator(value.toString().getBytes(StandardCharsets.UTF_8));
 
-        Filter query = new SingleColumnValueFilter(theFamily.getBytes(StandardCharsets.UTF_8),
-                                                   qualifier.getBytes(StandardCharsets.UTF_8),
-                                                   compareOp,
-                                                   byteArrayComparable);
-        return query;
+        return new SingleColumnValueFilter(theFamily.getBytes(StandardCharsets.UTF_8),
+                                           qualifier.getBytes(StandardCharsets.UTF_8),
+                                           compareOp,
+                                           byteArrayComparable);
     }
 
     private Filter createCompositeQuery(List<Filter> queries, boolean orCondition) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/jpa/AbstractJPATypedQueryVisitor.java
----------------------------------------------------------------------
diff --git a/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/jpa/AbstractJPATypedQueryVisitor.java b/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/jpa/AbstractJPATypedQueryVisitor.java
index c87bd2d..3ca8393 100644
--- a/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/jpa/AbstractJPATypedQueryVisitor.java
+++ b/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/jpa/AbstractJPATypedQueryVisitor.java
@@ -178,11 +178,9 @@ public abstract class AbstractJPATypedQueryVisitor<T, T1, E>
         CollectionCheckInfo collInfo = cv.getCollectionCheckInfo();
         Path<?> path = getPath(root, name, cv, collInfo);
 
-        Predicate pred = collInfo == null
+        return collInfo == null
             ? doBuildPredicate(ps.getCondition(), path, cv.getCls(), cv.getValue())
             : doBuildCollectionPredicate(ps.getCondition(), path, collInfo);
-
-        return pred;
     }
 
     @SuppressWarnings({ "unchecked", "rawtypes" })

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/rs/extensions/search/src/test/java/org/apache/cxf/jaxrs/ext/search/SearchContextImplCustomParserTest.java
----------------------------------------------------------------------
diff --git a/rt/rs/extensions/search/src/test/java/org/apache/cxf/jaxrs/ext/search/SearchContextImplCustomParserTest.java b/rt/rs/extensions/search/src/test/java/org/apache/cxf/jaxrs/ext/search/SearchContextImplCustomParserTest.java
index 3c62202..a0e6f2a 100644
--- a/rt/rs/extensions/search/src/test/java/org/apache/cxf/jaxrs/ext/search/SearchContextImplCustomParserTest.java
+++ b/rt/rs/extensions/search/src/test/java/org/apache/cxf/jaxrs/ext/search/SearchContextImplCustomParserTest.java
@@ -46,12 +46,11 @@ public class SearchContextImplCustomParserTest extends Assert {
                 throw new SearchParseException();
             }
             String value = searchExpression.substring(9);
-            SearchCondition<Color> color = new PrimitiveSearchCondition<Color>("color",
-                                               value,
-                                               ConditionType.EQUALS,
-                                               new Color(value));
+            return new PrimitiveSearchCondition<Color>("color",
+                                                        value,
+                                                        ConditionType.EQUALS,
+                                                        new Color(value));
 
-            return color;
         }
 
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweJsonConsumer.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweJsonConsumer.java b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweJsonConsumer.java
index 5178a19..4b71f8d 100644
--- a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweJsonConsumer.java
+++ b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweJsonConsumer.java
@@ -75,14 +75,13 @@ public class JweJsonConsumer {
             LOG.warning("JWE JSON Entry union headers are not available");
             throw new JweException(JweException.Error.INVALID_JSON_JWE);
         }
-        JweDecryptionInput input = new JweDecryptionInput(entry.getEncryptedKey(),
-                                                          iv,
-                                                          cipherBytes,
-                                                          authTag,
-                                                          aad,
-                                                          protectedHeaderJson,
-                                                          unionHeaders);
-        return input;
+        return new JweDecryptionInput(entry.getEncryptedKey(),
+                                      iv,
+                                      cipherBytes,
+                                      authTag,
+                                      aad,
+                                      protectedHeaderJson,
+                                      unionHeaders);
     }
 
     public JweJsonEncryptionEntry getJweDecryptionEntry(JweDecryptionProvider jwe) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/JoseClientCodeStateManager.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/JoseClientCodeStateManager.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/JoseClientCodeStateManager.java
index 5bfc9e3..cd1df47 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/JoseClientCodeStateManager.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/client/JoseClientCodeStateManager.java
@@ -107,9 +107,9 @@ public class JoseClientCodeStateManager implements ClientCodeStateManager {
             throw new SecurityException();
         }
         String json = jws.getUnsignedEncodedSequence();
-        Map<String, List<String>> map = CastUtils.cast((Map<?, ?>)jsonp.fromJson(json));
         //CHECKSTYLE:OFF
-        return (MultivaluedMap<String, String>)map;
+        Map<String, List<String>> map = CastUtils.cast((Map<?, ?>)jsonp.fromJson(json));
+        return (MultivaluedMap<String, String>)map; //NOPMD
         //CHECKSTYLE:ON
     }
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/tokens/hawk/HawkAuthorizationScheme.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/tokens/hawk/HawkAuthorizationScheme.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/tokens/hawk/HawkAuthorizationScheme.java
index 94d455e..e724c71 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/tokens/hawk/HawkAuthorizationScheme.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/tokens/hawk/HawkAuthorizationScheme.java
@@ -99,7 +99,7 @@ public class HawkAuthorizationScheme {
         }
 
 
-        String value = HAWK_1_HEADER + SEPARATOR
+        return HAWK_1_HEADER + SEPARATOR
             + timestamp + SEPARATOR
             + nonce + SEPARATOR
             + props.getHttpMethod().toUpperCase() + SEPARATOR
@@ -108,8 +108,6 @@ public class HawkAuthorizationScheme {
             + props.getPort() + SEPARATOR
             + "" + SEPARATOR
             + "" + SEPARATOR;
-
-        return value;
     }
 
     private static String normalizeQuery(String query) {
@@ -119,9 +117,7 @@ public class HawkAuthorizationScheme {
     private static String generateNonce() {
         byte[] randomBytes = new byte[20];
         new SecureRandom().nextBytes(randomBytes);
-        String random = Base64Utility.encode(randomBytes);
-
-        return random;
+        return Base64Utility.encode(randomBytes);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/OidcDynamicRegistrationService.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/OidcDynamicRegistrationService.java b/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/OidcDynamicRegistrationService.java
index cffcfc2..388c92e 100644
--- a/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/OidcDynamicRegistrationService.java
+++ b/rt/rs/security/sso/oidc/src/main/java/org/apache/cxf/rs/security/oidc/idp/OidcDynamicRegistrationService.java
@@ -69,11 +69,9 @@ public class OidcDynamicRegistrationService extends DynamicRegistrationService {
     protected int getClientSecretSizeInBytes(ClientRegistration request) {
 
         // TODO: may need to be 384/8 or 512/8 if not a default HS256 but HS384 or HS512
-        int keySizeOctets = protectIdTokenWithClientSecret
+        return protectIdTokenWithClientSecret
             ? 32
             : super.getClientSecretSizeInBytes(request);
-
-        return keySizeOctets;
     }
     public void setProtectIdTokenWithClientSecret(boolean protectIdTokenWithClientSecret) {
         this.protectIdTokenWithClientSecret = protectIdTokenWithClientSecret;

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractRequestAssertionConsumerHandler.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractRequestAssertionConsumerHandler.java b/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractRequestAssertionConsumerHandler.java
index e9c0e16..fb452a1 100644
--- a/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractRequestAssertionConsumerHandler.java
+++ b/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractRequestAssertionConsumerHandler.java
@@ -195,13 +195,10 @@ public abstract class AbstractRequestAssertionConsumerHandler extends AbstractSS
                               expiresAt);
         getStateProvider().setResponseState(securityContextKey, responseState);
 
-        String contextCookie = createCookie(SSOConstants.SECURITY_CONTEXT_TOKEN,
-                                            securityContextKey,
-                                            requestState.getWebAppContext(),
-                                            requestState.getWebAppDomain());
-
-        return contextCookie;
-
+        return createCookie(SSOConstants.SECURITY_CONTEXT_TOKEN,
+                            securityContextKey,
+                            requestState.getWebAppContext(),
+                            requestState.getWebAppDomain());
     }
 
     protected RequestState processRelayState(String relayState) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/authorization/SecurityContextProviderImpl.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/authorization/SecurityContextProviderImpl.java b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/authorization/SecurityContextProviderImpl.java
index 48feebb..f80df06 100644
--- a/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/authorization/SecurityContextProviderImpl.java
+++ b/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/authorization/SecurityContextProviderImpl.java
@@ -91,9 +91,7 @@ public class SecurityContextProviderImpl implements SecurityContextProvider {
         Set<Principal> roles =
             SAMLUtils.parseRolesFromClaims(claims, roleName, nameFormat);
 
-        SAMLSecurityContext context =
-            new SAMLSecurityContext(subjectPrincipal, roles, claims);
-        return context;
+        return new SAMLSecurityContext(subjectPrincipal, roles, claims);
     }
 
     //TODO: This can be overridden, but consider also introducing dedicated handlers

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettySpringTypesFactory.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettySpringTypesFactory.java b/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettySpringTypesFactory.java
index 42cf337..a3f20c6 100644
--- a/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettySpringTypesFactory.java
+++ b/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettySpringTypesFactory.java
@@ -91,9 +91,7 @@ public final class JettySpringTypesFactory {
                                   new QName(JettyHTTPServerEngineFactoryBeanDefinitionParser.HTTP_JETTY_NS,
                                             "identifiedThreadingParameters"),
                                   ThreadingParametersIdentifiedType.class, ctx);
-        Map<String, ThreadingParameters> threadingParametersMap =
-            toThreadingParameters(threadingParametersIdentifiedTypes);
-        return threadingParametersMap;
+        return toThreadingParameters(threadingParametersIdentifiedTypes);
     }
 
     public Map<String, TLSServerParameters> createTLSServerParametersMap(String s,
@@ -108,9 +106,7 @@ public final class JettySpringTypesFactory {
                                             "identifiedTLSServerParameters"),
                                   TLSServerParametersIdentifiedType.class,
                                   ctx);
-        Map<String, TLSServerParameters> tlsServerParametersMap =
-            toTLSServerParamenters(tlsServerParameters);
-        return tlsServerParametersMap;
+        return toTLSServerParamenters(tlsServerParameters);
     }
 
     @SuppressWarnings("unchecked")

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/spring/NettySpringTypesFactory.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/spring/NettySpringTypesFactory.java b/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/spring/NettySpringTypesFactory.java
index 6444c9a..806f2df 100644
--- a/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/spring/NettySpringTypesFactory.java
+++ b/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/spring/NettySpringTypesFactory.java
@@ -95,9 +95,7 @@ public final class NettySpringTypesFactory {
                                             "identifiedTLSServerParameters"),
                                   TLSServerParametersIdentifiedType.class,
                                   ctx);
-        Map<String, TLSServerParameters> tlsServerParametersMap =
-            toTLSServerParamenters(tlsServerParameters);
-        return tlsServerParametersMap;
+        return toTLSServerParamenters(tlsServerParameters);
     }
 
     public Map<String, ThreadingParameters> createThreadingParametersMap(String s,
@@ -110,9 +108,7 @@ public final class NettySpringTypesFactory {
                                   new QName(NettyHttpServerEngineFactoryBeanDefinitionParser.HTTP_NETTY_SERVER_NS,
                                             "identifiedThreadingParameters"),
                                   ThreadingParametersIdentifiedType.class, ctx);
-        Map<String, ThreadingParameters> threadingParametersMap =
-            toThreadingParameters(threadingParametersIdentifiedTypes);
-        return threadingParametersMap;
+        return toThreadingParameters(threadingParametersIdentifiedTypes);
     }
 
     @SuppressWarnings("unchecked")

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/spring/UndertowSpringTypesFactory.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/spring/UndertowSpringTypesFactory.java b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/spring/UndertowSpringTypesFactory.java
index af78c57..3a7e1ff 100644
--- a/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/spring/UndertowSpringTypesFactory.java
+++ b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/spring/UndertowSpringTypesFactory.java
@@ -91,9 +91,7 @@ public final class UndertowSpringTypesFactory {
                                   new QName(UndertowHTTPServerEngineFactoryBeanDefinitionParser.HTTP_UNDERTOW_NS,
                                             "identifiedThreadingParameters"),
                                   ThreadingParametersIdentifiedType.class, ctx);
-        Map<String, ThreadingParameters> threadingParametersMap =
-            toThreadingParameters(threadingParametersIdentifiedTypes);
-        return threadingParametersMap;
+        return toThreadingParameters(threadingParametersIdentifiedTypes);
     }
 
     public Map<String, TLSServerParameters> createTLSServerParametersMap(String s,
@@ -108,9 +106,7 @@ public final class UndertowSpringTypesFactory {
                                             "identifiedTLSServerParameters"),
                                   TLSServerParametersIdentifiedType.class,
                                   ctx);
-        Map<String, TLSServerParameters> tlsServerParametersMap =
-            toTLSServerParamenters(tlsServerParameters);
-        return tlsServerParametersMap;
+        return toTLSServerParamenters(tlsServerParameters);
     }
 
     @SuppressWarnings("unchecked")

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Cookie.java
----------------------------------------------------------------------
diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Cookie.java b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Cookie.java
index c93271a..6c6e148 100644
--- a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Cookie.java
+++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Cookie.java
@@ -135,10 +135,9 @@ public class Cookie {
             return false;
         }
         Cookie c = (Cookie)o;
-        boolean result = this.name.equals(c.name)
+        return this.name.equals(c.name)
                 && ((this.path == null && c.path == null)
                         || (this.path != null && this.path.equals(c.path)));
-        return result;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFNonSpringServlet.java
----------------------------------------------------------------------
diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFNonSpringServlet.java b/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFNonSpringServlet.java
index 0d3e254..b8b5f02 100644
--- a/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFNonSpringServlet.java
+++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFNonSpringServlet.java
@@ -136,11 +136,9 @@ public class CXFNonSpringServlet extends AbstractHTTPServlet {
     protected ServletController createServletController(ServletConfig servletConfig) {
         HttpServlet serviceListGeneratorServlet =
             new ServiceListGeneratorServlet(destinationRegistry, bus);
-        ServletController newController =
-            new ServletController(destinationRegistry,
-                                  servletConfig,
-                                  serviceListGeneratorServlet);
-        return newController;
+        return new ServletController(destinationRegistry,
+                                     servletConfig,
+                                     serviceListGeneratorServlet);
     }
 
     public Bus getBus() {

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
----------------------------------------------------------------------
diff --git a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
index ec01a39..dc91253 100644
--- a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
+++ b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
@@ -386,9 +386,8 @@ public class JMSConfiguration {
             return null;
         }
         try {
-            ConnectionFactory cf = new JndiHelper(getJndiEnvironment()).
+            return new JndiHelper(getJndiEnvironment()).
                 lookup(getConnectionFactoryName(), ConnectionFactory.class);
-            return cf;
         } catch (NamingException e) {
             throw new RuntimeException(e);
         }

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/SecurityContextFactory.java
----------------------------------------------------------------------
diff --git a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/SecurityContextFactory.java b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/SecurityContextFactory.java
index d51ff3d..8efb055 100644
--- a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/SecurityContextFactory.java
+++ b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/SecurityContextFactory.java
@@ -58,7 +58,7 @@ public final class SecurityContextFactory {
     
         };
     
-        SecurityContext securityContext = new SecurityContext() {
+        return new SecurityContext() {
     
             public Principal getUserPrincipal() {
                 return principal;
@@ -69,7 +69,6 @@ public final class SecurityContextFactory {
             }
     
         };
-        return securityContext;
     }
 
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/ahc/AhcWebSocketConduit.java
----------------------------------------------------------------------
diff --git a/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/ahc/AhcWebSocketConduit.java b/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/ahc/AhcWebSocketConduit.java
index 2e12d5d..41d758f 100644
--- a/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/ahc/AhcWebSocketConduit.java
+++ b/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/ahc/AhcWebSocketConduit.java
@@ -100,10 +100,8 @@ public class AhcWebSocketConduit extends URLConnectionHTTPConduit {
     protected OutputStream createOutputStream(Message message, boolean needToCacheRequest,
                                               boolean isChunking, int chunkThreshold) throws IOException {
         AhcWebSocketConduitRequest entity = message.get(AhcWebSocketConduitRequest.class);
-        AhcWebSocketWrappedOutputStream out =
-            new AhcWebSocketWrappedOutputStream(message, needToCacheRequest, isChunking, chunkThreshold,
-                                                getConduitName(), entity.getUri());
-        return out;
+        return new AhcWebSocketWrappedOutputStream(message, needToCacheRequest, isChunking, chunkThreshold,
+                                                   getConduitName(), entity.getUri());
     }
 
     public class AhcWebSocketWrappedOutputStream extends WrappedOutputStream {

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/impl/MAPAggregatorTest.java
----------------------------------------------------------------------
diff --git a/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/impl/MAPAggregatorTest.java b/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/impl/MAPAggregatorTest.java
index 64a5323..07614db 100644
--- a/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/impl/MAPAggregatorTest.java
+++ b/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/impl/MAPAggregatorTest.java
@@ -890,9 +890,7 @@ public class MAPAggregatorTest extends Assert {
         FaultInfo finfo = opInfo.addFault(new QName(nsuri, opfault), new QName(nsuri, opfault));
         finfo.addMessagePart("fault");
 
-        BindingOperationInfo bindingOpInfo = new TestBindingOperationInfo(opInfo);
-
-        return bindingOpInfo;
+        return new TestBindingOperationInfo(opInfo);
     }
 
     private Message getMessage() {

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java
----------------------------------------------------------------------
diff --git a/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java b/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java
index a649c9b..e2fe423 100644
--- a/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java
+++ b/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java
@@ -79,12 +79,11 @@ public class PolicyEngineTest extends Assert {
     }
     private BindingOperationInfo createMockBindingOperationInfo() throws Exception {
         OperationInfo info = new OperationInfo();
-        BindingOperationInfo boi = new BindingOperationInfo(null, info) {
+        return new BindingOperationInfo(null, info) {
             public boolean isUnwrapped() {
                 return false;
             }
         };
-        return boi;
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/ManagedRMEndpoint.java
----------------------------------------------------------------------
diff --git a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/ManagedRMEndpoint.java b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/ManagedRMEndpoint.java
index 2ed0fda..140241a 100755
--- a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/ManagedRMEndpoint.java
+++ b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/ManagedRMEndpoint.java
@@ -625,9 +625,8 @@ public class ManagedRMEndpoint implements ManagedComponent {
                                     ss.getProtocol().getWSRMNamespace(),
                                     ss.getProtocol().getWSANamespace()};
 
-        CompositeData ssps = new CompositeDataSupport(sourceSequenceType,
-                                                      SOURCE_SEQUENCE_NAMES, ssv);
-        return ssps;
+        return new CompositeDataSupport(sourceSequenceType,
+                                        SOURCE_SEQUENCE_NAMES, ssv);
     }
 
     private CompositeData getDestinationSequenceProperties(DestinationSequence ds) throws JMException {
@@ -640,9 +639,8 @@ public class ManagedRMEndpoint implements ManagedComponent {
                                     ds.getProtocol().getWSRMNamespace(),
                                     ds.getProtocol().getWSANamespace()};
 
-        CompositeData dsps = new CompositeDataSupport(destinationSequenceType,
-                                                      DESTINATION_SEQUENCE_NAMES, dsv);
-        return dsps;
+        return new CompositeDataSupport(destinationSequenceType,
+                                        DESTINATION_SEQUENCE_NAMES, dsv);
     }
 
     private CompositeData getRetryStatusProperties(long num, RetryStatus rs) throws JMException {

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/SoapFaultFactory.java
----------------------------------------------------------------------
diff --git a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/SoapFaultFactory.java b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/SoapFaultFactory.java
index 870d4c7..f0adb0a 100644
--- a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/SoapFaultFactory.java
+++ b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/soap/SoapFaultFactory.java
@@ -69,9 +69,8 @@ public class SoapFaultFactory implements BindingFaultFactory {
     }
 
     Fault createSoap11Fault(SequenceFault sf) {
-        SoapFault fault = new SoapFault(sf.getReason(),
+        return new SoapFault(sf.getReason(),
             sf.isSender() ? version.getSender() : version.getReceiver());
-        return fault;
     }
 
     Fault createSoap12Fault(SequenceFault sf, Message msg) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
index 74227b4..471a885 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
@@ -155,9 +155,7 @@ public class WSS4JInInterceptor extends AbstractWSS4JInterceptor {
     }
     public final boolean isGET(SoapMessage message) {
         String method = (String)message.get(SoapMessage.HTTP_REQUEST_METHOD);
-        boolean isGet =
-            "GET".equals(method) && message.getContent(XMLStreamReader.class) == null;
-        return isGet;
+        return "GET".equals(method) && message.getContent(XMLStreamReader.class) == null;
     }
 
     public void handleMessage(SoapMessage msg) throws Fault {

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractStaxBindingHandler.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractStaxBindingHandler.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractStaxBindingHandler.java
index 04dc2a3..47bc21b 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractStaxBindingHandler.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractStaxBindingHandler.java
@@ -979,9 +979,7 @@ public abstract class AbstractStaxBindingHandler extends AbstractCommonBindingHa
         if (incomingEventList != null) {
             for (SecurityEvent incomingEvent : incomingEventList) {
                 if (event == incomingEvent.getSecurityEventType()) {
-                    org.apache.xml.security.stax.securityToken.SecurityToken token =
-                        ((TokenSecurityEvent<?>)incomingEvent).getSecurityToken();
-                    return token;
+                    return ((TokenSecurityEvent<?>)incomingEvent).getSecurityToken();
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyvalidators/X509TokenPolicyValidator.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyvalidators/X509TokenPolicyValidator.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyvalidators/X509TokenPolicyValidator.java
index 2d49801..d3e970a 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyvalidators/X509TokenPolicyValidator.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyvalidators/X509TokenPolicyValidator.java
@@ -206,11 +206,9 @@ public class X509TokenPolicyValidator extends AbstractSecurityPolicyValidator {
                         keyInfoElement, "SecurityTokenReference", WSConstants.WSSE_NS
                     );
                 if (strElement != null) {
-                    Element kiElement =
-                        XMLUtils.getDirectChildElement(
+                    return XMLUtils.getDirectChildElement(
                             strElement, "KeyIdentifier", WSConstants.WSSE_NS
                         );
-                    return kiElement;
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/SecurityActionTokenTest.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/SecurityActionTokenTest.java b/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/SecurityActionTokenTest.java
index 7b6d32f..c50cdf5 100644
--- a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/SecurityActionTokenTest.java
+++ b/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/SecurityActionTokenTest.java
@@ -128,9 +128,7 @@ public class SecurityActionTokenTest extends AbstractSecurityTest {
     }
 
     private List<WSHandlerResult> getResults(SoapMessage inmsg) {
-        final List<WSHandlerResult> handlerResults =
-            CastUtils.cast((List<?>)inmsg.get(WSHandlerConstants.RECV_RESULTS));
-        return handlerResults;
+        return CastUtils.cast((List<?>)inmsg.get(WSHandlerConstants.RECV_RESULTS));
     }
 
     // FOR DEBUGGING ONLY

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JInOutTest.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JInOutTest.java b/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JInOutTest.java
index b6f64c8..aeb34e2 100644
--- a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JInOutTest.java
+++ b/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/WSS4JInOutTest.java
@@ -480,9 +480,7 @@ public class WSS4JInOutTest extends AbstractSecurityTest {
     }
 
     private List<WSHandlerResult> getResults(SoapMessage inmsg) {
-        final List<WSHandlerResult> handlerResults =
-            CastUtils.cast((List<?>)inmsg.get(WSHandlerConstants.RECV_RESULTS));
-        return handlerResults;
+        return CastUtils.cast((List<?>)inmsg.get(WSHandlerConstants.RECV_RESULTS));
     }
 
     // FOR DEBUGGING ONLY

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java
index 991e07e..b38c9eb 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java
@@ -646,9 +646,7 @@ public abstract class AbstractOperation {
         if (incomingEventList != null) {
             for (SecurityEvent incomingEvent : incomingEventList) {
                 if (event == incomingEvent.getSecurityEventType()) {
-                    org.apache.xml.security.stax.securityToken.SecurityToken token =
-                        ((TokenSecurityEvent<?>)incomingEvent).getSecurityToken();
-                    return token;
+                    return ((TokenSecurityEvent<?>)incomingEvent).getSecurityToken();
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenIssueOperation.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenIssueOperation.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenIssueOperation.java
index 5e98bef..496cf94 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenIssueOperation.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenIssueOperation.java
@@ -428,8 +428,6 @@ public class TokenIssueOperation extends AbstractOperation implements IssueOpera
         String nonce = "http://docs.oasis-open.org/ws-sx/ws-trust/200512/Nonce";
         binarySecretType.setType(nonce);
         binarySecretType.setValue(secret);
-        JAXBElement<BinarySecretType> binarySecret =
-                QNameConstants.WS_TRUST_FACTORY.createBinarySecret(binarySecretType);
-        return binarySecret;
+        return QNameConstants.WS_TRUST_FACTORY.createBinarySecret(binarySecretType);
     }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultSubjectProvider.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultSubjectProvider.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultSubjectProvider.java
index 2e5c309..50172e1 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultSubjectProvider.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultSubjectProvider.java
@@ -266,9 +266,7 @@ public class DefaultSubjectProvider implements SubjectProvider {
                 }
                 Document doc = subjectProviderParameters.getDoc();
                 byte[] secret = subjectProviderParameters.getSecret();
-                KeyInfoBean keyInfo =
-                    createEncryptedKeyKeyInfo(certs[0], secret, doc, encryptionProperties, crypto);
-                return keyInfo;
+                return createEncryptedKeyKeyInfo(certs[0], secret, doc, encryptionProperties, crypto);
             } catch (WSSecurityException ex) {
                 LOG.log(Level.WARNING, "", ex);
                 throw new STSException(ex.getMessage(), ex);

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueJWTOnbehalfofUnitTest.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueJWTOnbehalfofUnitTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueJWTOnbehalfofUnitTest.java
index c51d917..19a46e9 100644
--- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueJWTOnbehalfofUnitTest.java
+++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueJWTOnbehalfofUnitTest.java
@@ -472,12 +472,9 @@ public class IssueJWTOnbehalfofUnitTest extends org.junit.Assert {
             usernameToken.getAny().add(passwordType);
         }
 
-        JAXBElement<UsernameTokenType> tokenType =
-            new JAXBElement<UsernameTokenType>(
+        return new JAXBElement<UsernameTokenType>(
                     QNameConstants.USERNAME_TOKEN, UsernameTokenType.class, usernameToken
             );
-
-        return tokenType;
     }
 
     private Map<String, RealmProperties> createSamlRealms() {

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueOnbehalfofUnitTest.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueOnbehalfofUnitTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueOnbehalfofUnitTest.java
index 4445be9..256dbb3 100644
--- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueOnbehalfofUnitTest.java
+++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/IssueOnbehalfofUnitTest.java
@@ -1294,12 +1294,9 @@ public class IssueOnbehalfofUnitTest extends org.junit.Assert {
             usernameToken.getAny().add(passwordType);
         }
 
-        JAXBElement<UsernameTokenType> tokenType =
-            new JAXBElement<UsernameTokenType>(
+        return new JAXBElement<UsernameTokenType>(
                     QNameConstants.USERNAME_TOKEN, UsernameTokenType.class, usernameToken
             );
-
-        return tokenType;
     }
 
     private Map<String, RealmProperties> createSamlRealms() {

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateTokenTransformationUnitTest.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateTokenTransformationUnitTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateTokenTransformationUnitTest.java
index 90d4011..0c145f8 100644
--- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateTokenTransformationUnitTest.java
+++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateTokenTransformationUnitTest.java
@@ -771,12 +771,9 @@ public class ValidateTokenTransformationUnitTest extends org.junit.Assert {
             );
         usernameToken.getAny().add(passwordType);
 
-        JAXBElement<UsernameTokenType> tokenType =
-            new JAXBElement<UsernameTokenType>(
+        return new JAXBElement<UsernameTokenType>(
                 QNameConstants.USERNAME_TOKEN, UsernameTokenType.class, usernameToken
             );
-
-        return tokenType;
     }
 
     /*
@@ -791,12 +788,9 @@ public class ValidateTokenTransformationUnitTest extends org.junit.Assert {
         claims.setDialect(STSConstants.IDT_NS_05_05);
         claims.getAny().add(claimType);
 
-        JAXBElement<ClaimsType> claimsType =
-            new JAXBElement<ClaimsType>(
+        return new JAXBElement<ClaimsType>(
                     QNameConstants.CLAIMS, ClaimsType.class, claims
             );
-
-        return claimsType;
     }
 
     /*

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateUnitTest.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateUnitTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateUnitTest.java
index 93d3b2b..97a6762 100644
--- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateUnitTest.java
+++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateUnitTest.java
@@ -302,11 +302,9 @@ public class ValidateUnitTest extends org.junit.Assert {
         binarySecurityToken.setValue("12345678");
         binarySecurityToken.setValueType(DummyTokenProvider.TOKEN_TYPE);
         binarySecurityToken.setEncodingType(DummyTokenProvider.BASE64_NS);
-        JAXBElement<BinarySecurityTokenType> tokenType =
-            new JAXBElement<BinarySecurityTokenType>(
+        return new JAXBElement<BinarySecurityTokenType>(
                 QNameConstants.BINARY_SECURITY_TOKEN, BinarySecurityTokenType.class, binarySecurityToken
             );
-        return tokenType;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateUsernameTokenUnitTest.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateUsernameTokenUnitTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateUsernameTokenUnitTest.java
index ebd18eb..918b369 100644
--- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateUsernameTokenUnitTest.java
+++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateUsernameTokenUnitTest.java
@@ -234,12 +234,10 @@ public class ValidateUsernameTokenUnitTest extends org.junit.Assert {
             );
         usernameToken.getAny().add(passwordType);
 
-        JAXBElement<UsernameTokenType> tokenType =
-            new JAXBElement<UsernameTokenType>(
+        return new JAXBElement<UsernameTokenType>(
                 QNameConstants.USERNAME_TOKEN, UsernameTokenType.class, usernameToken
             );
 
-        return tokenType;
     }
 
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateX509TokenUnitTest.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateX509TokenUnitTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateX509TokenUnitTest.java
index 0a8272c..44c49cb 100644
--- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateX509TokenUnitTest.java
+++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateX509TokenUnitTest.java
@@ -250,12 +250,9 @@ public class ValidateX509TokenUnitTest extends org.junit.Assert {
         binarySecurityToken.setValue(Base64.getMimeEncoder().encodeToString(cert.getEncoded()));
         binarySecurityToken.setValueType(X509TokenValidator.X509_V3_TYPE);
         binarySecurityToken.setEncodingType(WSConstants.SOAPMESSAGE_NS + "#Base64Binary");
-        JAXBElement<BinarySecurityTokenType> tokenType =
-            new JAXBElement<BinarySecurityTokenType>(
+        return new JAXBElement<BinarySecurityTokenType>(
                 QNameConstants.BINARY_SECURITY_TOKEN, BinarySecurityTokenType.class, binarySecurityToken
             );
-
-        return tokenType;
     }
 
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/CustomSubjectProvider.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/CustomSubjectProvider.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/CustomSubjectProvider.java
index 3e7ec16..e5f547a 100644
--- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/CustomSubjectProvider.java
+++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/token/provider/CustomSubjectProvider.java
@@ -48,10 +48,7 @@ public class CustomSubjectProvider implements SubjectProvider {
         String confirmationMethod = getSubjectConfirmationMethod(tokenType, keyType);
 
         Principal principal = providerParameters.getPrincipal();
-        SubjectBean subjectBean =
-            new SubjectBean(principal.getName(), subjectNameQualifier, confirmationMethod);
-
-        return subjectBean;
+        return new SubjectBean(principal.getName(), subjectNameQualifier, confirmationMethod);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/services/xkms/xkms-client/src/main/java/org/apache/cxf/xkms/client/XKMSInvoker.java
----------------------------------------------------------------------
diff --git a/services/xkms/xkms-client/src/main/java/org/apache/cxf/xkms/client/XKMSInvoker.java b/services/xkms/xkms-client/src/main/java/org/apache/cxf/xkms/client/XKMSInvoker.java
index a438a4d..6a4f44a 100644
--- a/services/xkms/xkms-client/src/main/java/org/apache/cxf/xkms/client/XKMSInvoker.java
+++ b/services/xkms/xkms-client/src/main/java/org/apache/cxf/xkms/client/XKMSInvoker.java
@@ -185,10 +185,9 @@ public class XKMSInvoker {
 
         try {
             CertificateFactory cf = CertificateFactory.getInstance("X.509");
-            X509Certificate cert = (X509Certificate)cf
+            return (X509Certificate)cf
                 .generateCertificate(new ByteArrayInputStream(certificate
                     .getValue()));
-            return cert;
         } catch (CertificateException e) {
             throw new XKMSLocateException(XKMS_LOCATE_INVALID_CERTIFICATE, e);
         }

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
index d71473b..ff7a84b 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
@@ -1586,18 +1586,14 @@ public class BookStore {
     @GET
     @Path("/cd/{CDId}/")
     public CD getCD() {
-        CD cd = cds.get(Long.parseLong(currentCdId));
-
-        return cd;
+        return cds.get(Long.parseLong(currentCdId));
     }
 
     @GET
     @Path("/cdwithmultitypes/{CDId}/")
     @Produces({"application/xml", "application/bar+xml", "application/json" })
     public CD getCDWithMultiContentTypes(@PathParam("CDId") String id) {
-        CD cd = cds.get(Long.parseLong(id));
-
-        return cd;
+        return cds.get(Long.parseLong(id));
     }
 
     @GET

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreSpring.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreSpring.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreSpring.java
index 1c21c15..4caa39e 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreSpring.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreSpring.java
@@ -199,9 +199,7 @@ public class BookStoreSpring {
     @Path("/books/superbook")
     @Produces("application/json")
     public <T extends Book> T getSuperBookJson() {
-        SuperBook book = new SuperBook("SuperBook", 999L, true);
-
-        return (T)book;
+        return (T)new SuperBook("SuperBook", 999L, true);
     }
 
     @SuppressWarnings("unchecked")

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/MultipartStore.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/MultipartStore.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/MultipartStore.java
index 203635c..35d39d0 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/MultipartStore.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/MultipartStore.java
@@ -67,20 +67,14 @@ public class MultipartStore {
     @Path("/content/string")
     @Produces("multipart/mixed")
     public Attachment getAttachmentWithStringContent() throws Exception {
-        Attachment respXMLPayloadAttachment = new Attachment("Response_XML_Payload",
-                                                             "application/xml",
-                                                             "<Book><id>888</id></Book>");
-        return respXMLPayloadAttachment;
+        return new Attachment("Response_XML_Payload", "application/xml", "<Book><id>888</id></Book>");
     }
 
     @GET
     @Path("/content/bytes")
     @Produces("multipart/mixed")
     public Attachment getAttachmentWithByteContent() throws Exception {
-        Attachment respXMLPayloadAttachment = new Attachment("Response_XML_Payload",
-                                                             "application/xml",
-                                                             "<Book><id>888</id></Book>".getBytes());
-        return respXMLPayloadAttachment;
+        return new Attachment("Response_XML_Payload", "application/xml", "<Book><id>888</id></Book>".getBytes());
     }
 
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/systests/tracing/src/test/java/org/apache/cxf/systest/jaxrs/tracing/brave/BraveTracingTest.java
----------------------------------------------------------------------
diff --git a/systests/tracing/src/test/java/org/apache/cxf/systest/jaxrs/tracing/brave/BraveTracingTest.java b/systests/tracing/src/test/java/org/apache/cxf/systest/jaxrs/tracing/brave/BraveTracingTest.java
index 3895e7c..b016be5 100644
--- a/systests/tracing/src/test/java/org/apache/cxf/systest/jaxrs/tracing/brave/BraveTracingTest.java
+++ b/systests/tracing/src/test/java/org/apache/cxf/systest/jaxrs/tracing/brave/BraveTracingTest.java
@@ -322,13 +322,12 @@ public class BraveTracingTest extends AbstractBusClientServerTestBase {
     }
 
     private SpanId fromRandom() {
-        final SpanId spanId = SpanId
+        return SpanId
             .builder()
             .traceId(random.nextLong())
             .parentId(random.nextLong())
             .spanId(random.nextLong())
             .sampled(true)
             .build();
-        return spanId;
     }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/d49f3f24/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/util/JMSTestUtil.java
----------------------------------------------------------------------
diff --git a/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/util/JMSTestUtil.java b/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/util/JMSTestUtil.java
index 0b4765d..bf7aedf 100644
--- a/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/util/JMSTestUtil.java
+++ b/systests/transport-jms/src/test/java/org/apache/cxf/jms/testsuite/util/JMSTestUtil.java
@@ -50,11 +50,10 @@ public final class JMSTestUtil {
 
     public static String getFullAddress(String partAddress, String jndiUrl) {
         String separator = partAddress.contains("?") ? "&" : "?";
-        String address = partAddress + separator
+        return partAddress + separator
             + "&jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory"
             + "&jndiConnectionFactoryName=ConnectionFactory"
             + "&jndiURL=" + jndiUrl;
-        return address;
     }
 
     public static List<TestCaseType> getTestCases() {


Mime
View raw message