You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2017/08/04 17:45:45 UTC

[3/4] cxf-xjc-utils git commit: Fix some eclipse warnings

Fix some eclipse warnings


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

Branch: refs/heads/master
Commit: 0a64eeb9ee8e6adcb4d9fd68d40622d5ea50f36a
Parents: 1a9ba9e
Author: Daniel Kulp <dk...@apache.org>
Authored: Fri Aug 4 13:43:54 2017 -0400
Committer: Daniel Kulp <dk...@apache.org>
Committed: Fri Aug 4 13:43:54 2017 -0400

----------------------------------------------------------------------
 .../org/apache/cxf/maven_plugin/AbstractXSDToJavaMojo.java     | 3 +--
 .../main/java/org/apache/cxf/xjc/javadoc/PropertyJavadoc.java  | 5 ++---
 .../java/org/apache/cxf/xjc/runtime/JAXBToStringStyle.java     | 5 ++---
 .../java/org/apache/cxf/xjc/wsdlextension/WSDLExtension.java   | 6 +++---
 4 files changed, 8 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-xjc-utils/blob/0a64eeb9/cxf-xjc-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractXSDToJavaMojo.java
----------------------------------------------------------------------
diff --git a/cxf-xjc-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractXSDToJavaMojo.java b/cxf-xjc-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractXSDToJavaMojo.java
index 8d4a087..207a63d 100644
--- a/cxf-xjc-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractXSDToJavaMojo.java
+++ b/cxf-xjc-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractXSDToJavaMojo.java
@@ -131,9 +131,8 @@ public abstract class AbstractXSDToJavaMojo extends AbstractMojo {
                         file = new File(s).getAbsoluteFile();
                         if (file.getParentFile().exists()) {
                             return file.toURI();
-                        } else {
-                            throw use;
                         }
+                        throw use;
                     }
                 }
             }

http://git-wip-us.apache.org/repos/asf/cxf-xjc-utils/blob/0a64eeb9/javadoc/src/main/java/org/apache/cxf/xjc/javadoc/PropertyJavadoc.java
----------------------------------------------------------------------
diff --git a/javadoc/src/main/java/org/apache/cxf/xjc/javadoc/PropertyJavadoc.java b/javadoc/src/main/java/org/apache/cxf/xjc/javadoc/PropertyJavadoc.java
index 297d9a0..4ecc890 100644
--- a/javadoc/src/main/java/org/apache/cxf/xjc/javadoc/PropertyJavadoc.java
+++ b/javadoc/src/main/java/org/apache/cxf/xjc/javadoc/PropertyJavadoc.java
@@ -118,10 +118,9 @@ public class PropertyJavadoc {
         if (options.enableIntrospection) {
             return ((type.isPrimitive() && type.boxify().getPrimitiveType() == codeModel.BOOLEAN)
                 ? "is" : "get") + fieldOutline.getPropertyInfo().getName(true);
-        } else {
-            return (type.boxify().getPrimitiveType() == codeModel.BOOLEAN ? "is" : "get")
-                   + fieldOutline.getPropertyInfo().getName(true);
         }
+        return (type.boxify().getPrimitiveType() == codeModel.BOOLEAN ? "is" : "get")
+               + fieldOutline.getPropertyInfo().getName(true);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/cxf-xjc-utils/blob/0a64eeb9/runtime/src/main/java/org/apache/cxf/xjc/runtime/JAXBToStringStyle.java
----------------------------------------------------------------------
diff --git a/runtime/src/main/java/org/apache/cxf/xjc/runtime/JAXBToStringStyle.java b/runtime/src/main/java/org/apache/cxf/xjc/runtime/JAXBToStringStyle.java
index f0cf677..94bf373 100644
--- a/runtime/src/main/java/org/apache/cxf/xjc/runtime/JAXBToStringStyle.java
+++ b/runtime/src/main/java/org/apache/cxf/xjc/runtime/JAXBToStringStyle.java
@@ -21,7 +21,6 @@ package org.apache.cxf.xjc.runtime;
 
 import javax.xml.bind.JAXBElement;
 
-import org.apache.commons.lang3.SystemUtils;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 
@@ -55,9 +54,9 @@ class JAXBToStringStyleImpl extends ToStringStyle {
         super();
         if (multiLine) {
             this.setContentStart("[");
-            this.setFieldSeparator(SystemUtils.LINE_SEPARATOR + "  ");
+            this.setFieldSeparator(System.lineSeparator() + "  ");
             this.setFieldSeparatorAtStart(true);
-            this.setContentEnd(SystemUtils.LINE_SEPARATOR + "]");
+            this.setContentEnd(System.lineSeparator() + "]");
         } else {
             // simple
             this.setUseClassName(false);

http://git-wip-us.apache.org/repos/asf/cxf-xjc-utils/blob/0a64eeb9/wsdlextension/src/main/java/org/apache/cxf/xjc/wsdlextension/WSDLExtension.java
----------------------------------------------------------------------
diff --git a/wsdlextension/src/main/java/org/apache/cxf/xjc/wsdlextension/WSDLExtension.java b/wsdlextension/src/main/java/org/apache/cxf/xjc/wsdlextension/WSDLExtension.java
index 61a5656..e5fd374 100644
--- a/wsdlextension/src/main/java/org/apache/cxf/xjc/wsdlextension/WSDLExtension.java
+++ b/wsdlextension/src/main/java/org/apache/cxf/xjc/wsdlextension/WSDLExtension.java
@@ -35,7 +35,7 @@ import com.sun.codemodel.JExpr;
 import com.sun.codemodel.JFieldVar;
 import com.sun.codemodel.JMethod;
 import com.sun.codemodel.JMod;
-import com.sun.codemodel.JPrimitiveType;
+import com.sun.codemodel.JType;
 import com.sun.tools.xjc.BadCommandLineException;
 import com.sun.tools.xjc.Options;
 import com.sun.tools.xjc.outline.ClassOutline;
@@ -87,7 +87,7 @@ public class WSDLExtension {
                                                              "getElementType");
         getElementTypeMethod.body()._return(JExpr.direct("elementType"));
 
-        JMethod setElementTypeMethod = implementation.method(JMod.PUBLIC, JPrimitiveType.parse(co
+        JMethod setElementTypeMethod = implementation.method(JMod.PUBLIC, JType.parse(co
             .parent().getCodeModel(), "void"), "setElementType");
         setElementTypeMethod.param(QName.class, "type");
         setElementTypeMethod.body().directStatement("this.elementType = type;");
@@ -96,7 +96,7 @@ public class WSDLExtension {
                                                              "getRequired");
         getRequiredMethod.body()._return(JExpr.direct("required == null ? false : required"));
 
-        JMethod setRequiredMethod = implementation.method(JMod.PUBLIC, JPrimitiveType.parse(co
+        JMethod setRequiredMethod = implementation.method(JMod.PUBLIC, JType.parse(co
             .parent().getCodeModel(), "void"), "setRequired");
         setRequiredMethod.param(Boolean.class, "required");
         setRequiredMethod.body().directStatement("this.required = required;");