cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [2/8] cxf git commit: Bunch more warning fixes
Date Tue, 08 Aug 2017 21:13:51 GMT
http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenRequestCollectionOperation.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenRequestCollectionOperation.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenRequestCollectionOperation.java
index 8c8c104..5c9e3db 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenRequestCollectionOperation.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenRequestCollectionOperation.java
@@ -90,9 +90,8 @@ public class TokenRequestCollectionOperation extends AbstractOperation
                             throw new STSException(
                                 "Error in requesting a token", STSException.REQUEST_FAILED
                             );
-                        } else {
-                            requestType = val;
                         }
+                        requestType = val;
                     }
                 }
             }

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java
index b53c95f..256b8e3 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/request/RequestParser.java
@@ -373,19 +373,18 @@ public class RequestParser {
                 Element element = (Element)useKey.getAny();
                 if ("KeyInfo".equals(element.getLocalName())) {
                     return parseKeyInfoElement((Element)useKey.getAny());
-                } else {
-                    NodeList x509CertData =
-                        element.getElementsByTagNameNS(
-                            Constants.SignatureSpecNS, Constants._TAG_X509CERTIFICATE
-                        );
-                    if (x509CertData != null && x509CertData.getLength() > 0) {
-                        try {
-                            x509 = Base64Utility.decode(x509CertData.item(0).getTextContent().trim());
-                            LOG.fine("Found X509Certificate UseKey type");
-                        } catch (Exception e) {
-                            LOG.log(Level.WARNING, "", e);
-                            throw new STSException(e.getMessage(), e, STSException.INVALID_REQUEST);
-                        }
+                }
+                NodeList x509CertData =
+                    element.getElementsByTagNameNS(
+                        Constants.SignatureSpecNS, Constants._TAG_X509CERTIFICATE
+                    );
+                if (x509CertData != null && x509CertData.getLength() > 0) {
+                    try {
+                        x509 = Base64Utility.decode(x509CertData.item(0).getTextContent().trim());
+                        LOG.fine("Found X509Certificate UseKey type");
+                    } catch (Exception e) {
+                        LOG.log(Level.WARNING, "", e);
+                        throw new STSException(e.getMessage(), e, STSException.INVALID_REQUEST);
                     }
                 }
             }

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/services/sts/sts-core/src/main/java/org/apache/cxf/sts/rest/RESTSecurityTokenServiceImpl.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/rest/RESTSecurityTokenServiceImpl.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/rest/RESTSecurityTokenServiceImpl.java
index 627f5f9..00672ee 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/rest/RESTSecurityTokenServiceImpl.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/rest/RESTSecurityTokenServiceImpl.java
@@ -157,16 +157,15 @@ public class RESTSecurityTokenServiceImpl extends SecurityTokenServiceImpl imple
         if ("jwt".equals(tokenType)) {
             // Discard the wrapper here
             return Response.ok(((Element)requestedToken.getAny()).getTextContent()).build();
-        } else {
-            // Base-64 encode the token + return it
-            try {
-                String encodedToken =
-                    encodeToken(DOM2Writer.nodeToString((Element)requestedToken.getAny()));
-                return Response.ok(encodedToken).build();
-            } catch (Exception ex) {
-                LOG.warning(ex.getMessage());
-                return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
-            }
+        }
+        // Base-64 encode the token + return it
+        try {
+            String encodedToken =
+                encodeToken(DOM2Writer.nodeToString((Element)requestedToken.getAny()));
+            return Response.ok(encodedToken).build();
+        } catch (Exception ex) {
+            LOG.warning(ex.getMessage());
+            return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
         }
     }
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultConditionsProvider.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultConditionsProvider.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultConditionsProvider.java
index e6ec9d1..135f53f 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultConditionsProvider.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/DefaultConditionsProvider.java
@@ -176,9 +176,8 @@ public class DefaultConditionsProvider implements ConditionsProvider {
                     if (isFailLifetimeExceedance()) {
                         throw new STSException("Requested lifetime exceeds maximum lifetime",
                                                STSException.INVALID_TIME);
-                    } else {
-                        expirationTime = creationTime.plusSeconds(getMaxLifetime());
                     }
+                    expirationTime = creationTime.plusSeconds(getMaxLifetime());
                 }
 
                 conditions.setNotAfter(expirationTime);

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/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 50172e1..db6aca2 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
@@ -207,17 +207,14 @@ public class DefaultSubjectProvider implements SubjectProvider {
             if (STSConstants.SYMMETRIC_KEY_KEYTYPE.equals(keyType)
                 || STSConstants.PUBLIC_KEY_KEYTYPE.equals(keyType)) {
                 return SAML1Constants.CONF_HOLDER_KEY;
-            } else {
-                return SAML1Constants.CONF_BEARER;
-            }
-        } else {
-            if (STSConstants.SYMMETRIC_KEY_KEYTYPE.equals(keyType)
-                || STSConstants.PUBLIC_KEY_KEYTYPE.equals(keyType)) {
-                return SAML2Constants.CONF_HOLDER_KEY;
-            } else {
-                return SAML2Constants.CONF_BEARER;
             }
+            return SAML1Constants.CONF_BEARER;
+        }
+        if (STSConstants.SYMMETRIC_KEY_KEYTYPE.equals(keyType)
+            || STSConstants.PUBLIC_KEY_KEYTYPE.equals(keyType)) {
+            return SAML2Constants.CONF_HOLDER_KEY;
         }
+        return SAML2Constants.CONF_BEARER;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/jwt/DefaultJWTClaimsProvider.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/jwt/DefaultJWTClaimsProvider.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/jwt/DefaultJWTClaimsProvider.java
index 09fa265..3b87205 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/jwt/DefaultJWTClaimsProvider.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/jwt/DefaultJWTClaimsProvider.java
@@ -214,9 +214,8 @@ public class DefaultJWTClaimsProvider implements JWTClaimsProvider {
                 if (isFailLifetimeExceedance()) {
                     throw new STSException("Requested lifetime exceeds maximum lifetime",
                                            STSException.INVALID_TIME);
-                } else {
-                    expirationTime = creationTime.plusSeconds(getMaxLifetime());
                 }
+                expirationTime = creationTime.plusSeconds(getMaxLifetime());
             }
 
             long creationTimeInSeconds = creationTime.getEpochSecond();

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/jwt/JWTTokenProvider.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/jwt/JWTTokenProvider.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/jwt/JWTTokenProvider.java
index 9119a0c..c3d1ac8 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/jwt/JWTTokenProvider.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/jwt/JWTTokenProvider.java
@@ -277,11 +277,10 @@ public class JWTTokenProvider implements TokenProvider {
                 JwsUtils.loadSignatureProvider(signingProperties, jwsHeaders);
 
             return jws.signWith(sigProvider);
-        } else {
-            JwsHeaders jwsHeaders = new JwsHeaders(SignatureAlgorithm.NONE);
-            JwsJwtCompactProducer jws = new JwsJwtCompactProducer(jwsHeaders, claims);
-            return jws.getSignedEncodedJws();
         }
+        JwsHeaders jwsHeaders = new JwsHeaders(SignatureAlgorithm.NONE);
+        JwsJwtCompactProducer jws = new JwsJwtCompactProducer(jwsHeaders, claims);
+        return jws.getSignedEncodedJws();
 
     }
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewer.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewer.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewer.java
index 8ce30e4..3c8f5aa 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewer.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewer.java
@@ -500,13 +500,12 @@ public class SAMLTokenRenewer extends AbstractSAMLTokenProvider implements Token
             saml1Assertion.setID(IDGenerator.generateID("_"));
 
             return oldId;
-        } else {
-            org.opensaml.saml.saml2.core.Assertion saml2Assertion = assertion.getSaml2();
-            String oldId = saml2Assertion.getID();
-            saml2Assertion.setID(IDGenerator.generateID("_"));
-
-            return oldId;
         }
+        org.opensaml.saml.saml2.core.Assertion saml2Assertion = assertion.getSaml2();
+        String oldId = saml2Assertion.getID();
+        saml2Assertion.setID(IDGenerator.generateID("_"));
+
+        return oldId;
     }
 
     private void storeTokenInCache(
@@ -532,9 +531,8 @@ public class SAMLTokenRenewer extends AbstractSAMLTokenProvider implements Token
     private DateTime getExpiryDate(SamlAssertionWrapper assertion) {
         if (assertion.getSamlVersion().equals(SAMLVersion.VERSION_20)) {
             return assertion.getSaml2().getConditions().getNotOnOrAfter();
-        } else {
-            return assertion.getSaml1().getConditions().getNotOnOrAfter();
         }
+        return assertion.getSaml1().getConditions().getNotOnOrAfter();
     }
 
     private static class ProofOfPossessionValidator {

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/DefaultSubjectRoleParser.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/DefaultSubjectRoleParser.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/DefaultSubjectRoleParser.java
index e2d446b..68c8f5a 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/DefaultSubjectRoleParser.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/DefaultSubjectRoleParser.java
@@ -47,9 +47,8 @@ public class DefaultSubjectRoleParser implements SubjectRoleParser {
                 RolePrefixSecurityContextImpl securityContext =
                     new RolePrefixSecurityContextImpl(subject, roleClassifier, roleClassifierType);
                 return securityContext.getUserRoles();
-            } else {
-                return new DefaultSecurityContext(principal, subject).getUserRoles();
             }
+            return new DefaultSecurityContext(principal, subject).getUserRoles();
         }
 
         return Collections.emptySet();

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/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 e5f547a..1855ccb 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
@@ -60,17 +60,18 @@ public class CustomSubjectProvider implements SubjectProvider {
             if (STSConstants.SYMMETRIC_KEY_KEYTYPE.equals(keyType)
                 || STSConstants.PUBLIC_KEY_KEYTYPE.equals(keyType)) {
                 return SAML2Constants.CONF_HOLDER_KEY;
-            } else {
-                return SAML2Constants.CONF_BEARER;
-            }
-        } else {
-            if (STSConstants.SYMMETRIC_KEY_KEYTYPE.equals(keyType)
-                || STSConstants.PUBLIC_KEY_KEYTYPE.equals(keyType)) {
-                return SAML1Constants.CONF_HOLDER_KEY;
-            } else {
-                return SAML1Constants.CONF_BEARER;
             }
+            return SAML2Constants.CONF_BEARER;
+        }
+        return extracted(keyType);
+    }
+
+    private String extracted(String keyType) {
+        if (STSConstants.SYMMETRIC_KEY_KEYTYPE.equals(keyType)
+            || STSConstants.PUBLIC_KEY_KEYTYPE.equals(keyType)) {
+            return SAML1Constants.CONF_HOLDER_KEY;
         }
+        return SAML1Constants.CONF_BEARER;
     }
 
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/batch/SimpleBatchSTSClient.java
----------------------------------------------------------------------
diff --git a/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/batch/SimpleBatchSTSClient.java b/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/batch/SimpleBatchSTSClient.java
index d4da6a8..dc0527c 100644
--- a/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/batch/SimpleBatchSTSClient.java
+++ b/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/batch/SimpleBatchSTSClient.java
@@ -454,11 +454,10 @@ public class SimpleBatchSTSClient implements Configurable, InterceptorProvider {
                 && VersionTransformer.isSupported(el.getNamespaceURI())
                 && "MetadataReference".equals(ref.getLocalName())) {
                 return DOMUtils.getContent(el);
-            } else {
-                String ad = findMEXLocation(el);
-                if (ad != null) {
-                    return ad;
-                }
+            }
+            String ad = findMEXLocation(el);
+            if (ad != null) {
+                return ad;
             }
             el = DOMUtils.getNextElement(el);
         }
@@ -963,25 +962,24 @@ public class SimpleBatchSTSClient implements Configurable, InterceptorProvider {
                 throw new WSSecurityException(WSSecurityException.ErrorCode.INVALID_SECURITY, "noCipher");
             }
             return cipherValue;
-        } else {
-            try {
-                EncryptedKeyProcessor proc = new EncryptedKeyProcessor();
-                RequestData data = new RequestData();
-                data.setWssConfig(WSSConfig.getNewInstance());
-                data.setDecCrypto(createCrypto(true));
-                data.setCallbackHandler(createHandler());
-
-                WSDocInfo docInfo = new WSDocInfo(child.getOwnerDocument());
-                data.setWsDocInfo(docInfo);
-
-                List<WSSecurityEngineResult> result = proc.handleToken(child, data);
-                return
-                    (byte[])result.get(0).get(
-                        WSSecurityEngineResult.TAG_SECRET
-                    );
-            } catch (IOException e) {
-                throw new TrustException("ENCRYPTED_KEY_ERROR", e, LOG);
-            }
+        }
+        try {
+            EncryptedKeyProcessor proc = new EncryptedKeyProcessor();
+            RequestData data = new RequestData();
+            data.setWssConfig(WSSConfig.getNewInstance());
+            data.setDecCrypto(createCrypto(true));
+            data.setCallbackHandler(createHandler());
+
+            WSDocInfo docInfo = new WSDocInfo(child.getOwnerDocument());
+            data.setWsDocInfo(docInfo);
+
+            List<WSSecurityEngineResult> result = proc.handleToken(child, data);
+            return
+                (byte[])result.get(0).get(
+                    WSSecurityEngineResult.TAG_SECRET
+                );
+        } catch (IOException e) {
+            throw new TrustException("ENCRYPTED_KEY_ERROR", e, LOG);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/sts_sender_vouches/SVSubjectProvider.java
----------------------------------------------------------------------
diff --git a/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/sts_sender_vouches/SVSubjectProvider.java b/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/sts_sender_vouches/SVSubjectProvider.java
index 7516a42..eaab64d 100644
--- a/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/sts_sender_vouches/SVSubjectProvider.java
+++ b/services/sts/systests/advanced/src/test/java/org/apache/cxf/systest/sts/sts_sender_vouches/SVSubjectProvider.java
@@ -38,17 +38,18 @@ public class SVSubjectProvider extends DefaultSubjectProvider {
             if (STSConstants.SYMMETRIC_KEY_KEYTYPE.equals(keyType)
                 || STSConstants.PUBLIC_KEY_KEYTYPE.equals(keyType)) {
                 return SAML2Constants.CONF_SENDER_VOUCHES;
-            } else {
-                return SAML2Constants.CONF_BEARER;
-            }
-        } else {
-            if (STSConstants.SYMMETRIC_KEY_KEYTYPE.equals(keyType)
-                || STSConstants.PUBLIC_KEY_KEYTYPE.equals(keyType)) {
-                return SAML1Constants.CONF_SENDER_VOUCHES;
-            } else {
-                return SAML1Constants.CONF_BEARER;
             }
+            return SAML2Constants.CONF_BEARER;
+        }
+        return extracted(keyType);
+    }
+
+    private String extracted(String keyType) {
+        if (STSConstants.SYMMETRIC_KEY_KEYTYPE.equals(keyType)
+            || STSConstants.PUBLIC_KEY_KEYTYPE.equals(keyType)) {
+            return SAML1Constants.CONF_SENDER_VOUCHES;
         }
+        return SAML1Constants.CONF_BEARER;
     }
 
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/internal/WSDiscoveryServiceImpl.java
----------------------------------------------------------------------
diff --git a/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/internal/WSDiscoveryServiceImpl.java b/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/internal/WSDiscoveryServiceImpl.java
index 061f757..2f944a9 100644
--- a/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/internal/WSDiscoveryServiceImpl.java
+++ b/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/internal/WSDiscoveryServiceImpl.java
@@ -262,9 +262,8 @@ public class WSDiscoveryServiceImpl implements WSDiscoveryService {
             } catch (RuntimeException ex) {
                 if (!optional) {
                     throw ex;
-                } else {
-                    LOG.log(Level.WARNING, "Could not start WS-Discovery Service.", ex);
                 }
+                LOG.log(Level.WARNING, "Could not start WS-Discovery Service.", ex);
             } finally {
                 if (b != bus) {
                     BusFactory.setThreadDefaultBus(b);
@@ -318,13 +317,12 @@ public class WSDiscoveryServiceImpl implements WSDiscoveryService {
         URI uri = URI.create(scope);
         if (uri.getScheme() == null) {
             return UUID.fromString(scope);
-        } else {
-            if (uri.getScheme().equals("urn")) {
-                uri = URI.create(uri.getSchemeSpecificPart());
-            }
-            if (uri.getScheme().equals("uuid")) {
-                return UUID.fromString(uri.getSchemeSpecificPart());
-            }
+        }
+        if (uri.getScheme().equals("urn")) {
+            uri = URI.create(uri.getSchemeSpecificPart());
+        }
+        if (uri.getScheme().equals("uuid")) {
+            return UUID.fromString(uri.getSchemeSpecificPart());
         }
         return null;
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/services/wsn/wsn-core/src/main/java/org/apache/cxf/wsn/jms/JmsSubscription.java
----------------------------------------------------------------------
diff --git a/services/wsn/wsn-core/src/main/java/org/apache/cxf/wsn/jms/JmsSubscription.java b/services/wsn/wsn-core/src/main/java/org/apache/cxf/wsn/jms/JmsSubscription.java
index 9f9abf7..a49aa5d 100644
--- a/services/wsn/wsn-core/src/main/java/org/apache/cxf/wsn/jms/JmsSubscription.java
+++ b/services/wsn/wsn-core/src/main/java/org/apache/cxf/wsn/jms/JmsSubscription.java
@@ -143,16 +143,15 @@ public abstract class JmsSubscription extends AbstractSubscription implements Me
         if (session == null) {
             PauseFailedFaultType fault = new PauseFailedFaultType();
             throw new PauseFailedFault("Subscription is already paused", fault);
-        } else {
-            try {
-                session.close();
-                isSessionActive = false;
-            } catch (JMSException e) {
-                PauseFailedFaultType fault = new PauseFailedFaultType();
-                throw new PauseFailedFault("Error pausing subscription", fault, e);
-            } finally {
-                session = null;
-            }
+        }
+        try {
+            session.close();
+            isSessionActive = false;
+        } catch (JMSException e) {
+            PauseFailedFaultType fault = new PauseFailedFaultType();
+            throw new PauseFailedFault("Error pausing subscription", fault, e);
+        } finally {
+            session = null;
         }
     }
 
@@ -161,16 +160,15 @@ public abstract class JmsSubscription extends AbstractSubscription implements Me
         if (session != null) {
             ResumeFailedFaultType fault = new ResumeFailedFaultType();
             throw new ResumeFailedFault("Subscription is already running", fault);
-        } else {
-            try {
-                session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-                MessageConsumer consumer = session.createConsumer(jmsTopic);
-                consumer.setMessageListener(this);
-                isSessionActive = true;
-            } catch (JMSException e) {
-                ResumeFailedFaultType fault = new ResumeFailedFaultType();
-                throw new ResumeFailedFault("Error resuming subscription", fault, e);
-            }
+        }
+        try {
+            session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+            MessageConsumer consumer = session.createConsumer(jmsTopic);
+            consumer.setMessageListener(this);
+            isSessionActive = true;
+        } catch (JMSException e) {
+            ResumeFailedFaultType fault = new ResumeFailedFaultType();
+            throw new ResumeFailedFault("Error resuming subscription", fault, e);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/services/wsn/wsn-core/src/main/java/org/apache/cxf/wsn/jms/JmsTopicExpressionConverter.java
----------------------------------------------------------------------
diff --git a/services/wsn/wsn-core/src/main/java/org/apache/cxf/wsn/jms/JmsTopicExpressionConverter.java b/services/wsn/wsn-core/src/main/java/org/apache/cxf/wsn/jms/JmsTopicExpressionConverter.java
index 92d59f6..7156e1f 100644
--- a/services/wsn/wsn-core/src/main/java/org/apache/cxf/wsn/jms/JmsTopicExpressionConverter.java
+++ b/services/wsn/wsn-core/src/main/java/org/apache/cxf/wsn/jms/JmsTopicExpressionConverter.java
@@ -71,9 +71,8 @@ public class JmsTopicExpressionConverter {
                 }
             }
             throw new InvalidTopicException("No topic name available topic: " + topic);
-        } else {
-            throw new InvalidTopicException("Topic dialect: " + dialect + " not supported");
         }
+        throw new InvalidTopicException("Topic dialect: " + dialect + " not supported");
     }
 
     // Implementation methods

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/services/wsn/wsn-core/src/test/java/org/apache/cxf/wsn/WsnBrokerTest.java
----------------------------------------------------------------------
diff --git a/services/wsn/wsn-core/src/test/java/org/apache/cxf/wsn/WsnBrokerTest.java b/services/wsn/wsn-core/src/test/java/org/apache/cxf/wsn/WsnBrokerTest.java
index 8b5daa9..6836d9c 100644
--- a/services/wsn/wsn-core/src/test/java/org/apache/cxf/wsn/WsnBrokerTest.java
+++ b/services/wsn/wsn-core/src/test/java/org/apache/cxf/wsn/WsnBrokerTest.java
@@ -384,9 +384,8 @@ public abstract class WsnBrokerTest extends Assert {
         public InputStream getResourceAsStream(String name) {
             if ("META-INF/services/javax.xml.ws.spi.Provider".equals(name)) {
                 return provider != null ? new ByteArrayInputStream(provider.getBytes()) : null;
-            } else {
-                return super.getResourceAsStream(name);
             }
+            return super.getResourceAsStream(name);
         }
         @Override
         public Enumeration<URL> getResources(String name) throws IOException {

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/services/xkms/xkms-client/src/main/java/org/apache/cxf/xkms/crypto/provider/XkmsCryptoProvider.java
----------------------------------------------------------------------
diff --git a/services/xkms/xkms-client/src/main/java/org/apache/cxf/xkms/crypto/provider/XkmsCryptoProvider.java b/services/xkms/xkms-client/src/main/java/org/apache/cxf/xkms/crypto/provider/XkmsCryptoProvider.java
index df8e424..ef4e213 100644
--- a/services/xkms/xkms-client/src/main/java/org/apache/cxf/xkms/crypto/provider/XkmsCryptoProvider.java
+++ b/services/xkms/xkms-client/src/main/java/org/apache/cxf/xkms/crypto/provider/XkmsCryptoProvider.java
@@ -261,9 +261,8 @@ public class XkmsCryptoProvider extends CryptoBase {
             return new X509Certificate[] {
                 cachedToken.getX509Certificate()
             };
-        } else {
-            return null;
         }
+        return null;
     }
 
     private X509Certificate[] buildX509GetResult(String key, X509Certificate cert) {
@@ -274,10 +273,9 @@ public class XkmsCryptoProvider extends CryptoBase {
             return new X509Certificate[] {
                 cert
             };
-        } else {
-            // Certificate was not found: return empty list
-            return new X509Certificate[0];
         }
+        // Certificate was not found: return empty list
+        return new X509Certificate[0];
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/services/xkms/xkms-common/src/main/java/org/apache/cxf/xkms/handlers/DnUtils.java
----------------------------------------------------------------------
diff --git a/services/xkms/xkms-common/src/main/java/org/apache/cxf/xkms/handlers/DnUtils.java b/services/xkms/xkms-common/src/main/java/org/apache/cxf/xkms/handlers/DnUtils.java
index ba79718..ccd1d97 100644
--- a/services/xkms/xkms-common/src/main/java/org/apache/cxf/xkms/handlers/DnUtils.java
+++ b/services/xkms/xkms-common/src/main/java/org/apache/cxf/xkms/handlers/DnUtils.java
@@ -63,9 +63,8 @@ public final class DnUtils {
             // normalize the prefix if present
             if (split.length == 2) {
                 return split[1].trim();
-            } else {
-                return attr.trim();
             }
+            return attr.trim();
         }
         return attr;
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/services/xkms/xkms-x509-handlers/src/main/java/org/apache/cxf/xkms/x509/handlers/X509Register.java
----------------------------------------------------------------------
diff --git a/services/xkms/xkms-x509-handlers/src/main/java/org/apache/cxf/xkms/x509/handlers/X509Register.java b/services/xkms/xkms-x509-handlers/src/main/java/org/apache/cxf/xkms/x509/handlers/X509Register.java
index 8a1f920..497568e 100644
--- a/services/xkms/xkms-x509-handlers/src/main/java/org/apache/cxf/xkms/x509/handlers/X509Register.java
+++ b/services/xkms/xkms-x509-handlers/src/main/java/org/apache/cxf/xkms/x509/handlers/X509Register.java
@@ -66,10 +66,9 @@ public class X509Register implements Register {
         List<String> respondWithList = request.getRespondWith();
         if ((respondWithList != null) && !(respondWithList.isEmpty())) {
             return respondWithList.contains(RespondWithEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_X_509_CERT);
-        } else {
-            // Default handler
-            return true;
         }
+        // Default handler
+        return true;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/services/xkms/xkms-x509-handlers/src/main/java/org/apache/cxf/xkms/x509/utils/X509Utils.java
----------------------------------------------------------------------
diff --git a/services/xkms/xkms-x509-handlers/src/main/java/org/apache/cxf/xkms/x509/utils/X509Utils.java b/services/xkms/xkms-x509-handlers/src/main/java/org/apache/cxf/xkms/x509/utils/X509Utils.java
index 8f91e8f..bb31a84 100644
--- a/services/xkms/xkms-x509-handlers/src/main/java/org/apache/cxf/xkms/x509/utils/X509Utils.java
+++ b/services/xkms/xkms-x509-handlers/src/main/java/org/apache/cxf/xkms/x509/utils/X509Utils.java
@@ -101,11 +101,10 @@ public final class X509Utils {
         Certificate certificate = X509_FACTORY.generateCertificate(stream);
         if (certificate instanceof X509Certificate) {
             return (X509Certificate) certificate;
-        } else {
-            throw new CertificateException("Unsupported certificate type encountered: "
-                    + ((certificate != null && certificate.getClass() != null)
-                        ? certificate.getClass().getName() : "Null"));
         }
+        throw new CertificateException("Unsupported certificate type encountered: "
+                + ((certificate != null && certificate.getClass() != null)
+                    ? certificate.getClass().getName() : "Null"));
     }
 
     public static UnverifiedKeyBindingType getUnverifiedKeyBinding(X509Certificate cert)

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/services/xkms/xkms-x509-repo-ldap/src/main/java/org/apache/cxf/xkms/x509/repo/ldap/LdapSearch.java
----------------------------------------------------------------------
diff --git a/services/xkms/xkms-x509-repo-ldap/src/main/java/org/apache/cxf/xkms/x509/repo/ldap/LdapSearch.java b/services/xkms/xkms-x509-repo-ldap/src/main/java/org/apache/cxf/xkms/x509/repo/ldap/LdapSearch.java
index 226650f..e50d5d9 100644
--- a/services/xkms/xkms-x509-repo-ldap/src/main/java/org/apache/cxf/xkms/x509/repo/ldap/LdapSearch.java
+++ b/services/xkms/xkms-x509-repo-ldap/src/main/java/org/apache/cxf/xkms/x509/repo/ldap/LdapSearch.java
@@ -123,9 +123,8 @@ public class LdapSearch {
         if (answer.hasMore()) {
             SearchResult sr = answer.next();
             return sr.getAttributes();
-        } else {
-            return null;
         }
+        return null;
     }
 
     public Attribute findAttribute(String rootDN, String filter, String attrName) throws NamingException {

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer.java
index 6d2ac5b..b784475 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer.java
@@ -242,9 +242,8 @@ public class BookServer extends AbstractBusTestServerBase {
             String status = r.getHeaderString("Status");
             if ("notReturned".equals(status)) {
                 return new BookNotReturnedException(status);
-            } else {
-                return null;
             }
+            return null;
         }
 
     }
@@ -255,9 +254,8 @@ public class BookServer extends AbstractBusTestServerBase {
             String status = r.getHeaderString("Status");
             if ("notFound".equals(status)) {
                 return new BookNotFoundFault(status);
-            } else {
-                return null;
             }
+            return null;
         }
 
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/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 d4e8d70..304b7fe 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
@@ -225,12 +225,11 @@ public class BookStore {
                 ? ui.getAbsolutePathBuilder().queryParam("redirect", "true").build().toString()
                 : "http://otherhost/redirect";
             return Response.status(303).cookie(NewCookie.valueOf("a=b")).header("Location", uri).build();
-        } else {
-            return Response.ok(new Book("CXF", 123L), "application/xml")
-                .header("RequestURI", this.ui.getRequestUri().toString())
-                .header("TheCookie", cookie)
-                .build();
         }
+        return Response.ok(new Book("CXF", 123L), "application/xml")
+            .header("RequestURI", this.ui.getRequestUri().toString())
+            .header("TheCookie", cookie)
+            .build();
     }
 
     @GET
@@ -240,12 +239,10 @@ public class BookStore {
         if (done == null) {
             if (loop) {
                 return Response.status(303).header("Location", "relative?loop=true").build();
-            } else {
-                return Response.status(303).header("Location", "relative?redirect=true").build();
             }
-        } else {
-            return Response.ok(new Book("CXF", 124L), "application/xml").build();
+            return Response.status(303).header("Location", "relative?redirect=true").build();
         }
+        return Response.ok(new Book("CXF", 124L), "application/xml").build();
     }
 
     @GET
@@ -299,9 +296,8 @@ public class BookStore {
             } catch (InterruptedException e) {
             }
             return Response.ok(book).build();
-        } else {
-            return Response.ok(book).build();
         }
+        return Response.ok(book).build();
     }
 
     @DELETE
@@ -525,9 +521,8 @@ public class BookStore {
         throws BookNotFoundFault, BookNotReturnedException {
         if (notReturned) {
             throw new WebApplicationException(Response.status(404).header("Status", "notReturned").build());
-        } else {
-            throw new WebApplicationException(Response.status(404).header("Status", "notFound").build());
         }
+        throw new WebApplicationException(Response.status(404).header("Status", "notFound").build());
     }
 
     @GET
@@ -1317,11 +1312,10 @@ public class BookStore {
         Book book = books.get(Long.parseLong(id));
         if (book != null) {
             return book;
-        } else {
-            BookNotFoundDetails details = new BookNotFoundDetails();
-            details.setId(Long.parseLong(id));
-            throw new BookNotFoundFault(details);
         }
+        BookNotFoundDetails details = new BookNotFoundDetails();
+        details.setId(Long.parseLong(id));
+        throw new BookNotFoundFault(details);
     }
 
     @Path("/booksubresource/{bookId}/")
@@ -1329,11 +1323,10 @@ public class BookStore {
         Book book = books.get(Long.parseLong(id));
         if (book != null) {
             return book;
-        } else {
-            BookNotFoundDetails details = new BookNotFoundDetails();
-            details.setId(Long.parseLong(id));
-            throw new BookNotFoundFault(details);
         }
+        BookNotFoundDetails details = new BookNotFoundDetails();
+        details.setId(Long.parseLong(id));
+        throw new BookNotFoundFault(details);
     }
 
     @Path("/booksubresource/context")
@@ -1365,11 +1358,10 @@ public class BookStore {
         Book book = books.get(new Long(id));
         if (book != null) {
             return book.getName();
-        } else {
-            BookNotFoundDetails details = new BookNotFoundDetails();
-            details.setId(id);
-            throw new BookNotFoundFault(details);
         }
+        BookNotFoundDetails details = new BookNotFoundDetails();
+        details.setId(id);
+        throw new BookNotFoundFault(details);
     }
 
     @POST
@@ -1772,10 +1764,9 @@ public class BookStore {
                 throw new WebApplicationException(
                      Response.status(410).header("content-type", "text/plain")
                      .entity("This is supposed to go on the wire").build());
-            } else {
-                output.write("This is not supposed to go on the wire".getBytes());
-                throw new WebApplicationException(410);
             }
+            output.write("This is not supposed to go on the wire".getBytes());
+            throw new WebApplicationException(410);
         }
 
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStorePerRequest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStorePerRequest.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStorePerRequest.java
index eae6aed..940de15 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStorePerRequest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStorePerRequest.java
@@ -109,11 +109,10 @@ public class BookStorePerRequest {
         Book book = books.get(Long.parseLong(id));
         if (book != null) {
             return book;
-        } else {
-            BookNotFoundDetails details = new BookNotFoundDetails();
-            details.setId(Long.parseLong(id));
-            throw new BookNotFoundFault(details);
         }
+        BookNotFoundDetails details = new BookNotFoundDetails();
+        details.setId(Long.parseLong(id));
+        throw new BookNotFoundFault(details);
     }
 
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreWithInterface.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreWithInterface.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreWithInterface.java
index 92bdc82..cdf14cc 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreWithInterface.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreWithInterface.java
@@ -73,9 +73,8 @@ public class BookStoreWithInterface extends BookStoreStorage implements BookInte
         String ct = (String)JAXRSUtils.getCurrentMessage().get(Message.CONTENT_TYPE);
         if ("application/xml;a=b".equals(ct)) {
             return b;
-        } else {
-            throw new RuntimeException();
         }
+        throw new RuntimeException();
     }
 
     private Book doGetBook(Long id) throws BookNotFoundFault {
@@ -83,11 +82,10 @@ public class BookStoreWithInterface extends BookStoreStorage implements BookInte
         Book book = books.get(id);
         if (book != null) {
             return book;
-        } else {
-            BookNotFoundDetails details = new BookNotFoundDetails();
-            details.setId(id);
-            throw new BookNotFoundFault(details);
         }
+        BookNotFoundDetails details = new BookNotFoundDetails();
+        details.setId(id);
+        throw new BookNotFoundFault(details);
     }
 
     public Book getThatBook() throws BookNotFoundFault {

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreWithInterface2.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreWithInterface2.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreWithInterface2.java
index 8b0cd74..39fdff9 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreWithInterface2.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreWithInterface2.java
@@ -86,11 +86,10 @@ public class BookStoreWithInterface2 extends BookStoreStorage implements BookInt
         Book book = books.get(id);
         if (book != null) {
             return book;
-        } else {
-            BookNotFoundDetails details = new BookNotFoundDetails();
-            details.setId(id);
-            throw new BookNotFoundFault(details);
         }
+        BookNotFoundDetails details = new BookNotFoundDetails();
+        details.setId(id);
+        throw new BookNotFoundFault(details);
     }
 
     public Book getThatBook() throws BookNotFoundFault {

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookSubresourceImpl.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookSubresourceImpl.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookSubresourceImpl.java
index 27905c6..3d6687e 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookSubresourceImpl.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookSubresourceImpl.java
@@ -118,9 +118,8 @@ public class BookSubresourceImpl implements BookSubresource {
         String comment2 = comments.get(2L);
         if ("Good".equals(comment1) && "Good".equals(comment2)) {
             return book;
-        } else {
-            return null;
         }
+        return null;
     }
 
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/CustomJaxbElementProvider.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/CustomJaxbElementProvider.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/CustomJaxbElementProvider.java
index 489c2fe..f3c0047 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/CustomJaxbElementProvider.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/CustomJaxbElementProvider.java
@@ -43,9 +43,8 @@ public class CustomJaxbElementProvider extends JAXBElementProvider<Book> {
                 }
             }
             throw new RuntimeException();
-        } else {
-            return super.isWriteable(type, genericType, anns, mt);
         }
+        return super.isWriteable(type, genericType, anns, mt);
 
     }
     @Override

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/CustomWebApplicationExceptionMapper.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/CustomWebApplicationExceptionMapper.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/CustomWebApplicationExceptionMapper.java
index 466d083..e44c42a 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/CustomWebApplicationExceptionMapper.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/CustomWebApplicationExceptionMapper.java
@@ -31,9 +31,8 @@ public class CustomWebApplicationExceptionMapper extends WebApplicationException
         if (exception.getResponse().getStatus() == 500) {
             return Response.status(500).type("text/plain")
                 .entity(exception.getCause().getMessage()).build();
-        } else {
-            return super.toResponse(exception);
         }
+        return super.toResponse(exception);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerStreamingTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerStreamingTest.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerStreamingTest.java
index a746141..b535c4e 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerStreamingTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerStreamingTest.java
@@ -155,9 +155,8 @@ public class JAXRSClientServerStreamingTest extends AbstractBusClientServerTestB
         protected XMLStreamWriter getStreamWriter(Object obj, OutputStream os, MediaType mt) {
             if (mt.equals(MediaType.TEXT_XML_TYPE)) {
                 return new CachingXmlEventWriter();
-            } else {
-                throw new RuntimeException();
             }
+            throw new RuntimeException();
         }
         @Override
         public void writeTo(Object obj, Class<?> cls, Type genericType, Annotation[] anns,
@@ -166,9 +165,8 @@ public class JAXRSClientServerStreamingTest extends AbstractBusClientServerTestB
             if (failHeaders != null && !failHeaders.isEmpty()) {
                 os.write("fail".getBytes());
                 throw new IOException();
-            } else {
-                super.writeTo(obj, cls, genericType, anns, m, headers, os);
             }
+            super.writeTo(obj, cls, genericType, anns, m, headers, os);
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerUserResourceDefaultTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerUserResourceDefaultTest.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerUserResourceDefaultTest.java
index 157e23b..e6c3a91 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerUserResourceDefaultTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerUserResourceDefaultTest.java
@@ -212,9 +212,8 @@ public class JAXRSClientServerUserResourceDefaultTest extends AbstractBusClientS
                 String id = ui.getPathParameters().getFirst("id");
                 Book book = books.get(id);
                 return Response.ok(book, headers.getAcceptableMediaTypes().get(0)).build();
-            } else {
-                throw new NotAllowedException("GET");
             }
+            throw new NotAllowedException("GET");
         }
         public Book echo(Book book) {
             return book;

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
index 7036299..6c55405 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
@@ -975,9 +975,8 @@ public class JAXRSSoapBookTest extends AbstractBusClientServerTestBase {
         public Exception fromResponse(Response r) {
             if (r.getStatus() == HttpStatus.SC_NOT_FOUND) {
                 return new NotFoundException();
-            } else {
-                return null;
             }
+            return null;
         }
     }
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JMSBookStore.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JMSBookStore.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JMSBookStore.java
index 29dad3e..375cf8e 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JMSBookStore.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JMSBookStore.java
@@ -92,11 +92,10 @@ public class JMSBookStore {
         Book book = books.get(Long.parseLong(id));
         if (book != null) {
             return book;
-        } else {
-            BookNotFoundDetails details = new BookNotFoundDetails();
-            details.setId(Long.parseLong(id));
-            throw new BookNotFoundFault(details);
         }
+        BookNotFoundDetails details = new BookNotFoundDetails();
+        details.setId(Long.parseLong(id));
+        throw new BookNotFoundFault(details);
     }
 
     @POST

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/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 35d39d0..c843f7b 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
@@ -176,9 +176,8 @@ public class MultipartStore {
     public String testNullPart(@Multipart(value = "someid", required = false) String value) {
         if (value != null) {
             return value;
-        } else {
-            return "nobody home";
         }
+        return "nobody home";
     }
     @POST
     @Path("/books/testnullparts")
@@ -188,9 +187,8 @@ public class MultipartStore {
                                 @Multipart(value = "someid2", required = false) String value2) {
         if (value2 != null) {
             return value + value2;
-        } else {
-            return "nobody home2";
         }
+        return "nobody home2";
     }
 
     @POST

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/StringTextWriter.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/StringTextWriter.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/StringTextWriter.java
index 844db53..235ba32 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/StringTextWriter.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/StringTextWriter.java
@@ -47,9 +47,8 @@ public class StringTextWriter extends StringTextProvider {
         String path = ui.getAbsolutePath().toString();
         if (path.endsWith("/webapp/resources/bookstore/nonexistent")) {
             return super.isWriteable(type, genericType, annotations, mt);
-        } else {
-            return false;
         }
+        return false;
     }
 
     public void writeTo(String obj, Class<?> type, Type genType, Annotation[] anns,

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/cors/AnnotatedCorsServer.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/cors/AnnotatedCorsServer.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/cors/AnnotatedCorsServer.java
index 74641cd..105c0cd 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/cors/AnnotatedCorsServer.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/cors/AnnotatedCorsServer.java
@@ -81,9 +81,8 @@ public class AnnotatedCorsServer {
             return Response.ok().header(CorsHeaderConstants.HEADER_AC_ALLOW_METHODS, "DELETE PUT")
                 .header(CorsHeaderConstants.HEADER_AC_ALLOW_CREDENTIALS, "false")
                 .header(CorsHeaderConstants.HEADER_AC_ALLOW_ORIGIN, "http://area51.mil:3333").build();
-        } else {
-            return Response.ok().build();
         }
+        return Response.ok().build();
     }
 
     @GET

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jaxws/BookStoreSoapRestImpl.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jaxws/BookStoreSoapRestImpl.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jaxws/BookStoreSoapRestImpl.java
index 4b959d9..cee8473 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jaxws/BookStoreSoapRestImpl.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jaxws/BookStoreSoapRestImpl.java
@@ -157,9 +157,8 @@ public class BookStoreSoapRestImpl implements BookStoreJaxrsJaxws {
     public Response checkBook(Long id) {
         if (id.longValue() != 0L) {
             return Response.status(HttpStatus.SC_NOT_FOUND).build();
-        } else {
-            return Response.ok().build();
         }
+        return Response.ok().build();
     }
 
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/reactive/CompletableFutureService.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/reactive/CompletableFutureService.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/reactive/CompletableFutureService.java
index 03b295e..9154a61 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/reactive/CompletableFutureService.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/reactive/CompletableFutureService.java
@@ -40,9 +40,8 @@ public class CompletableFutureService {
     public Book getBook(@PathParam("id") long id) {
         if (123L == id) {
             return new Book("cxf", 123L);
-        } else {
-            throw new NotFoundException();
         }
+        throw new NotFoundException();
     }
     @GET
     @Produces("text/xml")

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JettyJAASFilter.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JettyJAASFilter.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JettyJAASFilter.java
index 29f1b31..0a495b1 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JettyJAASFilter.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JettyJAASFilter.java
@@ -39,9 +39,8 @@ public class JettyJAASFilter extends JAASAuthenticationFilter {
                         throw new RuntimeException(e);
                     }
                     return true;
-                } else {
-                    return false;
                 }
+                return false;
             }
         };
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/WebSocketTestClient.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/WebSocketTestClient.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/WebSocketTestClient.java
index c1b1987..6ab9bcf 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/WebSocketTestClient.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/websocket/WebSocketTestClient.java
@@ -234,9 +234,8 @@ class WebSocketTestClient {
                 if (first && isStatusCode(line)) {
                     statusCode = Integer.parseInt(line);
                     continue;
-                } else {
-                    first = false;
                 }
+                first = false;
 
                 int del = line.indexOf(':');
                 String h = line.substring(0, del).trim();

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/TestHandler.java
----------------------------------------------------------------------
diff --git a/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/TestHandler.java b/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/TestHandler.java
index 7129a13..a4b552c 100644
--- a/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/TestHandler.java
+++ b/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/TestHandler.java
@@ -191,9 +191,8 @@ public class TestHandler<T extends LogicalMessageContext>
         addHandlerId(msg, ctx, outbound);
         if (checkServerOutBindStopHandler(outbound, ctx)) {
             return false;
-        } else {
-            return getHandleMessageRet();
         }
+        return getHandleMessageRet();
     }
 
     private void addHandlerId(LogicalMessage msg, T ctx, boolean outbound) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/AbstractSourcePayloadProvider.java
----------------------------------------------------------------------
diff --git a/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/AbstractSourcePayloadProvider.java b/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/AbstractSourcePayloadProvider.java
index 02baf15..c56f447 100644
--- a/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/AbstractSourcePayloadProvider.java
+++ b/systests/jaxws/src/test/java/org/apache/cxf/systest/provider/AbstractSourcePayloadProvider.java
@@ -101,10 +101,9 @@ public abstract class AbstractSourcePayloadProvider implements SourceProvider {
             if (doneStax) {
                 XMLReader reader = XMLReaderFactory.createXMLReader();
                 return new SAXSource(reader, new InputSource(greetMeInputStream));
-            } else {
-                doneStax = true;
-                return new StaxSource(StaxUtils.createXMLStreamReader(greetMeInputStream));
             }
+            doneStax = true;
+            return new StaxSource(StaxUtils.createXMLStreamReader(greetMeInputStream));
         } else if (StreamSource.class.equals(class1)) {
             StreamSource source = new StreamSource();
             source.setInputStream(greetMeInputStream);

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/common/KeystorePasswordCallback.java
----------------------------------------------------------------------
diff --git a/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/common/KeystorePasswordCallback.java b/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/common/KeystorePasswordCallback.java
index 4f98ced..ca85349 100644
--- a/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/common/KeystorePasswordCallback.java
+++ b/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/common/KeystorePasswordCallback.java
@@ -64,9 +64,8 @@ public class KeystorePasswordCallback implements CallbackHandler {
                 if (pass != null) {
                     pc.setPassword(pass);
                     return;
-                } else {
-                    pc.setPassword("password");
                 }
+                pc.setPassword("password");
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/jaxrs/kerberos/BookStoreImpl.java
----------------------------------------------------------------------
diff --git a/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/jaxrs/kerberos/BookStoreImpl.java b/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/jaxrs/kerberos/BookStoreImpl.java
index f830d62..bd45fe2 100644
--- a/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/jaxrs/kerberos/BookStoreImpl.java
+++ b/systests/kerberos/src/test/java/org/apache/cxf/systest/kerberos/jaxrs/kerberos/BookStoreImpl.java
@@ -87,11 +87,10 @@ public class BookStoreImpl implements BookStore {
         Book book = books.get(Long.parseLong(id));
         if (book != null) {
             return book;
-        } else {
-            BookNotFoundDetails details = new BookNotFoundDetails();
-            details.setId(Long.parseLong(id));
-            throw new BookNotFoundFault(details);
         }
+        BookNotFoundDetails details = new BookNotFoundDetails();
+        details.setId(Long.parseLong(id));
+        throw new BookNotFoundFault(details);
     }
 
     public final String init() {

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java
----------------------------------------------------------------------
diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java
index bbe4869..dd1b722 100644
--- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java
+++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/xml/JAXRSXmlSecTest.java
@@ -691,9 +691,8 @@ public class JAXRSXmlSecTest extends AbstractBusClientServerTestBase {
         } catch (WebApplicationException ex) {
             if (propagateException) {
                 throw ex;
-            } else {
-                fail(ex.getMessage());
             }
+            fail(ex.getMessage());
         } catch (ProcessingException ex) {
             assertTrue(ex.getCause() instanceof BadRequestException);
         }

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java
----------------------------------------------------------------------
diff --git a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java
index a83526a..c98bb4b 100644
--- a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java
+++ b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java
@@ -529,9 +529,8 @@ public class JMSClientServerTest extends AbstractBusClientServerTestBase {
             if (!ack) {
                 if (requestServant.getException() != null) {
                     throw requestServant.getException();
-                } else {
-                    fail("The decoupled one-way reply was sent");
                 }
+                fail("The decoupled one-way reply was sent");
             }
         } catch (Exception ex) {
             throw ex;

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/security/KeystorePasswordCallback.java
----------------------------------------------------------------------
diff --git a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/security/KeystorePasswordCallback.java b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/security/KeystorePasswordCallback.java
index f9613b8..2dc7095 100644
--- a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/security/KeystorePasswordCallback.java
+++ b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/security/KeystorePasswordCallback.java
@@ -62,9 +62,8 @@ public class KeystorePasswordCallback implements CallbackHandler {
                 if (pass != null) {
                     pc.setPassword(pass);
                     return;
-                } else {
-                    pc.setPassword("password");
                 }
+                pc.setPassword("password");
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/tx/MyBeanLocator.java
----------------------------------------------------------------------
diff --git a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/tx/MyBeanLocator.java b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/tx/MyBeanLocator.java
index e242279..9260f24 100644
--- a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/tx/MyBeanLocator.java
+++ b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/tx/MyBeanLocator.java
@@ -39,9 +39,8 @@ public class MyBeanLocator implements ConfiguredBeanLocator {
     public <T> T getBeanOfType(String name, Class<T> type) {
         if (registry.containsKey(name)) {
             return (T)registry.get(name);
-        } else {
-            return cbl.getBeanOfType(name, type);
         }
+        return cbl.getBeanOfType(name, type);
     }
 
     @SuppressWarnings("unchecked")

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/websocket/BookStorePerRequest.java
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/websocket/BookStorePerRequest.java b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/websocket/BookStorePerRequest.java
index 67b4d55..a916426 100644
--- a/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/websocket/BookStorePerRequest.java
+++ b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/websocket/BookStorePerRequest.java
@@ -109,11 +109,10 @@ public class BookStorePerRequest {
         Book book = books.get(Long.parseLong(id));
         if (book != null) {
             return book;
-        } else {
-            BookNotFoundDetails details = new BookNotFoundDetails();
-            details.setId(Long.parseLong(id));
-            throw new BookNotFoundFault(details);
         }
+        BookNotFoundDetails details = new BookNotFoundDetails();
+        details.setId(Long.parseLong(id));
+        throw new BookNotFoundFault(details);
     }
 
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/websocket/WebSocketTestClient.java
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/websocket/WebSocketTestClient.java b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/websocket/WebSocketTestClient.java
index d247278..7d0ce28 100644
--- a/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/websocket/WebSocketTestClient.java
+++ b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/websocket/WebSocketTestClient.java
@@ -234,9 +234,8 @@ class WebSocketTestClient {
                 if (first && isStatusCode(line)) {
                     statusCode = Integer.parseInt(line);
                     continue;
-                } else {
-                    first = false;
                 }
+                first = false;
 
                 int del = line.indexOf(':');
                 String h = line.substring(0, del).trim();

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/systests/transports/src/test/java/org/apache/cxf/systest/https/conduit/PushBack401.java
----------------------------------------------------------------------
diff --git a/systests/transports/src/test/java/org/apache/cxf/systest/https/conduit/PushBack401.java b/systests/transports/src/test/java/org/apache/cxf/systest/https/conduit/PushBack401.java
index 8d67e51..a252e4f 100644
--- a/systests/transports/src/test/java/org/apache/cxf/systest/https/conduit/PushBack401.java
+++ b/systests/transports/src/test/java/org/apache/cxf/systest/https/conduit/PushBack401.java
@@ -115,35 +115,33 @@ public class PushBack401 extends AbstractPhaseInterceptor<Message> {
             // No Auth Header, respond with 401 Realm=Cronus
             replyUnauthorized(message, "Cronus");
             return;
-        } else {
-            for (String a : auth) {
-                if (a.startsWith("Basic ")) {
-                    String[] userpass =
-                        extractUserPass(a.substring("Basic ".length()));
-                    if (userpass != null) {
-                        try {
-                            String realm =
-                                checkUserPass(userpass[0], userpass[1]);
-                            if (realm != null) {
-                                replyUnauthorized(message, realm);
-                                return;
-                            } else {
-                                // Password is good and no realm
-                                // We just return for successful fall thru.
-                                return;
-                            }
-                        } catch (Exception e) {
-                            // Bad Password
-                            replyUnauthorized(message, null);
+        }
+        for (String a : auth) {
+            if (a.startsWith("Basic ")) {
+                String[] userpass =
+                    extractUserPass(a.substring("Basic ".length()));
+                if (userpass != null) {
+                    try {
+                        String realm =
+                            checkUserPass(userpass[0], userpass[1]);
+                        if (realm != null) {
+                            replyUnauthorized(message, realm);
                             return;
                         }
+                        // Password is good and no realm
+                        // We just return for successful fall thru.
+                        return;
+                    } catch (Exception e) {
+                        // Bad Password
+                        replyUnauthorized(message, null);
+                        return;
                     }
                 }
             }
-            // No Authorization: Basic
-            replyUnauthorized(message, null);
-            return;
         }
+        // No Authorization: Basic
+        replyUnauthorized(message, null);
+        return;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/systests/transports/src/test/java/org/apache/cxf/systest/servlet/GetMethodQueryWebRequest.java
----------------------------------------------------------------------
diff --git a/systests/transports/src/test/java/org/apache/cxf/systest/servlet/GetMethodQueryWebRequest.java b/systests/transports/src/test/java/org/apache/cxf/systest/servlet/GetMethodQueryWebRequest.java
index c2fe906..dc54536 100644
--- a/systests/transports/src/test/java/org/apache/cxf/systest/servlet/GetMethodQueryWebRequest.java
+++ b/systests/transports/src/test/java/org/apache/cxf/systest/servlet/GetMethodQueryWebRequest.java
@@ -33,9 +33,8 @@ public class GetMethodQueryWebRequest extends GetMethodWebRequest {
         int pos = urlString.indexOf('?');
         if (pos > 0) {
             return urlString.substring(pos + 1);
-        } else {
-            return "";
         }
+        return "";
     }
 
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/systests/uncategorized/src/test/java/org/apache/cxf/systest/bus/BusExtensionLoadingTest.java
----------------------------------------------------------------------
diff --git a/systests/uncategorized/src/test/java/org/apache/cxf/systest/bus/BusExtensionLoadingTest.java b/systests/uncategorized/src/test/java/org/apache/cxf/systest/bus/BusExtensionLoadingTest.java
index ed9af77..6753318 100644
--- a/systests/uncategorized/src/test/java/org/apache/cxf/systest/bus/BusExtensionLoadingTest.java
+++ b/systests/uncategorized/src/test/java/org/apache/cxf/systest/bus/BusExtensionLoadingTest.java
@@ -88,9 +88,8 @@ public class BusExtensionLoadingTest extends Assert {
         public Class<?> loadClass(final String className) throws ClassNotFoundException {
             if (className.contains("cxf")) {
                 throw new ClassNotFoundException("TestClassLoader does not load CXF classes: " +  className);
-            } else {
-                return super.loadClass(className);
             }
+            return super.loadClass(className);
         }
 
         @Override

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_feature/ImageHelper.java
----------------------------------------------------------------------
diff --git a/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_feature/ImageHelper.java b/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_feature/ImageHelper.java
index b32aba3..e455242 100644
--- a/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_feature/ImageHelper.java
+++ b/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_feature/ImageHelper.java
@@ -57,22 +57,21 @@ public final class ImageHelper {
     private static BufferedImage convertToBufferedImage(Image image) throws IOException {
         if (image instanceof BufferedImage) {
             return (BufferedImage)image;
-        } else {
-            /*not sure how this is used*/
-            MediaTracker tracker = new MediaTracker(null);
-            tracker.addImage(image, 0);
-            try {
-                tracker.waitForAll();
-            } catch (InterruptedException e) {
-                throw new IOException(e.getMessage());
-            }
-            BufferedImage bufImage = new BufferedImage(
-                                                       image.getWidth(null),
-                                                       image.getHeight(null),
-                                                       BufferedImage.TYPE_INT_RGB);
-            Graphics g = bufImage.createGraphics();
-            g.drawImage(image, 0, 0, null);
-            return bufImage;
         }
+        /*not sure how this is used*/
+        MediaTracker tracker = new MediaTracker(null);
+        tracker.addImage(image, 0);
+        try {
+            tracker.waitForAll();
+        } catch (InterruptedException e) {
+            throw new IOException(e.getMessage());
+        }
+        BufferedImage bufImage = new BufferedImage(
+                                                   image.getWidth(null),
+                                                   image.getHeight(null),
+                                                   BufferedImage.TYPE_INT_RGB);
+        Graphics g = bufImage.createGraphics();
+        g.drawImage(image, 0, 0, null);
+        return bufImage;
     }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/systests/uncategorized/src/test/java/org/apache/cxf/systest/type_substitution/AppleFinderImpl.java
----------------------------------------------------------------------
diff --git a/systests/uncategorized/src/test/java/org/apache/cxf/systest/type_substitution/AppleFinderImpl.java b/systests/uncategorized/src/test/java/org/apache/cxf/systest/type_substitution/AppleFinderImpl.java
index d70352c..7f03622 100644
--- a/systests/uncategorized/src/test/java/org/apache/cxf/systest/type_substitution/AppleFinderImpl.java
+++ b/systests/uncategorized/src/test/java/org/apache/cxf/systest/type_substitution/AppleFinderImpl.java
@@ -33,9 +33,8 @@ public class AppleFinderImpl implements AppleFinder {
             apples.add(new Fuji("Red", "mild", "Fuji-1"));
             apples.add(new Fuji("Yellow", "sweet", "Fuji-2"));
             return apples;
-        } else {
-            return null;
         }
+        return null;
 
     }
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/systests/uncategorized/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient2.java
----------------------------------------------------------------------
diff --git a/systests/uncategorized/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient2.java b/systests/uncategorized/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient2.java
index 7c32b15..7a70a05 100644
--- a/systests/uncategorized/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient2.java
+++ b/systests/uncategorized/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient2.java
@@ -1699,9 +1699,8 @@ public abstract class AbstractTypeTestClient2 extends AbstractTypeTestClient {
                 SgBaseTypeA yTypeA = y.getSg04NillableBaseElementA().getValue();
                 return equals(xTypeA, yTypeA);
             }
-        } else {
-            return y.getSg04NillableBaseElementA() == null;
         }
+        return y.getSg04NillableBaseElementA() == null;
     }
     @Test
     public void testChoiceWithSubstitutionGroupNil() throws Exception {
@@ -1754,17 +1753,15 @@ public abstract class AbstractTypeTestClient2 extends AbstractTypeTestClient {
                 SgDerivedTypeC xTypeC = (SgDerivedTypeC)x;
                 SgDerivedTypeC yTypeC = (SgDerivedTypeC)y;
                 return equals(xTypeC, yTypeC);
-            } else {
-                return false;
             }
+            return false;
         } else if (x instanceof SgDerivedTypeB) {
             if (y instanceof SgDerivedTypeB) {
                 SgDerivedTypeB xTypeB = (SgDerivedTypeB)x;
                 SgDerivedTypeB yTypeB = (SgDerivedTypeB)y;
                 return equals(xTypeB, yTypeB);
-            } else {
-                return false;
             }
+            return false;
         }
         return true;
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/systests/uncategorized/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient3.java
----------------------------------------------------------------------
diff --git a/systests/uncategorized/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient3.java b/systests/uncategorized/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient3.java
index 988ceb7..7c5f47f 100644
--- a/systests/uncategorized/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient3.java
+++ b/systests/uncategorized/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient3.java
@@ -524,6 +524,7 @@ public abstract class AbstractTypeTestClient3 extends AbstractTypeTestClient2 {
 
     //org.apache.type_test.types1.DerivedEmptyBaseEmptyAll
 
+    @SuppressWarnings("cast")
     @Test
     public void testDerivedEmptyBaseEmptyAll() throws Exception {
         if (!shouldRunTest("DerivedEmptyBaseEmptyAll")) {
@@ -553,6 +554,7 @@ public abstract class AbstractTypeTestClient3 extends AbstractTypeTestClient2 {
 
     //org.apache.type_test.types1.DerivedEmptyBaseEmptyChoice
 
+    @SuppressWarnings("cast")
     @Test
     public void testDerivedEmptyBaseEmptyChoice() throws Exception {
         if (!shouldRunTest("DerivedEmptyBaseEmptyChoice")) {
@@ -585,10 +587,9 @@ public abstract class AbstractTypeTestClient3 extends AbstractTypeTestClient2 {
     protected boolean equals(RestrictedChoiceBaseChoice x, RestrictedChoiceBaseChoice y) {
         if (x.getVarFloat() != null && y.getVarFloat() != null) {
             return x.getVarFloat().compareTo(y.getVarFloat()) == 0;
-        } else {
-            return x.getVarInt() != null && y.getVarInt() != null
-                && x.getVarInt().compareTo(y.getVarInt()) == 0;
         }
+        return x.getVarInt() != null && y.getVarInt() != null
+            && x.getVarInt().compareTo(y.getVarInt()) == 0;
     }
 
     @Test
@@ -1419,10 +1420,9 @@ public abstract class AbstractTypeTestClient3 extends AbstractTypeTestClient2 {
     protected boolean equals(ChoiceWithBinary x, ChoiceWithBinary y) {
         if (x.getBase64() != null && y.getBase64() != null) {
             return Arrays.equals(x.getBase64(), y.getBase64());
-        } else {
-            return x.getHex() != null && y.getHex() != null
-                && Arrays.equals(x.getHex(), y.getHex());
         }
+        return x.getHex() != null && y.getHex() != null
+            && Arrays.equals(x.getHex(), y.getHex());
     }
 
     @Test
@@ -1583,18 +1583,17 @@ public abstract class AbstractTypeTestClient3 extends AbstractTypeTestClient2 {
             return x.getVarInt().compareTo(y.getVarInt()) == 0
                 && x.getVarString().equals(y.getVarString())
                 && x.getVarFloat().compareTo(y.getVarFloat()) == 0;
-        } else {
-            if (x.getVarOtherFloat() != null && y.getVarOtherFloat() != null) {
-                return x.getVarOtherFloat().compareTo(y.getVarOtherFloat()) == 0;
-            }
-            if (x.getVarOtherInt() != null && y.getVarOtherInt() != null) {
-                return x.getVarOtherInt().compareTo(y.getVarOtherInt()) == 0;
-            }
-            if (x.getVarOtherString() != null && y.getVarOtherString() != null) {
-                return x.getVarOtherString().equals(y.getVarOtherString());
-            }
-            return false;
         }
+        if (x.getVarOtherFloat() != null && y.getVarOtherFloat() != null) {
+            return x.getVarOtherFloat().compareTo(y.getVarOtherFloat()) == 0;
+        }
+        if (x.getVarOtherInt() != null && y.getVarOtherInt() != null) {
+            return x.getVarOtherInt().compareTo(y.getVarOtherInt()) == 0;
+        }
+        if (x.getVarOtherString() != null && y.getVarOtherString() != null) {
+            return x.getVarOtherString().equals(y.getVarOtherString());
+        }
+        return false;
     }
 
     // XXX - Generated code flattens nested structs

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/systests/uncategorized/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient4.java
----------------------------------------------------------------------
diff --git a/systests/uncategorized/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient4.java b/systests/uncategorized/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient4.java
index 854a4f4..e49cb47 100644
--- a/systests/uncategorized/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient4.java
+++ b/systests/uncategorized/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient4.java
@@ -723,13 +723,11 @@ public abstract class AbstractTypeTestClient4 extends AbstractTypeTestClient3 {
         if (x.getVarInt() == null) {
             if (x.getVarFloat() == null) {
                 return y.getVarInt() == null && y.getVarFloat() == null;
-            } else {
-                return false;
-            }
-        } else {
-            if (x.getVarFloat() == null || y.getVarInt() == null || y.getVarFloat() == null) {
-                return false;
             }
+            return false;
+        }
+        if (x.getVarFloat() == null || y.getVarInt() == null || y.getVarFloat() == null) {
+            return false;
         }
         return x.getVarFloat().compareTo(y.getVarFloat()) == 0
             && x.getVarInt() == y.getVarInt();
@@ -1088,9 +1086,8 @@ public abstract class AbstractTypeTestClient4 extends AbstractTypeTestClient3 {
             } else if (xo instanceof RecSeqB6918) {
                 if (yo instanceof RecSeqB6918) {
                     return equals((RecSeqB6918)xo, (RecSeqB6918)yo);
-                } else {
-                    return false;
                 }
+                return false;
             }
         }
         return true;

http://git-wip-us.apache.org/repos/asf/cxf/blob/db11547c/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ControlImpl.java
----------------------------------------------------------------------
diff --git a/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ControlImpl.java b/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ControlImpl.java
index 93e315d..eaeea1b 100644
--- a/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ControlImpl.java
+++ b/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ControlImpl.java
@@ -120,15 +120,14 @@ public class ControlImpl  extends org.apache.cxf.greeter_control.ControlImpl {
                                         XPathConstants.STRING);
                 //System.out.println("greetMeOneWay arg: " + s);
                 return null;
-            } else {
-                //System.out.println("greetMe arg: " + s);
-                String resp =
-                    "<greetMeResponse "
-                        + "xmlns=\"http://cxf.apache.org/greeter_control/types\">"
-                        + "<responseType>" + s.toUpperCase() + "</responseType>"
-                    + "</greetMeResponse>";
-                return new StreamSource(new StringReader(resp));
             }
+            //System.out.println("greetMe arg: " + s);
+            String resp =
+                "<greetMeResponse "
+                    + "xmlns=\"http://cxf.apache.org/greeter_control/types\">"
+                    + "<responseType>" + s.toUpperCase() + "</responseType>"
+                + "</greetMeResponse>";
+            return new StreamSource(new StringReader(resp));
         }
     }
 }


Mime
View raw message