cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [08/12] cxf git commit: Fix unecessary "else" clauses in rt/frontend
Date Fri, 04 Aug 2017 19:35:08 GMT
Fix unecessary "else" clauses in rt/frontend


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

Branch: refs/heads/master
Commit: 903ef61fef424a6edfe2727a455139de6be45dd8
Parents: 31e5364
Author: Daniel Kulp <dkulp@apache.org>
Authored: Fri Aug 4 14:31:27 2017 -0400
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Fri Aug 4 14:31:27 2017 -0400

----------------------------------------------------------------------
 .../org/apache/cxf/jaxrs/impl/ResponseImpl.java |  43 +++----
 .../apache/cxf/jaxrs/impl/UriBuilderImpl.java   |   3 +-
 .../org/apache/cxf/jaxrs/impl/UriInfoImpl.java  |   3 +-
 .../jaxrs/interceptor/JAXRSInInterceptor.java   |   3 +-
 .../jaxrs/interceptor/JAXRSOutInterceptor.java  |   6 +-
 .../cxf/jaxrs/model/AbstractResourceInfo.java   |   9 +-
 .../apache/cxf/jaxrs/model/ApplicationInfo.java |   7 +-
 .../cxf/jaxrs/model/ClassResourceInfo.java      |  12 +-
 .../cxf/jaxrs/model/OperationResourceInfo.java  |   7 +-
 .../org/apache/cxf/jaxrs/model/Parameter.java   |   3 +-
 .../org/apache/cxf/jaxrs/model/URITemplate.java |  12 +-
 .../cxf/jaxrs/model/doc/JavaDocProvider.java    |  12 +-
 .../provider/AbstractConfigurableProvider.java  |   3 +-
 .../jaxrs/provider/AbstractJAXBProvider.java    |  30 +++--
 .../cxf/jaxrs/provider/BinaryDataProvider.java  |   3 +-
 .../provider/CachingMessageBodyReader.java      |   3 +-
 .../provider/CachingMessageBodyWriter.java      |   3 +-
 .../provider/JAXBAttachmentMarshaller.java      |   6 +-
 .../cxf/jaxrs/provider/JAXBElementProvider.java |  12 +-
 .../cxf/jaxrs/provider/MultipartProvider.java   |  31 +++--
 .../cxf/jaxrs/provider/ProviderFactory.java     |  12 +-
 .../provider/RequestDispatcherProvider.java     |   6 +-
 .../jaxrs/provider/ServerProviderFactory.java   |   6 +-
 .../cxf/jaxrs/provider/SourceProvider.java      |   9 +-
 .../cxf/jaxrs/provider/XSLTJaxbProvider.java    |  11 +-
 .../security/JAASAuthenticationFilter.java      |  35 +++---
 .../jaxrs/servlet/CXFNonSpringJaxrsServlet.java |   9 +-
 .../AbstractSpringComponentScanServer.java      |   3 +-
 .../AbstractSpringConfigurationFactory.java     |   3 +-
 .../cxf/jaxrs/spring/SpringResourceFactory.java |  17 ++-
 .../org/apache/cxf/jaxrs/utils/HttpUtils.java   |  26 ++---
 .../apache/cxf/jaxrs/utils/InjectionUtils.java  |  39 +++----
 .../org/apache/cxf/jaxrs/utils/JAXBUtils.java   |   3 +-
 .../org/apache/cxf/jaxrs/utils/JAXRSUtils.java  | 103 ++++++++---------
 .../apache/cxf/jaxrs/utils/ResourceUtils.java   |  11 +-
 .../apache/cxf/jaxrs/utils/SpecExceptions.java  |   3 +-
 .../jaxrs/utils/multipart/AttachmentUtils.java  |   3 +-
 .../validation/ValidationExceptionMapper.java   |   3 +-
 .../cxf/jaxrs/validation/ValidationUtils.java   |   3 +-
 .../cxf/jaxrs/CustomerParameterHandler.java     |   3 +-
 .../apache/cxf/jaxrs/impl/ResponseImplTest.java |   3 +-
 .../apache/cxf/jaxrs/utils/JAXRSUtilsTest.java  |   8 +-
 .../java/org/apache/cxf/jaxws/EndpointImpl.java |   7 +-
 .../jaxws/context/WebServiceContextImpl.java    |   5 +-
 .../jaxws/context/WrappedMessageContext.java    |   3 +-
 .../org/apache/cxf/jaxws/spi/ProviderImpl.java  |  17 +--
 .../cxf/jaxws/support/JaxWsImplementorInfo.java |  25 ++--
 .../support/JaxWsServiceConfiguration.java      | 115 +++++++++----------
 .../http_jaxws_spi/JAXWSHttpSpiDestination.java |   3 +-
 .../java/org/apache/cxf/js/rhino/ServerApp.java |   3 +-
 .../endpoint/dynamic/DynamicClientFactory.java  |   6 +-
 .../org/apache/cxf/frontend/ClientProxy.java    |   3 +-
 .../apache/cxf/frontend/ServerFactoryBean.java  |   3 +-
 .../org/apache/cxf/frontend/WSDLGetUtils.java   |   9 +-
 54 files changed, 305 insertions(+), 424 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ResponseImpl.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ResponseImpl.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ResponseImpl.java
index 3f8c541..ceaeb5c 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ResponseImpl.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ResponseImpl.java
@@ -195,14 +195,13 @@ public final class ResponseImpl extends Response {
         List<Object> cookieValues = metadata.get(HttpHeaders.SET_COOKIE);
         if (cookieValues == null) {
             return Collections.emptyMap();
-        } else {
-            Map<String, NewCookie> cookies = new HashMap<>();
-            for (Object o : cookieValues) {
-                NewCookie newCookie = NewCookie.valueOf(o.toString());
-                cookies.put(newCookie.getName(), newCookie);
-            }
-            return cookies;
         }
+        Map<String, NewCookie> cookies = new HashMap<>();
+        for (Object o : cookieValues) {
+            NewCookie newCookie = NewCookie.valueOf(o.toString());
+            cookies.put(newCookie.getName(), newCookie);
+        }
+        return cookies;
     }
 
     public Date getDate() {
@@ -284,18 +283,17 @@ public final class ResponseImpl extends Response {
         List<Object> linkValues = metadata.get(HttpHeaders.LINK);
         if (linkValues == null) {
             return Collections.emptySet();
-        } else {
-            Set<Link> links = new LinkedHashSet<Link>();
-            for (Object o : linkValues) {
-                Link link = o instanceof Link ? (Link)o : Link.valueOf(o.toString());
-                if (!link.getUri().isAbsolute()) {
-                    URI requestURI = URI.create((String)outMessage.get(Message.REQUEST_URI));
-                    link = Link.fromLink(link).baseUri(requestURI).build();
-                }
-                links.add(link);
+        }
+        Set<Link> links = new LinkedHashSet<Link>();
+        for (Object o : linkValues) {
+            Link link = o instanceof Link ? (Link)o : Link.valueOf(o.toString());
+            if (!link.getUri().isAbsolute()) {
+                URI requestURI = URI.create((String)outMessage.get(Message.REQUEST_URI));
+                link = Link.fromLink(link).baseUri(requestURI).build();
             }
-            return links;
+            links.add(link);
         }
+        return links;
     }
 
     public <T> T readEntity(Class<T> cls) throws ProcessingException, IllegalStateException {
@@ -403,9 +401,8 @@ public final class ResponseImpl extends Response {
             } catch (Exception ex) {
                 throw new ProcessingException(ex);
             }
-        } else {
-            return null;
         }
+        return null;
     }
 
     private boolean entityStreamAvailable() {
@@ -413,9 +410,8 @@ public final class ResponseImpl extends Response {
             Message inMessage = getResponseMessage();
             return inMessage != null && (inMessage.getContent(XMLStreamReader.class) != null
                 || inMessage.getContent(Reader.class) != null);
-        } else {
-            return entity instanceof InputStream;
         }
+        return entity instanceof InputStream;
     }
 
     private Message getResponseMessage() {
@@ -484,10 +480,9 @@ public final class ResponseImpl extends Response {
             public String getReasonPhrase() {
                 if (reasonPhrase != null) {
                     return reasonPhrase;
-                } else {
-                    Response.Status statusEnum = Response.Status.fromStatusCode(statusCode);
-                    return statusEnum != null ? statusEnum.getReasonPhrase() : "";
                 }
+                Response.Status statusEnum = Response.Status.fromStatusCode(statusCode);
+                return statusEnum != null ? statusEnum.getReasonPhrase() : "";
             }
 
             public int getStatusCode() {

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
index 766dc8a..231011c 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
@@ -892,9 +892,8 @@ public class UriBuilderImpl extends UriBuilder implements Cloneable {
         } catch (Exception ex) {
             if (new URITemplate(uriTemplate).getVariables().isEmpty()) {
                 throw new IllegalArgumentException(ex);
-            } else {
-                return uriAsTemplate(uriTemplate);
             }
+            return uriAsTemplate(uriTemplate);
 
         }
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriInfoImpl.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriInfoImpl.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriInfoImpl.java
index 97728f1..8a7dd6e 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriInfoImpl.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriInfoImpl.java
@@ -96,9 +96,8 @@ public class UriInfoImpl implements UriInfo {
         String value = doGetPath(decode, true);
         if (value.length() > 1 && value.startsWith("/")) {
             return value.substring(1);
-        } else {
-            return value;
         }
+        return value;
     }
 
     public List<PathSegment> getPathSegments() {

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
index e88abb4..4474456 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
@@ -182,9 +182,8 @@ public class JAXRSInInterceptor extends AbstractPhaseInterceptor<Message> {
                 Response response = JAXRSUtils.createResponse(resources, null, null, 200, true);
                 exchange.put(Response.class, response);
                 return;
-            } else {
-                throw ex;
             }
+            throw ex;
         }
 
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
index 8aaf82f..2c3db9e 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
@@ -312,9 +312,8 @@ public class JAXRSOutInterceptor extends AbstractOutDatabindingInterceptor {
     private int getActualStatus(int status, Object responseObj) {
         if (status == -1) {
             return responseObj == null ? 204 : 200;
-        } else {
-            return status;
         }
+        return status;
     }
 
     private boolean checkBufferingMode(Message m, List<WriterInterceptor> writers, boolean firstTry) {
@@ -394,9 +393,8 @@ public class JAXRSOutInterceptor extends AbstractOutDatabindingInterceptor {
         if (excResponse == null) {
             setResponseStatus(message, 500);
             throw new Fault(ex);
-        } else {
-            serializeMessage(pf, message, excResponse, null, false);
         }
+        serializeMessage(pf, message, excResponse, null, false);
 
     }
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/AbstractResourceInfo.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/AbstractResourceInfo.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/AbstractResourceInfo.java
index 9284122..f692882 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/AbstractResourceInfo.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/AbstractResourceInfo.java
@@ -149,9 +149,8 @@ public abstract class AbstractResourceInfo {
                 }
             }
             return (ThreadLocalProxy<?>)proxy;
-        } else {
-            return InjectionUtils.createThreadLocalProxy(f.getType());
         }
+        return InjectionUtils.createThreadLocalProxy(f.getType());
     }
 
     private static ThreadLocalProxy<?> getMethodThreadLocalProxy(Method m, Object provider) {
@@ -171,9 +170,8 @@ public abstract class AbstractResourceInfo {
                 }
             }
             return (ThreadLocalProxy<?>)proxy;
-        } else {
-            return InjectionUtils.createThreadLocalProxy(m.getParameterTypes()[0]);
         }
+        return InjectionUtils.createThreadLocalProxy(m.getParameterTypes()[0]);
     }
 
     @SuppressWarnings("unchecked")
@@ -194,9 +192,8 @@ public abstract class AbstractResourceInfo {
     public Map<Class<?>, ThreadLocalProxy<?>> getConstructorProxies() {
         if (constructorProxiesAvailable) {
             return getConstructorProxyMap(false).get(serviceClass);
-        } else {
-            return null;
         }
+        return null;
     }
 
     @SuppressWarnings("unchecked")

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/ApplicationInfo.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/ApplicationInfo.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/ApplicationInfo.java
index 0aa4f7b..f99a11f 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/ApplicationInfo.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/ApplicationInfo.java
@@ -42,11 +42,10 @@ public class ApplicationInfo extends ProviderInfo<Application> {
         Map<String, Object> appProps = super.getProvider().getProperties();
         if (overridingProps.isEmpty()) {
             return appProps;
-        } else {
-            Map<String, Object> props = new HashMap<>(appProps);
-            props.putAll(overridingProps);
-            return props;
         }
+        Map<String, Object> props = new HashMap<>(appProps);
+        props.putAll(overridingProps);
+        return props;
     }
     public void setOverridingProps(Map<String, Object> overridingProps) {
         this.overridingProps = overridingProps;

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/ClassResourceInfo.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/ClassResourceInfo.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/ClassResourceInfo.java
index cfda684..8b6ffad 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/ClassResourceInfo.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/ClassResourceInfo.java
@@ -198,9 +198,8 @@ public class ClassResourceInfo extends BeanResourceInfo {
     public Set<String> getNameBindings() {
         if (parent == null) {
             return nameBindings;
-        } else {
-            return parent.getNameBindings();
         }
+        return parent.getNameBindings();
     }
 
     public void setNameBindings(Set<String> names) {
@@ -260,9 +259,8 @@ public class ClassResourceInfo extends BeanResourceInfo {
         Produces produces = AnnotationUtils.getClassAnnotation(getServiceClass(), Produces.class);
         if (produces != null || parent == null) {
             return JAXRSUtils.getProduceTypes(produces);
-        } else {
-            return parent.getProduceMime();
         }
+        return parent.getProduceMime();
     }
 
     public List<MediaType> getConsumeMime() {
@@ -272,9 +270,8 @@ public class ClassResourceInfo extends BeanResourceInfo {
         Consumes consumes = AnnotationUtils.getClassAnnotation(getServiceClass(), Consumes.class);
         if (consumes != null || parent == null) {
             return JAXRSUtils.getConsumeTypes(consumes);
-        } else {
-            return parent.getConsumeMime();
         }
+        return parent.getConsumeMime();
     }
 
     public Path getPath() {
@@ -285,9 +282,8 @@ public class ClassResourceInfo extends BeanResourceInfo {
     public boolean isSingleton() {
         if (parent == null) {
             return resourceProvider != null && resourceProvider.isSingleton();
-        } else {
-            return parent.isSingleton();
         }
+        return parent.isSingleton();
     }
 
     public void setParent(ClassResourceInfo parent) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/OperationResourceInfo.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/OperationResourceInfo.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/OperationResourceInfo.java
index 76efb88..48ec5cf 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/OperationResourceInfo.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/OperationResourceInfo.java
@@ -146,11 +146,10 @@ public class OperationResourceInfo {
         Set<String> criNames = classResourceInfo.getNameBindings();
         if (criNames.isEmpty()) {
             return nameBindings;
-        } else {
-            Set<String> all = new LinkedHashSet<String>(criNames);
-            all.addAll(nameBindings);
-            return all;
         }
+        Set<String> all = new LinkedHashSet<String>(criNames);
+        all.addAll(nameBindings);
+        return all;
     }
 
     private void checkOneway() {

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/Parameter.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/Parameter.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/Parameter.java
index 33aeb86..eb6d464 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/Parameter.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/Parameter.java
@@ -98,8 +98,7 @@ public class Parameter {
     public Class<?> getJavaType() {
         if (javaType == null) {
             return type == ParameterType.REQUEST_BODY ? InputStream.class : String.class;
-        } else {
-            return javaType;
         }
+        return javaType;
     }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/URITemplate.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/URITemplate.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/URITemplate.java
index 1d14957..974e819 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/URITemplate.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/URITemplate.java
@@ -478,18 +478,16 @@ public final class URITemplate {
         public boolean matches(String value) {
             if (pattern == null) {
                 return true;
-            } else {
-                return pattern.matcher(value).matches();
             }
+            return pattern.matcher(value).matches();
         }
 
         @Override
         public String getValue() {
             if (pattern != null) {
                 return "{" + name + ":" + pattern + "}";
-            } else {
-                return "{" + name + "}";
             }
+            return "{" + name + "}";
         }
     }
 
@@ -566,9 +564,8 @@ public final class URITemplate {
         public static String stripBraces(String token) {
             if (insideBraces(token)) {
                 return token.substring(1, token.length() - 1);
-            } else {
-                return token;
             }
+            return token;
         }
 
         public boolean hasNext() {
@@ -578,9 +575,8 @@ public final class URITemplate {
         public String next() {
             if (hasNext()) {
                 return tokens.get(tokenIdx++);
-            } else {
-                throw new IllegalStateException("no more elements");
             }
+            throw new IllegalStateException("no more elements");
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/doc/JavaDocProvider.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/doc/JavaDocProvider.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/doc/JavaDocProvider.java
index 90e3b45..7ac4c17 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/doc/JavaDocProvider.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/doc/JavaDocProvider.java
@@ -135,9 +135,8 @@ public class JavaDocProvider implements DocumentationProvider {
             List<String> params = doc.getParamInfo();
             if (paramIndex < params.size()) {
                 return params.get(paramIndex);
-            } else {
-                return null;
             }
+            return null;
         } catch (Exception ex) {
             // ignore
         }
@@ -256,9 +255,8 @@ public class JavaDocProvider implements DocumentationProvider {
                         paramDocs.add(param);
                         if (next == paramString.length()) {
                             break;
-                        } else {
-                            codeIndex = next + 1;
                         }
+                        codeIndex = next + 1;
                         codeIndex = paramString.indexOf(codeTag, codeIndex);
                     }
 
@@ -290,16 +288,14 @@ public class JavaDocProvider implements DocumentationProvider {
     protected String getClassInfoTag() {
         if (javaDocsBuiltByVersion == JAVA_VERSION_16) {
             return "<P>";
-        } else {
-            return "<div class=\"block\">";
         }
+        return "<div class=\"block\">";
     }
     protected String getOperInfoTag() {
         if (javaDocsBuiltByVersion == JAVA_VERSION_16) {
             return "<DD>";
-        } else {
-            return "<div class=\"block\">";
         }
+        return "<div class=\"block\">";
     }
     protected String getOperLink() {
         String operLink = "<A NAME=\"";

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractConfigurableProvider.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractConfigurableProvider.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractConfigurableProvider.java
index 9b15e78..d8e6c3e 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractConfigurableProvider.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractConfigurableProvider.java
@@ -158,9 +158,8 @@ public abstract class AbstractConfigurableProvider {
     protected boolean isPayloadEmpty(HttpHeaders headers) {
         if (headers != null) {
             return isPayloadEmpty(headers.getRequestHeaders());
-        } else {
-            return false;
         }
+        return false;
     }
 
     protected boolean isPayloadEmpty(MultivaluedMap<String, String> headers) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java
index 6ef6b1b..9c6c612 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java
@@ -676,10 +676,9 @@ public abstract class AbstractJAXBProvider<T> extends AbstractConfigurableProvid
 
         if (schema != null) {
             return schema;
-        } else {
-            SchemaHandler handler = schemaHandlers.get(cls.getName());
-            return handler != null ? handler.getSchema() : null;
         }
+        SchemaHandler handler = schemaHandlers.get(cls.getName());
+        return handler != null ? handler.getSchema() : null;
     }
 
 
@@ -815,9 +814,8 @@ public abstract class AbstractJAXBProvider<T> extends AbstractConfigurableProvid
             } catch (XMLStreamException ex) {
                 throw ExceptionUtils.toInternalServerErrorException(ex, null);
             }
-        } else {
-            return reader;
         }
+        return reader;
     }
 
     protected DocumentDepthProperties getDepthProperties() {
@@ -919,20 +917,18 @@ public abstract class AbstractJAXBProvider<T> extends AbstractConfigurableProvid
                                        theList.get(i), adapter, false);
                 }
                 return values;
-            } else {
-                if (!adapterChecked && adapter != null) {
-                    List<Object> newList = new ArrayList<>(theList.size());
-                    for (Object o : theList) {
-                        newList.add(org.apache.cxf.jaxrs.utils.JAXBUtils.useAdapter(o, adapter, false));
-                    }
-                    theList = newList;
-                }
-                if (collectionType == Set.class) {
-                    return new HashSet<>(theList);
-                } else {
-                    return theList;
+            }
+            if (!adapterChecked && adapter != null) {
+                List<Object> newList = new ArrayList<>(theList.size());
+                for (Object o : theList) {
+                    newList.add(org.apache.cxf.jaxrs.utils.JAXBUtils.useAdapter(o, adapter, false));
                 }
+                theList = newList;
+            }
+            if (collectionType == Set.class) {
+                return new HashSet<>(theList);
             }
+            return theList;
         }
 
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/BinaryDataProvider.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/BinaryDataProvider.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/BinaryDataProvider.java
index c08df4e..dcead64 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/BinaryDataProvider.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/BinaryDataProvider.java
@@ -245,9 +245,8 @@ public class BinaryDataProvider<T> extends AbstractConfigurableProvider
         Message message = PhaseInterceptorChain.getCurrentMessage();
         if (message != null) {
             return MessageUtils.isTrue(message.get(HTTP_RANGE_PROPERTY));
-        } else {
-            return false;
         }
+        return false;
     }
 
     public void setReportByteArraySize(boolean report) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/CachingMessageBodyReader.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/CachingMessageBodyReader.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/CachingMessageBodyReader.java
index cd8577d..62751af 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/CachingMessageBodyReader.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/CachingMessageBodyReader.java
@@ -43,9 +43,8 @@ public class CachingMessageBodyReader<T> extends AbstractCachingMessageProvider<
     public boolean isReadable(Class<?> type, Type gType, Annotation[] anns, MediaType mt) {
         if (delegatingReaders != null) {
             return getDelegatingReader(type, gType, anns, mt) != null;
-        } else {
-            return isProviderKeyNotSet();
         }
+        return isProviderKeyNotSet();
     }
 
     private MessageBodyReader<T> getDelegatingReader(Class<?> type, Type gType, Annotation[] anns, MediaType mt) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/CachingMessageBodyWriter.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/CachingMessageBodyWriter.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/CachingMessageBodyWriter.java
index b3613ac..e1b76b2 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/CachingMessageBodyWriter.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/CachingMessageBodyWriter.java
@@ -47,9 +47,8 @@ public class CachingMessageBodyWriter<T> extends AbstractCachingMessageProvider<
     public boolean isWriteable(Class<?> type, Type gType, Annotation[] anns, MediaType mt) {
         if (delegatingWriters != null) {
             return getDelegatingWriter(type, gType, anns, mt) != null;
-        } else {
-            return isProviderKeyNotSet();
         }
+        return isProviderKeyNotSet();
     }
 
     private MessageBodyWriter<T> getDelegatingWriter(Class<?> type, Type gType, Annotation[] anns, MediaType mt) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBAttachmentMarshaller.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBAttachmentMarshaller.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBAttachmentMarshaller.java
index 95dfe3b..1910dce 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBAttachmentMarshaller.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBAttachmentMarshaller.java
@@ -53,9 +53,8 @@ public class JAXBAttachmentMarshaller extends AttachmentMarshaller {
         if (att != null) {
             atts.add(att);
             return "cid:" + att.getId();
-        } else {
-            return null;
         }
+        return null;
 
     }
 
@@ -65,9 +64,8 @@ public class JAXBAttachmentMarshaller extends AttachmentMarshaller {
         if (att != null) {
             atts.add(att);
             return "cid:" + att.getId();
-        } else {
-            return null;
         }
+        return null;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBElementProvider.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBElementProvider.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBElementProvider.java
index 328f63a..966e339 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBElementProvider.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBElementProvider.java
@@ -163,9 +163,8 @@ public class JAXBElementProvider<T> extends AbstractJAXBProvider<T>  {
         if (isPayloadEmpty(headers)) {
             if (AnnotationUtils.getAnnotation(anns, Nullable.class) != null) {
                 return null;
-            } else {
-                reportEmptyContentLength();
             }
+            reportEmptyContentLength();
         }
 
         XMLStreamReader reader = null;
@@ -268,9 +267,8 @@ public class JAXBElementProvider<T> extends AbstractJAXBProvider<T>  {
         reader = createDepthReaderIfNeeded(reader, is);
         if (InjectionUtils.isSupportedCollectionOrArray(type)) {
             return new JAXBCollectionWrapperReader(TransformUtils.createNewReaderIfNeeded(reader, is));
-        } else {
-            return reader;
         }
+        return reader;
 
     }
 
@@ -510,9 +508,8 @@ public class JAXBElementProvider<T> extends AbstractJAXBProvider<T>  {
                 builder = mc.getUriInfo().getBaseUriBuilder();
             }
             return builder.path(path).path(xmlResourceOffset).build().toString();
-        } else {
-            return path;
         }
+        return path;
     }
 
 
@@ -541,9 +538,8 @@ public class JAXBElementProvider<T> extends AbstractJAXBProvider<T>  {
             // TODO: there has to be a better fix
             String propertyName = write ? "WRITE-" + Message.ATTACHMENTS : Message.ATTACHMENTS;
             return CastUtils.cast((Collection<?>)mc.get(propertyName));
-        } else {
-            return null;
         }
+        return null;
     }
     //CHECKSTYLE:OFF
     protected void marshal(Object obj, Class<?> cls, Type genericType,

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/MultipartProvider.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/MultipartProvider.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/MultipartProvider.java
index a14958a..fe6aaff 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/MultipartProvider.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/MultipartProvider.java
@@ -174,9 +174,8 @@ public class MultipartProvider extends AbstractConfigurableProvider
                 && !MessageUtils.isTrue(mc.getContextualProperty(SINGLE_PART_IS_COLLECTION))) {
                 List<Attachment> allMultiparts = AttachmentUtils.getMatchingAttachments(id, infos);
                 return getAttachmentCollection(t, allMultiparts, anns);
-            } else {
-                return fromAttachment(multipart, c, t, anns);
             }
+            return fromAttachment(multipart, c, t, anns);
         }
 
         if (id != null && !id.required()) {
@@ -292,22 +291,20 @@ public class MultipartProvider extends AbstractConfigurableProvider
                 handlers.add(handler);
             }
             return handlers;
-        } else {
-            String rootMediaType = getRootMediaType(anns, mt);
-            if (List.class.isAssignableFrom(obj.getClass())) {
-                return getAttachments((List<?>)obj, rootMediaType);
-            } else {
-                if (MultipartBody.class.isAssignableFrom(type)) {
-                    List<Attachment> atts = ((MultipartBody)obj).getAllAttachments();
-                    // these attachments may have no DataHandlers, but objects only
-                    return getAttachments(atts, rootMediaType);
-                }
-                Attachment handler = createDataHandler(obj,
-                                                       genericType, anns,
-                                                       rootMediaType, mt.toString(), 1);
-                return Collections.singletonList(handler);
-            }
         }
+        String rootMediaType = getRootMediaType(anns, mt);
+        if (List.class.isAssignableFrom(obj.getClass())) {
+            return getAttachments((List<?>)obj, rootMediaType);
+        }
+        if (MultipartBody.class.isAssignableFrom(type)) {
+            List<Attachment> atts = ((MultipartBody)obj).getAllAttachments();
+            // these attachments may have no DataHandlers, but objects only
+            return getAttachments(atts, rootMediaType);
+        }
+        Attachment handler = createDataHandler(obj,
+                                               genericType, anns,
+                                               rootMediaType, mt.toString(), 1);
+        return Collections.singletonList(handler);
     }
 
     private List<Attachment> getAttachments(List<?> objects, String rootMediaType) throws IOException {

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
index 9ceed02..ac5b8dc 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
@@ -279,9 +279,8 @@ public abstract class ProviderFactory {
             ParamConverter<T> converter = pi.getProvider().getConverter(paramType, genericType, anns);
             if (converter != null) {
                 return converter;
-            } else {
-                pi.clearThreadLocalProxies();
             }
+            pi.clearThreadLocalProxies();
         }
         return null;
     }
@@ -380,9 +379,8 @@ public abstract class ProviderFactory {
             }
 
             return interceptors;
-        } else {
-            return null;
         }
+        return null;
     }
 
     public <T> List<WriterInterceptor> createMessageBodyWriterInterceptor(Class<T> bodyType,
@@ -419,9 +417,8 @@ public abstract class ProviderFactory {
             }
 
             return interceptors;
-        } else {
-            return null;
         }
+        return null;
     }
 
 
@@ -1158,9 +1155,8 @@ public abstract class ProviderFactory {
         boolean isApplication = Application.class.isAssignableFrom(c.getDeclaringClass());
         if (isApplication) {
             return new ApplicationInfo((Application)instance, proxies, theBus);
-        } else {
-            return new ProviderInfo<Object>(instance, proxies, theBus, checkContexts, custom);
         }
+        return new ProviderInfo<Object>(instance, proxies, theBus, checkContexts, custom);
     }
 
     protected static class NameKey {

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/RequestDispatcherProvider.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/RequestDispatcherProvider.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/RequestDispatcherProvider.java
index a715500..7624770 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/RequestDispatcherProvider.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/RequestDispatcherProvider.java
@@ -134,9 +134,8 @@ public class RequestDispatcherProvider extends AbstractConfigurableProvider
                                                   RequestDispatcherProvider.class,
                                                   getBus()) != null) {
             return resourceName;
-        } else {
-            return null;
         }
+        return null;
     }
 
     public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mt) {
@@ -173,9 +172,8 @@ public class RequestDispatcherProvider extends AbstractConfigurableProvider
                 }
             }
             return false;
-        } else {
-            return classResources.containsKey(typeName);
         }
+        return classResources.containsKey(typeName);
     }
 
     public void writeTo(Object o, Class<?> clazz, Type genericType, Annotation[] annotations,

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ServerProviderFactory.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ServerProviderFactory.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ServerProviderFactory.java
index 86a417e..ecc5867 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ServerProviderFactory.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ServerProviderFactory.java
@@ -105,9 +105,8 @@ public final class ServerProviderFactory extends ProviderFactory {
         Object provider = createProvider(WADL_PROVIDER_NAME, bus);
         if (provider == null) {
             return null;
-        } else {
-            return new ProviderInfo<ContainerRequestFilter>((ContainerRequestFilter)provider, bus, true);
         }
+        return new ProviderInfo<ContainerRequestFilter>((ContainerRequestFilter)provider, bus, true);
     }
 
     public static ServerProviderFactory getInstance() {
@@ -314,9 +313,8 @@ public final class ServerProviderFactory extends ProviderFactory {
         }
         if (WADL_PROVIDER_NAME.equals(filterCls.getName())) {
             return true;
-        } else {
-            return isWadlGenerator(filterCls.getSuperclass());
         }
+        return isWadlGenerator(filterCls.getSuperclass());
     }
 
     public RequestPreprocessor getRequestPreprocessor() {

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/SourceProvider.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/SourceProvider.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/SourceProvider.java
index 59cc20d..c45d912 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/SourceProvider.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/SourceProvider.java
@@ -105,9 +105,8 @@ public class SourceProvider<T> extends AbstractConfigurableProvider implements
                 } catch (XMLStreamException e) {
                     if (e.getMessage() != null && e.getMessage().startsWith("Maximum Number")) {
                         throw ExceptionUtils.toWebApplicationException(null, JAXRSUtils.toResponse(413));
-                    } else {
-                        throw ExceptionUtils.toBadRequestException(e, null);
                     }
+                    throw ExceptionUtils.toBadRequestException(e, null);
                 } catch (Exception e) {
                     IOException ioex = new IOException("Problem creating a Source object");
                     ioex.setStackTrace(e.getStackTrace());
@@ -153,9 +152,8 @@ public class SourceProvider<T> extends AbstractConfigurableProvider implements
             } catch (XMLStreamException ex) {
                 throw ExceptionUtils.toInternalServerErrorException(ex, null);
             }
-        } else {
-            return reader;
         }
+        return reader;
     }
 
     protected InputStream getRealStream(InputStream is) throws IOException {
@@ -178,9 +176,8 @@ public class SourceProvider<T> extends AbstractConfigurableProvider implements
         MessageContext mc = getContext();
         if (mc != null) {
             return mc.getContent(XMLStreamReader.class);
-        } else {
-            return null;
         }
+        return null;
     }
 
     public void writeTo(T source, Class<?> clazz, Type genericType, Annotation[] annotations,

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/XSLTJaxbProvider.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/XSLTJaxbProvider.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/XSLTJaxbProvider.java
index a533e36..d85a0da 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/XSLTJaxbProvider.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/XSLTJaxbProvider.java
@@ -129,9 +129,8 @@ public class XSLTJaxbProvider<T> extends JAXBElementProvider<T> {
         // is in that list then it can only be handled by the template
         if (inClassCanBeHandled(type.getName()) || inClassesToHandle == null && !supportJaxbOnly) {
             return inTemplatesAvailable(type, anns, mt);
-        } else {
-            return supportJaxbOnly;
         }
+        return supportJaxbOnly;
     }
 
     @Override
@@ -148,9 +147,8 @@ public class XSLTJaxbProvider<T> extends JAXBElementProvider<T> {
         // is in that list then it can only be handled by the template
         if (outClassCanBeHandled(type.getName()) || outClassesToHandle == null && !supportJaxbOnly) {
             return outTemplatesAvailable(type, anns, mt);
-        } else {
-            return supportJaxbOnly;
         }
+        return supportJaxbOnly;
     }
 
     protected boolean inTemplatesAvailable(Class<?> cls, Annotation[] anns, MediaType mt) {
@@ -443,10 +441,9 @@ public class XSLTJaxbProvider<T> extends JAXBElementProvider<T> {
         if (templates == null) {
             if (supportJaxbOnly) {
                 return null;
-            } else {
-                LOG.severe("No template is available");
-                throw ExceptionUtils.toInternalServerErrorException(null, null);
             }
+            LOG.severe("No template is available");
+            throw ExceptionUtils.toInternalServerErrorException(null, null);
         }
 
         TemplatesImpl templ = new TemplatesImpl(templates, uriResolver);

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/security/JAASAuthenticationFilter.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/security/JAASAuthenticationFilter.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/security/JAASAuthenticationFilter.java
index fbdbac4..cbf383f 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/security/JAASAuthenticationFilter.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/security/JAASAuthenticationFilter.java
@@ -139,28 +139,27 @@ public class JAASAuthenticationFilter implements ContainerRequestFilter {
 
             return Response.status(getRedirectStatus()).
                     header(HttpHeaders.LOCATION, finalRedirectURI).build();
-        } else {
-            ResponseBuilder builder = Response.status(Response.Status.UNAUTHORIZED);
+        }
+        ResponseBuilder builder = Response.status(Response.Status.UNAUTHORIZED);
 
-            StringBuilder sb = new StringBuilder();
+        StringBuilder sb = new StringBuilder();
 
-            List<String> authHeader = headers.getRequestHeader(HttpHeaders.AUTHORIZATION);
-            if (authHeader != null && !authHeader.isEmpty()) {
-                // should HttpHeadersImpl do it ?
-                String[] authValues = StringUtils.split(authHeader.get(0), " ");
-                if (authValues.length > 0) {
-                    sb.append(authValues[0]);
-                }
-            } else {
-                sb.append("Basic");
-            }
-            if (realmName != null) {
-                sb.append(" realm=\"").append(realmName).append('"');
+        List<String> authHeader = headers.getRequestHeader(HttpHeaders.AUTHORIZATION);
+        if (authHeader != null && !authHeader.isEmpty()) {
+            // should HttpHeadersImpl do it ?
+            String[] authValues = StringUtils.split(authHeader.get(0), " ");
+            if (authValues.length > 0) {
+                sb.append(authValues[0]);
             }
-            builder.header(HttpHeaders.WWW_AUTHENTICATE, sb.toString());
-
-            return builder.build();
+        } else {
+            sb.append("Basic");
         }
+        if (realmName != null) {
+            sb.append(" realm=\"").append(realmName).append('"');
+        }
+        builder.header(HttpHeaders.WWW_AUTHENTICATE, sb.toString());
+
+        return builder.build();
     }
 
     protected Response.Status getRedirectStatus() {

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java
index 4b34eea..c3c2d5a 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java
@@ -167,17 +167,15 @@ public class CXFNonSpringJaxrsServlet extends CXFNonSpringServlet {
         String param = servletConfig.getInitParameter(PARAMETER_SPLIT_CHAR);
         if (!StringUtils.isEmpty(param) && SPACE_PARAMETER_SPLIT_CHAR.equals(param.trim())) {
             return " ";
-        } else {
-            return DEFAULT_PARAMETER_SPLIT_CHAR;
         }
+        return DEFAULT_PARAMETER_SPLIT_CHAR;
     }
     protected boolean getStaticSubResolutionValue(ServletConfig servletConfig) {
         String param = servletConfig.getInitParameter(STATIC_SUB_RESOLUTION_PARAM);
         if (param != null) {
             return Boolean.valueOf(param.trim());
-        } else {
-            return false;
         }
+        return false;
     }
 
     protected void setExtensions(JAXRSServerFactoryBean bean, ServletConfig servletConfig) {
@@ -391,9 +389,8 @@ public class CXFNonSpringJaxrsServlet extends CXFNonSpringServlet {
                 list.add(value);
             }
             return map;
-        } else {
-            return Collections.emptyMap();
         }
+        return Collections.emptyMap();
     }
 
     protected Map<Class<?>, ResourceProvider> getResourceProviders(ServletConfig servletConfig,

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/AbstractSpringComponentScanServer.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/AbstractSpringComponentScanServer.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/AbstractSpringComponentScanServer.java
index 3e808e6..3d39a46 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/AbstractSpringComponentScanServer.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/AbstractSpringComponentScanServer.java
@@ -212,9 +212,8 @@ public abstract class AbstractSpringComponentScanServer extends AbstractSpringCo
         if (Proxy.isProxyClass(type)) {
             LOG.fine("Can not determine the real class of the component '" + beanName + "'");
             return false;
-        } else {
-            return true;
         }
+        return true;
     }
     protected boolean matchesComponentName(String beanName, Set<String> componentScanBeansSet) {
         return componentScanBeansSet == null || componentScanBeansSet.contains(beanName);

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/AbstractSpringConfigurationFactory.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/AbstractSpringConfigurationFactory.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/AbstractSpringConfigurationFactory.java
index 1ba53ef..ce8b360 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/AbstractSpringConfigurationFactory.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/AbstractSpringConfigurationFactory.java
@@ -79,9 +79,8 @@ public abstract class AbstractSpringConfigurationFactory
     protected String getAddress() {
         if (!StringUtils.isEmpty(jaxrsServerAddress)) {
             return jaxrsServerAddress;
-        } else {
-            return "/";
         }
+        return "/";
     }
 
     protected String getTransportId() {

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/SpringResourceFactory.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/SpringResourceFactory.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/SpringResourceFactory.java
index c748ebc..c55ceba 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/SpringResourceFactory.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/SpringResourceFactory.java
@@ -100,16 +100,15 @@ public class SpringResourceFactory implements ResourceProvider, ApplicationConte
     public Object getInstance(Message m) {
         if (singletonInstance != null) {
             return singletonInstance;
-        } else {
-            ProviderInfo<?> application = m == null ? null
-                : (ProviderInfo<?>)m.getExchange().getEndpoint().get(Application.class.getName());
-            Map<Class<?>, Object> mapValues = CastUtils.cast(application == null ? null
-                : Collections.singletonMap(Application.class, application.getProvider()));
-            Object[] values = ResourceUtils.createConstructorArguments(c, m, !isSingleton(), mapValues);
-            Object instance = values.length > 0 ? ac.getBean(beanId, values) : ac.getBean(beanId);
-            initInstance(m, instance);
-            return instance;
         }
+        ProviderInfo<?> application = m == null ? null
+            : (ProviderInfo<?>)m.getExchange().getEndpoint().get(Application.class.getName());
+        Map<Class<?>, Object> mapValues = CastUtils.cast(application == null ? null
+            : Collections.singletonMap(Application.class, application.getProvider()));
+        Object[] values = ResourceUtils.createConstructorArguments(c, m, !isSingleton(), mapValues);
+        Object instance = values.length > 0 ? ac.getBean(beanId, values) : ac.getBean(beanId);
+        initInstance(m, instance);
+        return instance;
     }
 
     protected void initInstance(Message m, Object instance) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java
index e1b6c35..dc8c8a7 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java
@@ -300,9 +300,8 @@ public final class HttpUtils {
 
         if (locale == null) {
             return new Locale(language);
-        } else {
-            return new Locale(language, locale);
         }
+        return new Locale(language, locale);
 
     }
 
@@ -321,20 +320,19 @@ public final class HttpUtils {
     public static String getHeaderString(List<String> values) {
         if (values == null) {
             return null;
-        } else {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0; i < values.size(); i++) {
-                String value = values.get(i);
-                if (StringUtils.isEmpty(value)) {
-                    continue;
-                }
-                sb.append(value);
-                if (i + 1 < values.size()) {
-                    sb.append(",");
-                }
+        }
+        StringBuilder sb = new StringBuilder();
+        for (int i = 0; i < values.size(); i++) {
+            String value = values.get(i);
+            if (StringUtils.isEmpty(value)) {
+                continue;
+            }
+            sb.append(value);
+            if (i + 1 < values.size()) {
+                sb.append(",");
             }
-            return sb.toString();
         }
+        return sb.toString();
     }
 
     public static boolean isDateRelatedHeader(String headerName) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/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 550bed5..bc05ca1 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
@@ -161,9 +161,8 @@ public final class InjectionUtils {
             ParameterizedType type = (ParameterizedType) scope;
             if (type.getRawType() == declaration) {
                 return type;
-            } else {
-                scope = type.getRawType();
             }
+            scope = type.getRawType();
         }
         if (scope instanceof Class) {
             Class<?> classScope = (Class<?>)scope;
@@ -575,9 +574,8 @@ public final class InjectionUtils {
                                                                BUNDLE,
                                                                cls.getName()).toString());
             throw new WebApplicationException(t, HttpUtils.getParameterFailureStatus(pType));
-        } else {
-            return result;
         }
+        return result;
     }
 
     private static <T> T evaluateFactoryMethod(String value,
@@ -771,22 +769,21 @@ public final class InjectionUtils {
                 }
             }
             return theValues;
-        } else {
-            Map<Object, Object> theValues = new HashMap<>();
-            Class<?> valueType =
-                (Class<?>) InjectionUtils.getType(paramType.getActualTypeArguments(), 1);
-            for (Map.Entry<String, List<String>> processedValuesEntry : processedValues.entrySet()) {
-                List<String> valuesList = processedValuesEntry.getValue();
-                for (String value : valuesList) {
-                    Object o = InjectionUtils.handleParameter(value,
-                                       decoded, valueType, valueType, paramAnns, pathParam, message);
-                    theValues.put(
-                        convertStringToPrimitive(processedValuesEntry.getKey(), keyType),
-                        o);
-                }
+        }
+        Map<Object, Object> theValues = new HashMap<>();
+        Class<?> valueType =
+            (Class<?>) InjectionUtils.getType(paramType.getActualTypeArguments(), 1);
+        for (Map.Entry<String, List<String>> processedValuesEntry : processedValues.entrySet()) {
+            List<String> valuesList = processedValuesEntry.getValue();
+            for (String value : valuesList) {
+                Object o = InjectionUtils.handleParameter(value,
+                                   decoded, valueType, valueType, paramAnns, pathParam, message);
+                theValues.put(
+                    convertStringToPrimitive(processedValuesEntry.getKey(), keyType),
+                    o);
             }
-            return theValues;
         }
+        return theValues;
 
     }
 
@@ -1384,9 +1381,8 @@ public final class InjectionUtils {
         }
         if (param == ParameterType.PATH || param == ParameterType.MATRIX) {
             return HttpUtils.pathDecode(value);
-        } else {
-            return HttpUtils.urlDecode(value);
         }
+        return HttpUtils.urlDecode(value);
     }
 
     public static void invokeLifeCycleMethod(Object instance, Method method) {
@@ -1459,9 +1455,8 @@ public final class InjectionUtils {
         if (targetObject != null) {
             Class<?> targetClass = targetObject.getClass();
             return ClassHelper.getRealClassFromClass(targetClass);
-        } else {
-            return null;
         }
+        return null;
     }
 
     public static Type getGenericResponseType(Method invoked,

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXBUtils.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXBUtils.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXBUtils.java
index e41aa72..20623ec 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXBUtils.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXBUtils.java
@@ -134,9 +134,8 @@ public final class JAXBUtils {
                 XmlAdapter xmlAdapter = typeAdapter.value().newInstance();
                 if (marshal) {
                     return xmlAdapter.marshal(obj);
-                } else {
-                    return xmlAdapter.unmarshal(obj);
                 }
+                return xmlAdapter.unmarshal(obj);
             } catch (Exception ex) {
                 LOG.log(Level.INFO, "(un)marshalling failed, using defaultValue", ex);
             }

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
index 4c286a6..b8a3020 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
@@ -214,18 +214,16 @@ public final class JAXRSUtils {
 
         if (values == null) {
             return getConsumeTypes(provider.getClass().getAnnotation(Consumes.class));
-        } else {
-            return JAXRSUtils.getMediaTypes(values);
         }
+        return JAXRSUtils.getMediaTypes(values);
     }
 
     public static List<MediaType> getProviderProduceTypes(MessageBodyWriter<?> provider) {
         String[] values = getUserMediaTypes(provider, false);
         if (values == null) {
             return getProduceTypes(provider.getClass().getAnnotation(Produces.class));
-        } else {
-            return JAXRSUtils.getMediaTypes(values);
         }
+        return JAXRSUtils.getMediaTypes(values);
     }
 
     public static List<MediaType> getMediaTypes(String[] values) {
@@ -916,17 +914,16 @@ public final class JAXRSUtils {
 
             if ("".equals(key)) {
                 return InjectionUtils.handleBean(pClass, paramAnns, params, ParameterType.MATRIX, m, false);
-            } else {
-                List<String> values = params.get(key);
-                return InjectionUtils.createParameterObject(values,
-                                                            pClass,
-                                                            genericType,
-                                                            paramAnns,
-                                                            defaultValue,
-                                                            false,
-                                                            ParameterType.MATRIX,
-                                                            m);
             }
+            List<String> values = params.get(key);
+            return InjectionUtils.createParameterObject(values,
+                                                        pClass,
+                                                        genericType,
+                                                        paramAnns,
+                                                        defaultValue,
+                                                        false,
+                                                        ParameterType.MATRIX,
+                                                        m);
         }
 
         return null;
@@ -971,19 +968,17 @@ public final class JAXRSUtils {
 
         if ("".equals(key)) {
             return InjectionUtils.handleBean(pClass, paramAnns, params, ParameterType.FORM, m, false);
-        } else {
-            List<String> results = params.get(key);
-
-            return InjectionUtils.createParameterObject(results,
-                                                        pClass,
-                                                        genericType,
-                                                        paramAnns,
-                                                        defaultValue,
-                                                        false,
-                                                        ParameterType.FORM,
-                                                        m);
-
         }
+        List<String> results = params.get(key);
+
+        return InjectionUtils.createParameterObject(results,
+                                                    pClass,
+                                                    genericType,
+                                                    paramAnns,
+                                                    defaultValue,
+                                                    false,
+                                                    ParameterType.FORM,
+                                                    m);
     }
 
 
@@ -1166,17 +1161,16 @@ public final class JAXRSUtils {
     //CHECKSTYLE:ON
         if ("".equals(parameterName)) {
             return InjectionUtils.handleBean(paramType, paramAnns, values, ParameterType.PATH, m, decoded);
-        } else {
-            List<String> results = values.get(parameterName);
-            return InjectionUtils.createParameterObject(results,
-                                                    paramType,
-                                                    genericType,
-                                                    paramAnns,
-                                                    defaultValue,
-                                                    decoded,
-                                                    ParameterType.PATH,
-                                                    m);
         }
+        List<String> results = values.get(parameterName);
+        return InjectionUtils.createParameterObject(results,
+                                                paramType,
+                                                genericType,
+                                                paramAnns,
+                                                defaultValue,
+                                                decoded,
+                                                ParameterType.PATH,
+                                                m);
     }
 
 
@@ -1194,15 +1188,14 @@ public final class JAXRSUtils {
 
         if ("".equals(queryName)) {
             return InjectionUtils.handleBean(paramType, paramAnns, queryMap, ParameterType.QUERY, m, false);
-        } else {
-            return InjectionUtils.createParameterObject(queryMap.get(queryName),
-                                                        paramType,
-                                                        genericType,
-                                                        paramAnns,
-                                                        defaultValue,
-                                                        false,
-                                                        ParameterType.QUERY, m);
         }
+        return InjectionUtils.createParameterObject(queryMap.get(queryName),
+                                                    paramType,
+                                                    genericType,
+                                                    paramAnns,
+                                                    defaultValue,
+                                                    false,
+                                                    ParameterType.QUERY, m);
     }
 
 
@@ -1312,9 +1305,8 @@ public final class JAXRSUtils {
                 } catch (IOException e) {
                     if (e.getClass().getName().equals(NO_CONTENT_EXCEPTION)) {
                         throw ExceptionUtils.toBadRequestException(e, null);
-                    } else {
-                        throw e;
                     }
+                    throw e;
                 } catch (WebApplicationException ex) {
                     throw ex;
                 } catch (Exception ex) {
@@ -1347,14 +1339,13 @@ public final class JAXRSUtils {
                                                                             readers);
 
             return first.aroundReadFrom(context);
-        } else {
-            MessageBodyReader<?> provider = ((ReaderInterceptorMBR)readers.get(0)).getMBR();
-            @SuppressWarnings("rawtypes")
-            Class cls = targetTypeClass;
-            return provider.readFrom(
-                      cls, parameterType, parameterAnnotations, mediaType,
-                      new HttpHeadersImpl(m).getRequestHeaders(), is);
         }
+        MessageBodyReader<?> provider = ((ReaderInterceptorMBR)readers.get(0)).getMBR();
+        @SuppressWarnings("rawtypes")
+        Class cls = targetTypeClass;
+        return provider.readFrom(
+                  cls, parameterType, parameterAnnotations, mediaType,
+                  new HttpHeadersImpl(m).getRequestHeaders(), is);
     }
 
 
@@ -1710,9 +1701,8 @@ public final class JAXRSUtils {
     public static MediaType toMediaType(String value) {
         if (value == null) {
             return ALL_TYPES;
-        } else {
-            return MediaTypeHeaderProvider.valueOf(value);
         }
+        return MediaTypeHeaderProvider.valueOf(value);
     }
 
     public static Response toResponse(int status) {
@@ -1761,9 +1751,8 @@ public final class JAXRSUtils {
                 }
             }
             return r;
-        } else {
-            return response;
         }
+        return response;
     }
 
     public static Message getCurrentMessage() {

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ResourceUtils.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ResourceUtils.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ResourceUtils.java
index 31b38a5..36e1ced 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ResourceUtils.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ResourceUtils.java
@@ -359,10 +359,9 @@ public final class ResourceUtils {
                 }
                 if (m.getReturnType() == Void.TYPE || m.getReturnType() == Void.class) {
                     return true;
-                } else {
-                    reportInvalidResourceMethod(m, NO_VOID_RETURN_ASYNC_MESSAGE_ID, Level.WARNING);
-                    return false;
                 }
+                reportInvalidResourceMethod(m, NO_VOID_RETURN_ASYNC_MESSAGE_ID, Level.WARNING);
+                return false;
             }
         }
         return true;
@@ -899,9 +898,8 @@ public final class ResourceUtils {
             Constructor<?> c = ResourceUtils.findResourceConstructor(cls, false);
             if (c.getParameterTypes().length == 0) {
                 return c.newInstance();
-            } else {
-                return c;
             }
+            return c;
         } catch (Throwable ex) {
             throw new RuntimeException("Provider " + cls.getName() + " can not be created", ex);
         }
@@ -945,9 +943,8 @@ public final class ResourceUtils {
             if (map.contains(s.getClass().getName())) {
                 throw new RuntimeException("More than one instance of the same singleton class "
                                            + s.getClass().getName() + " is available");
-            } else {
-                map.add(s.getClass().getName());
             }
+            map.add(s.getClass().getName());
         }
     }
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/SpecExceptions.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/SpecExceptions.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/SpecExceptions.java
index 5b22e99..d3805ad 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/SpecExceptions.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/SpecExceptions.java
@@ -121,8 +121,7 @@ final class SpecExceptions {
     private static Response checkResponse(Response r, int status) {
         if (r == null) {
             return JAXRSUtils.toResponse(status);
-        } else {
-            return r;
         }
+        return r;
     }
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/multipart/AttachmentUtils.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/multipart/AttachmentUtils.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/multipart/AttachmentUtils.java
index 68793fe..0ad6a43 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/multipart/AttachmentUtils.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/multipart/AttachmentUtils.java
@@ -178,9 +178,8 @@ public final class AttachmentUtils {
                 LOG.warning(errorMsg.toString());
                 throw ExceptionUtils.toBadRequestException(
                           new MultipartReadException(id.value(), id.type(), errorMsg.toString()), null);
-            } else {
-                return null;
             }
+            return null;
         }
 
         return !infos.isEmpty() ? infos.get(0) : null;

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/validation/ValidationExceptionMapper.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/validation/ValidationExceptionMapper.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/validation/ValidationExceptionMapper.java
index d8ea2fb..87a39ca 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/validation/ValidationExceptionMapper.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/validation/ValidationExceptionMapper.java
@@ -60,9 +60,8 @@ public class ValidationExceptionMapper implements ExceptionMapper<ValidationExce
                 errorStatus = Response.Status.BAD_REQUEST;
             }
             return buildResponse(errorStatus, responseBody != null ? responseBody.toString() : null);
-        } else {
-            return buildResponse(errorStatus, addMessageToResponse ? exception.getMessage() : null);
         }
+        return buildResponse(errorStatus, addMessageToResponse ? exception.getMessage() : null);
     }
 
     protected String buildErrorMessage(ConstraintViolation<?> violation) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/validation/ValidationUtils.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/validation/ValidationUtils.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/validation/ValidationUtils.java
index bb10d5b..0dab2aa 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/validation/ValidationUtils.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/validation/ValidationUtils.java
@@ -43,9 +43,8 @@ public final class ValidationUtils {
             String error = "Service object is not a singleton, use a custom invoker to validate";
             LOG.warning(error);
             return null;
-        } else {
-            return resourceProvider.getInstance(message);
         }
+        return resourceProvider.getInstance(message);
     }
 
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/CustomerParameterHandler.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/CustomerParameterHandler.java b/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/CustomerParameterHandler.java
index ff4ab4f..fd3d8cd 100644
--- a/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/CustomerParameterHandler.java
+++ b/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/CustomerParameterHandler.java
@@ -33,9 +33,8 @@ public class CustomerParameterHandler implements ParamConverterProvider, ParamCo
     public <T> ParamConverter<T> getConverter(Class<T> cls, Type arg1, Annotation[] arg2) {
         if (Customer.class == cls) {
             return (ParamConverter<T>)this;
-        } else {
-            return null;
         }
+        return null;
     }
 
     public Customer fromString(String s) throws IllegalArgumentException {

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/ResponseImplTest.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/ResponseImplTest.java b/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/ResponseImplTest.java
index 7ecfa0f..e7b2bc8 100644
--- a/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/ResponseImplTest.java
+++ b/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/ResponseImplTest.java
@@ -468,9 +468,8 @@ public class ResponseImplTest extends Assert {
             throws IllegalArgumentException {
             if (arg0 == StringBean.class) {
                 return (HeaderDelegate<T>) new StringBeanHeaderDelegate();
-            } else {
-                return original.createHeaderDelegate(arg0);
             }
+            return original.createHeaderDelegate(arg0);
         }
 
         @Override

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java b/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java
index ecd3fd5..a67b83f 100644
--- a/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java
+++ b/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java
@@ -211,6 +211,7 @@ public class JAXRSUtilsTest extends Assert {
         assertEquals("customerContext", context.get());
     }
 
+    @SuppressWarnings("cast")
     @Test
     public void testInjectApplicationInSingleton() throws Exception {
         CustomerApplication app = new CustomerApplication();
@@ -231,6 +232,7 @@ public class JAXRSUtilsTest extends Assert {
         assertTrue(proxy.get() instanceof UriInfo);
     }
 
+    @SuppressWarnings("cast")
     @Test
     public void testInjectApplicationInPerRequestResource() throws Exception {
         CustomerApplication app = new CustomerApplication();
@@ -2122,9 +2124,8 @@ public class JAXRSUtilsTest extends Assert {
         public <T> ParamConverter<T> getConverter(Class<T> cls, Type arg1, Annotation[] arg2) {
             if (cls == Locale.class) {
                 return (ParamConverter<T>)this;
-            } else {
-                return null;
             }
+            return null;
         }
 
         public Locale fromString(String s) {
@@ -2148,9 +2149,8 @@ public class JAXRSUtilsTest extends Assert {
         public <T> ParamConverter<T> getConverter(Class<T> cls, Type arg1, Annotation[] arg2) {
             if (cls == Query.class) {
                 return (ParamConverter<T>)this;
-            } else {
-                return null;
             }
+            return null;
         }
 
         public Query<String> fromString(String s) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java
index f6e2e2b..04dad0b 100644
--- a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java
+++ b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/EndpointImpl.java
@@ -836,11 +836,10 @@ public class EndpointImpl extends javax.xml.ws.Endpoint
                                                                 Element... referenceParameters) {
         if (W3CEndpointReference.class.isAssignableFrom(clazz)) {
             return clazz.cast(getEndpointReference(referenceParameters));
-        } else {
-            throw new WebServiceException(new org.apache.cxf.common.i18n.Message(
-                "ENDPOINTREFERENCE_TYPE_NOT_SUPPORTED", LOG, clazz
-                .getName()).toString());
         }
+        throw new WebServiceException(new org.apache.cxf.common.i18n.Message(
+            "ENDPOINTREFERENCE_TYPE_NOT_SUPPORTED", LOG, clazz
+            .getName()).toString());
     }
 
     public void setEndpointContext(EndpointContext ctxt) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WebServiceContextImpl.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WebServiceContextImpl.java b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WebServiceContextImpl.java
index f6a1f01..a363f6e 100644
--- a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WebServiceContextImpl.java
+++ b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WebServiceContextImpl.java
@@ -127,10 +127,9 @@ public class WebServiceContextImpl implements WebServiceContext {
                                                                 Element... referenceParameters) {
         if (W3CEndpointReference.class.isAssignableFrom(clazz)) {
             return clazz.cast(getEndpointReference(referenceParameters));
-        } else {
-            throw new WebServiceException(new Message("ENDPOINTREFERENCE_TYPE_NOT_SUPPORTED",
-                                                      LOG, clazz.getName()).toString());
         }
+        throw new WebServiceException(new Message("ENDPOINTREFERENCE_TYPE_NOT_SUPPORTED",
+                                                  LOG, clazz.getName()).toString());
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WrappedMessageContext.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WrappedMessageContext.java b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WrappedMessageContext.java
index 466dd69..990e02f 100644
--- a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WrappedMessageContext.java
+++ b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/context/WrappedMessageContext.java
@@ -433,9 +433,8 @@ public class WrappedMessageContext implements MessageContext {
             if (tmp != null) {
                 if (MessageContext.HTTP_RESPONSE_HEADERS.equals(key)) {
                     return tmp.put(Message.PROTOCOL_HEADERS, value);
-                } else {
-                    return tmp.put(mappedKey, value);
                 }
+                return tmp.put(mappedKey, value);
             }
         } else if (BindingProvider.USERNAME_PROPERTY.equals(key)) {
             AuthorizationPolicy authPolicy =

http://git-wip-us.apache.org/repos/asf/cxf/blob/903ef61f/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 4223d37..3b91b72 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
@@ -112,9 +112,8 @@ public class ProviderImpl extends javax.xml.ws.spi.Provider {
             Bus bus = BusFactory.getThreadDefaultBus();
             ep = createEndpointImpl(bus, bindingId, implementor);
             return ep;
-        } else {
-            throw new WebServiceException(new Message("INVALID_IMPLEMENTOR_EXC", LOG).toString());
         }
+        throw new WebServiceException(new Message("INVALID_IMPLEMENTOR_EXC", LOG).toString());
     }
     //new in 2.2
     public Endpoint createEndpoint(String bindingId,
@@ -125,9 +124,8 @@ public class ProviderImpl extends javax.xml.ws.spi.Provider {
             Bus bus = BusFactory.getThreadDefaultBus();
             ep = createEndpointImpl(bus, bindingId, implementor, features);
             return ep;
-        } else {
-            throw new WebServiceException(new Message("INVALID_IMPLEMENTOR_EXC", LOG).toString());
         }
+        throw new WebServiceException(new Message("INVALID_IMPLEMENTOR_EXC", LOG).toString());
     }
 
     @Override
@@ -165,9 +163,8 @@ public class ProviderImpl extends javax.xml.ws.spi.Provider {
             EndpointImpl ep = new EndpointImpl(bus, null, factory);
             ep.setImplementorClass(implementorClass);
             return ep;
-        } else {
-            throw new WebServiceException(new Message("INVALID_IMPLEMENTOR_EXC", LOG).toString());
         }
+        throw new WebServiceException(new Message("INVALID_IMPLEMENTOR_EXC", LOG).toString());
     }
 
 
@@ -212,8 +209,6 @@ public class ProviderImpl extends javax.xml.ws.spi.Provider {
                 JAXBUtils.closeUnmarshaller(um);
             }
             return null;
-        } else {
-            //TODO: 200408
         }
         return null;
     }
@@ -382,9 +377,8 @@ public class ProviderImpl extends javax.xml.ws.spi.Provider {
                 Exception e = pae.getException();
                 if (e instanceof JAXBException) {
                     throw (JAXBException)e;
-                } else {
-                    throw new SecurityException(e);
                 }
+                throw new SecurityException(e);
             }
         } catch (Exception e) {
             throw new WebServiceException(new Message("ERROR_UNMARSHAL_ENDPOINTREFERENCE", LOG).toString(),
@@ -424,9 +418,8 @@ public class ProviderImpl extends javax.xml.ws.spi.Provider {
                 throw new WebServiceException(new Message("ERROR_UNMARSHAL_ENDPOINTREFERENCE", LOG)
                                                   .toString(),
                                               e);
-            } else {
-                throw new SecurityException(e);
             }
+            throw new SecurityException(e);
         }
     }
 


Mime
View raw message