cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r934271 - /cxf/trunk/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/Option.java
Date Thu, 15 Apr 2010 03:04:05 GMT
Author: dkulp
Date: Thu Apr 15 03:04:05 2010
New Revision: 934271

URL: http://svn.apache.org/viewvc?rev=934271&view=rev
Log:
[CXF-2763] Properly merge in options from the defaultOptions

Modified:
    cxf/trunk/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/Option.java

Modified: cxf/trunk/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/Option.java
URL: http://svn.apache.org/viewvc/cxf/trunk/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/Option.java?rev=934271&r1=934270&r2=934271&view=diff
==============================================================================
--- cxf/trunk/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/Option.java
(original)
+++ cxf/trunk/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/Option.java
Thu Apr 15 03:04:05 2010
@@ -379,27 +379,30 @@ public class Option {
         destination.setWsdlVersion(getWsdlVersion());
     }
     
-    private void setIfNull(Object dest, Object source) {
+    private <T> T setIfNull(T dest, T source) {
         if (dest == null) {
             dest = source;
         }
+        return dest;
     }
     
     public void merge(Option defaultOptions) {
-        setIfNull(wsdlList, defaultOptions.wsdlList);
-        setIfNull(extendedSoapHeaders, defaultOptions.extendedSoapHeaders);
-        setIfNull(validateWsdl, defaultOptions.validateWsdl);
-        setIfNull(autoNameResolution, defaultOptions.autoNameResolution);
-        setIfNull(noAddressBinding, defaultOptions.noAddressBinding);
-        setIfNull(allowElementRefs, defaultOptions.allowElementRefs);
-        setIfNull(defaultExcludesNamespace, defaultOptions.defaultExcludesNamespace);
-        setIfNull(defaultNamespacePackageMapping, defaultOptions.defaultNamespacePackageMapping);
-        setIfNull(frontEnd, defaultOptions.frontEnd);
-        setIfNull(dataBinding, defaultOptions.dataBinding);
-        setIfNull(wsdlVersion, defaultOptions.wsdlVersion);
-        setIfNull(catalog, defaultOptions.catalog);
-        setIfNull(serviceName, defaultOptions.serviceName);
-        setIfNull(outputDir, defaultOptions.outputDir);
+        wsdlList = setIfNull(wsdlList, defaultOptions.wsdlList);
+        extendedSoapHeaders = setIfNull(extendedSoapHeaders, defaultOptions.extendedSoapHeaders);
+        validateWsdl = setIfNull(validateWsdl, defaultOptions.validateWsdl);
+        autoNameResolution = setIfNull(autoNameResolution, defaultOptions.autoNameResolution);
+        noAddressBinding = setIfNull(noAddressBinding, defaultOptions.noAddressBinding);
+        allowElementRefs = setIfNull(allowElementRefs, defaultOptions.allowElementRefs);
+        defaultExcludesNamespace = setIfNull(defaultExcludesNamespace, 
+                                             defaultOptions.defaultExcludesNamespace);
+        defaultNamespacePackageMapping = setIfNull(defaultNamespacePackageMapping,
+                                                   defaultOptions.defaultNamespacePackageMapping);
+        frontEnd = setIfNull(frontEnd, defaultOptions.frontEnd);
+        dataBinding = setIfNull(dataBinding, defaultOptions.dataBinding);
+        wsdlVersion = setIfNull(wsdlVersion, defaultOptions.wsdlVersion);
+        catalog = setIfNull(catalog, defaultOptions.catalog);
+        serviceName = setIfNull(serviceName, defaultOptions.serviceName);
+        outputDir = setIfNull(outputDir, defaultOptions.outputDir);
         extraargs.addAll(defaultOptions.extraargs);
         xjcargs.addAll(defaultOptions.xjcargs);
         bindingFiles = mergeList(bindingFiles, defaultOptions.bindingFiles, String.class);



Mime
View raw message