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 elses and static references in maven-plugins
Date Fri, 04 Aug 2017 16:07:31 GMT
Fix unecessary elses and static references in maven-plugins


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

Branch: refs/heads/master
Commit: bb5f3b264c4d16b5545360b9c8a84138676a7c0a
Parents: 813c06f
Author: Daniel Kulp <dkulp@apache.org>
Authored: Fri Aug 4 10:21:21 2017 -0400
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Fri Aug 4 10:40:44 2017 -0400

----------------------------------------------------------------------
 .../cxf/maven_plugin/AbstractCodegenMoho.java   | 43 ++++++++++----------
 .../wsdl2java/WsdlOptionLoader.java             |  3 +-
 .../maven_plugin/javatowadl/DumpJavaDoc.java    |  3 +-
 .../maven_plugin/javatowadl/Java2WADLMojo.java  |  5 +--
 4 files changed, 25 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/bb5f3b26/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractCodegenMoho.java
----------------------------------------------------------------------
diff --git a/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractCodegenMoho.java
b/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractCodegenMoho.java
index 6ae3a3d..c5e5a7f 100644
--- a/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractCodegenMoho.java
+++ b/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractCodegenMoho.java
@@ -434,29 +434,28 @@ public abstract class AbstractCodegenMoho extends AbstractMojo {
 
             if (proxy.getHost() == null) {
                 throw new MojoExecutionException("Proxy in settings.xml has no host");
-            } else {
-                if (proxy.getHost() != null) {
-                    System.setProperty(HTTP_PROXY_HOST, proxy.getHost());
-                }
-                if (String.valueOf(proxy.getPort()) != null) {
-                    System.setProperty(HTTP_PROXY_PORT, String.valueOf(proxy.getPort()));
-                }
-                if (proxy.getNonProxyHosts() != null) {
-                    System.setProperty(HTTP_NON_PROXY_HOSTS, proxy.getNonProxyHosts());
-                }
-                if (!StringUtils.isEmpty(proxy.getUsername())
-                    && !StringUtils.isEmpty(proxy.getPassword())) {
-                    final String authUser = proxy.getUsername();
-                    final String authPassword = proxy.getPassword();
-                    Authenticator.setDefault(new Authenticator() {
-                        public PasswordAuthentication getPasswordAuthentication() {
-                            return new PasswordAuthentication(authUser, authPassword.toCharArray());
-                        }
-                    });
+            }
+            if (proxy.getHost() != null) {
+                System.setProperty(HTTP_PROXY_HOST, proxy.getHost());
+            }
+            if (String.valueOf(proxy.getPort()) != null) {
+                System.setProperty(HTTP_PROXY_PORT, String.valueOf(proxy.getPort()));
+            }
+            if (proxy.getNonProxyHosts() != null) {
+                System.setProperty(HTTP_NON_PROXY_HOSTS, proxy.getNonProxyHosts());
+            }
+            if (!StringUtils.isEmpty(proxy.getUsername())
+                && !StringUtils.isEmpty(proxy.getPassword())) {
+                final String authUser = proxy.getUsername();
+                final String authPassword = proxy.getPassword();
+                Authenticator.setDefault(new Authenticator() {
+                    public PasswordAuthentication getPasswordAuthentication() {
+                        return new PasswordAuthentication(authUser, authPassword.toCharArray());
+                    }
+                });
 
-                    System.setProperty(HTTP_PROXY_USER, authUser);
-                    System.setProperty(HTTP_PROXY_PORT, authPassword);
-                }
+                System.setProperty(HTTP_PROXY_USER, authUser);
+                System.setProperty(HTTP_PROXY_PORT, authPassword);
             }
 
         }

http://git-wip-us.apache.org/repos/asf/cxf/blob/bb5f3b26/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/wsdl2java/WsdlOptionLoader.java
----------------------------------------------------------------------
diff --git a/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/wsdl2java/WsdlOptionLoader.java
b/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/wsdl2java/WsdlOptionLoader.java
index 6444e31..677d94e 100644
--- a/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/wsdl2java/WsdlOptionLoader.java
+++ b/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/wsdl2java/WsdlOptionLoader.java
@@ -58,9 +58,8 @@ public final class WsdlOptionLoader {
         WsdlOption option = new WsdlOption();
         if (WsdlUtilities.fillWsdlOptionFromArtifact(option, artifact, outputDir)) {
             return option;
-        } else {
-            return null;
         }
+        return null;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/cxf/blob/bb5f3b26/maven-plugins/java2wadl-plugin/src/main/java/org/apache/cxf/maven_plugin/javatowadl/DumpJavaDoc.java
----------------------------------------------------------------------
diff --git a/maven-plugins/java2wadl-plugin/src/main/java/org/apache/cxf/maven_plugin/javatowadl/DumpJavaDoc.java
b/maven-plugins/java2wadl-plugin/src/main/java/org/apache/cxf/maven_plugin/javatowadl/DumpJavaDoc.java
index c84eade..8369efc 100644
--- a/maven-plugins/java2wadl-plugin/src/main/java/org/apache/cxf/maven_plugin/javatowadl/DumpJavaDoc.java
+++ b/maven-plugins/java2wadl-plugin/src/main/java/org/apache/cxf/maven_plugin/javatowadl/DumpJavaDoc.java
@@ -96,9 +96,8 @@ public final class DumpJavaDoc {
                 if (foundTagOption) {
                     reporter.printError("Only one -dumpJavaDocFile option allowed.");
                     return false;
-                } else {
-                    foundTagOption = true;
                 }
+                foundTagOption = true;
             }
         }
         if (!foundTagOption) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/bb5f3b26/maven-plugins/java2wadl-plugin/src/main/java/org/apache/cxf/maven_plugin/javatowadl/Java2WADLMojo.java
----------------------------------------------------------------------
diff --git a/maven-plugins/java2wadl-plugin/src/main/java/org/apache/cxf/maven_plugin/javatowadl/Java2WADLMojo.java
b/maven-plugins/java2wadl-plugin/src/main/java/org/apache/cxf/maven_plugin/javatowadl/Java2WADLMojo.java
index 422aae5..8dae3b8 100644
--- a/maven-plugins/java2wadl-plugin/src/main/java/org/apache/cxf/maven_plugin/javatowadl/Java2WADLMojo.java
+++ b/maven-plugins/java2wadl-plugin/src/main/java/org/apache/cxf/maven_plugin/javatowadl/Java2WADLMojo.java
@@ -330,10 +330,9 @@ public class Java2WADLMojo extends AbstractMojo {
     private String getBaseURI() {
         if (address != null) {
             return address;
-        } else {
-            // the consumer may use the original target URI to figure out absolute URI
-            return "/";
         }
+        // the consumer may use the original target URI to figure out absolute URI
+        return "/";
     }
 
 


Mime
View raw message