cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r518299 - in /incubator/cxf/trunk/tools2: ./ common/src/main/java/org/apache/cxf/tools/common/ common/src/main/java/org/apache/cxf/tools/common/toolspec/ javato/src/main/java/org/apache/cxf/tools/java2wsdl/ javato/src/main/java/org/apache/c...
Date Wed, 14 Mar 2007 20:09:21 GMT
Author: dkulp
Date: Wed Mar 14 13:09:19 2007
New Revision: 518299

URL: http://svn.apache.org/viewvc?view=rev&rev=518299
Log:
Remove some statics to start attempting to make the tools semi-thread safe


Modified:
    incubator/cxf/trunk/tools2/   (props changed)
    incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/AbstractCXFToolContainer.java
    incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/toolspec/AbstractToolContainer.java
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/JavaToWSDL.java
    incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessor.java
    incubator/cxf/trunk/tools2/validator/src/main/java/org/apache/cxf/tools/validator/WSDLValidator.java
    incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJava.java
    incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java
    incubator/cxf/trunk/tools2/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
    incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/XMLFormatValidator.java
    incubator/cxf/trunk/tools2/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToService.java
    incubator/cxf/trunk/tools2/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToSoap.java
    incubator/cxf/trunk/tools2/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToXML.java
    incubator/cxf/trunk/tools2/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/XSDToWSDL.java

Propchange: incubator/cxf/trunk/tools2/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed Mar 14 13:09:19 2007
@@ -0,0 +1,10 @@
+.pmd
+.checkstyle
+.ruleset
+target
+.settings
+.classpath
+.project
+.wtpmodules
+
+

Modified: incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/AbstractCXFToolContainer.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/AbstractCXFToolContainer.java?view=diff&rev=518299&r1=518298&r2=518299
==============================================================================
--- incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/AbstractCXFToolContainer.java
(original)
+++ incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/AbstractCXFToolContainer.java
Wed Mar 14 13:09:19 2007
@@ -41,7 +41,6 @@
 
 public abstract class AbstractCXFToolContainer extends AbstractToolContainer {
     protected static final Logger LOG = LogUtils.getL7dLogger(AbstractCXFToolContainer.class);
-    private static AbstractCXFToolContainer instance;
     
     private final String name;
     private CommandDocument commandDocument;
@@ -53,12 +52,8 @@
     public AbstractCXFToolContainer(String nm, ToolSpec toolspec) throws Exception {
         super(toolspec);
         name = nm;
-        instance = this;
     }
 
-    public static AbstractCXFToolContainer getInstance() {
-        return instance;
-    }
     public boolean hasInfoOption() throws ToolException {
         commandDocument = getCommandDocument();
         if (commandDocument == null) {
@@ -165,13 +160,13 @@
     }
 
     public void printUsageException(String toolName, BadUsageException ex) {
-        if (getInstance().verbose) {
-            getInstance().outputFullCommandLine();
+        if (verbose) {
+            outputFullCommandLine();
         }
         System.err.println(ex.getMessage());
         System.err.println("Usage : " + toolName + " " + ex.getUsage());
-        if (getInstance().verbose) {
-            getInstance().outputVersion();
+        if (verbose) {
+            outputVersion();
         }
         System.err.println();
     }

Modified: incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/toolspec/AbstractToolContainer.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/toolspec/AbstractToolContainer.java?view=diff&rev=518299&r1=518298&r2=518299
==============================================================================
--- incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/toolspec/AbstractToolContainer.java
(original)
+++ incubator/cxf/trunk/tools2/common/src/main/java/org/apache/cxf/tools/common/toolspec/AbstractToolContainer.java
Wed Mar 14 13:09:19 2007
@@ -34,12 +34,13 @@
 import org.apache.cxf.tools.common.toolspec.parser.CommandLineParser;
 public abstract class AbstractToolContainer implements ToolContainer {
     private static final Logger LOG = LogUtils.getL7dLogger(AbstractToolContainer.class);
-    private static boolean isVerbose;
-    private static String arguments[];
+    
 
     protected ToolSpec toolspec;
     protected ToolContext context;
     
+    private String arguments[];
+    private boolean isVerbose;
     private boolean isQuiet;
     private CommandDocument commandDoc;
     private CommandLineParser parser;
@@ -126,11 +127,11 @@
         return isQuiet;
     }
 
-    public static boolean isVerboseMode() {
+    public boolean isVerboseMode() {
         return isVerbose;
     }
 
-    public static String[] getArgument() {
+    public String[] getArgument() {
         return arguments;
     }
 

Modified: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/JavaToWSDL.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/JavaToWSDL.java?view=diff&rev=518299&r1=518298&r2=518299
==============================================================================
--- incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/JavaToWSDL.java
(original)
+++ incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/JavaToWSDL.java
Wed Mar 14 13:09:19 2007
@@ -39,7 +39,6 @@
 public class JavaToWSDL extends AbstractCXFToolContainer {
    
     private static final String TOOL_NAME = "java2wsdl";
-    private static String[] args;
 
     public JavaToWSDL(ToolSpec toolspec) throws Exception {
         super(TOOL_NAME, toolspec);
@@ -75,10 +74,19 @@
             }
         } catch (ToolException ex) {            
             if (ex.getCause() instanceof BadUsageException) {
-                getInstance().printUsageException(TOOL_NAME, (BadUsageException)ex.getCause());
+                printUsageException(TOOL_NAME, (BadUsageException)ex.getCause());
+                if (isVerboseOn()) {
+                    ex.printStackTrace();
+                }
             }
             throw ex;
         } catch (Exception ex) {
+            System.err.println("Error : " + ex.getMessage());
+            System.err.println();
+            if (isVerboseOn()) {
+                ex.printStackTrace();
+            }
+            
             throw new ToolException(ex.getMessage(), ex.getCause());
         }
     }
@@ -91,25 +99,16 @@
     public static void main(String[] pargs) { 
         try {
             runTool(pargs);
-        } catch (BadUsageException ex) {
-            System.err.println("Error : " + ex.getMessage());
-            getInstance().printUsageException(TOOL_NAME, ex);
-            if (getInstance().isVerboseOn()) {
-                ex.printStackTrace();
-            }
         } catch (Exception ex) {
             System.err.println("Error : " + ex.getMessage());
             System.err.println();
-            if (getInstance().isVerboseOn()) {
-                ex.printStackTrace();
-            }
+            ex.printStackTrace();
         }
     }
     
     public static void runTool(String[] pargs) throws Exception {
-        args = pargs;
         ToolRunner.runTool(JavaToWSDL.class, JavaToWSDL.class
-                .getResourceAsStream("java2wsdl.xml"), false, args);
+                .getResourceAsStream("java2wsdl.xml"), false, pargs);
     }
 
     public void checkParams(ErrorVisitor errors) throws ToolException {

Modified: incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessor.java?view=diff&rev=518299&r1=518298&r2=518299
==============================================================================
--- incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessor.java
(original)
+++ incubator/cxf/trunk/tools2/javato/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessor.java
Wed Mar 14 13:09:19 2007
@@ -101,7 +101,7 @@
     }
 
     public Bus getBus() {
-        return BusFactory.newInstance().getDefaultBus();
+        return BusFactory.getDefaultBus();
     }
 
     public void setEnvironment(ToolContext env) {

Modified: incubator/cxf/trunk/tools2/validator/src/main/java/org/apache/cxf/tools/validator/WSDLValidator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/validator/src/main/java/org/apache/cxf/tools/validator/WSDLValidator.java?view=diff&rev=518299&r1=518298&r2=518299
==============================================================================
--- incubator/cxf/trunk/tools2/validator/src/main/java/org/apache/cxf/tools/validator/WSDLValidator.java
(original)
+++ incubator/cxf/trunk/tools2/validator/src/main/java/org/apache/cxf/tools/validator/WSDLValidator.java
Wed Mar 14 13:09:19 2007
@@ -37,7 +37,6 @@
 public class WSDLValidator extends AbstractCXFToolContainer {
 
     private static final String TOOL_NAME = "wsdlvalidator";
-    private static String[] args;
 
     public WSDLValidator(ToolSpec toolspec) throws Exception {
         super(TOOL_NAME, toolspec);
@@ -59,7 +58,7 @@
                     env.put(ToolConstants.CFG_VERBOSE, Boolean.TRUE);
                 }
 
-                env.put(ToolConstants.CFG_CMD_ARG, args);
+                env.put(ToolConstants.CFG_CMD_ARG, getArgument());
 
               
                 WSDL11Validator wsdlValidator = new WSDL11Validator(null, env);
@@ -70,7 +69,7 @@
         } catch (ToolException ex) {
             System.err.println("Error : " + ex.getMessage());
             if (ex.getCause() instanceof BadUsageException) {
-                getInstance().printUsageException(TOOL_NAME, (BadUsageException)ex.getCause());
+                printUsageException(TOOL_NAME, (BadUsageException)ex.getCause());
             }
             System.err.println();
             if (isVerboseOn()) {
@@ -86,13 +85,9 @@
     }
 
     public static void main(String[] pargs) {
-        args = pargs;
-
         try { 
             ToolRunner.runTool(WSDLValidator.class, WSDLValidator.class
-                .getResourceAsStream("wsdlvalidator.xml"), false, args);
-        } catch (BadUsageException ex) {
-            getInstance().printUsageException(TOOL_NAME, ex);
+                .getResourceAsStream("wsdlvalidator.xml"), false, pargs);
         } catch (Exception ex) {
             System.err.println("Error : " + ex.getMessage());
             System.err.println();

Modified: incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJava.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJava.java?view=diff&rev=518299&r1=518298&r2=518299
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJava.java
(original)
+++ incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJava.java
Wed Mar 14 13:09:19 2007
@@ -38,10 +38,17 @@
     public static final String DEFAULT_FRONTEND_NAME = "jaxws";
     public static final String DEFAULT_DATABINDING_NAME = "jaxb";
     
-    private static String[] args;
+    private String[] args;
     
     private PluginLoader pluginLoader = PluginLoader.getInstance();
 
+    public WSDLToJava() {
+        args = new String[0];
+    }
+    public WSDLToJava(String pargs[]) {
+        args = pargs;
+    }
+    
     private FrontEndProfile loadFrontEnd(String name) {
         if (StringUtils.isEmpty(name)) {
             name = DEFAULT_FRONTEND_NAME;
@@ -100,11 +107,11 @@
                            context);
     }
         
-    protected static boolean isVerbose() {
+    protected boolean isVerbose() {
         return isSet(new String[]{"-V", "-verbose"});
     }
     
-    private static boolean isSet(String[] keys) {
+    private boolean isSet(String[] keys) {
         if (args == null) {
             return false;
         }
@@ -157,22 +164,22 @@
     }
 
     public static void main(String[] pargs) {
-        args = pargs;
 
+        WSDLToJava w2j = new WSDLToJava(pargs);
         try {
             
-            new WSDLToJava().run(new ToolContext());
+            w2j.run(new ToolContext());
             
         } catch (ToolException ex) {
             System.err.println("Error : " + ex.getMessage());
             System.err.println();
-            if (isVerbose()) {
+            if (w2j.isVerbose()) {
                 ex.printStackTrace();
             }
         } catch (Exception ex) {
             System.err.println("Error : " + ex.getMessage());
             System.err.println();
-            if (isVerbose()) {
+            if (w2j.isVerbose()) {
                 ex.printStackTrace();
             }
         }

Modified: incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java?view=diff&rev=518299&r1=518298&r2=518299
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java
(original)
+++ incubator/cxf/trunk/tools2/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java
Wed Mar 14 13:09:19 2007
@@ -84,7 +84,7 @@
     }
 
     public Bus getBus() {
-        return BusFactory.newInstance().getDefaultBus();
+        return BusFactory.getDefaultBus();
     }
     
     @SuppressWarnings("unchecked")
@@ -176,7 +176,7 @@
             
         } catch (ToolException ex) {
             if (ex.getCause() instanceof BadUsageException) {
-                getInstance().printUsageException(toolName, (BadUsageException)ex.getCause());
+                printUsageException(toolName, (BadUsageException)ex.getCause());
             }
             System.err.println();
             if (isVerboseOn()) {
@@ -213,8 +213,7 @@
             }
         } else {
             for (Iterator<QName> ite = definition.getServices().keySet().iterator();
ite.hasNext();) {
-                QName defatultQn = ite.next();
-                return defatultQn;
+                return ite.next();
             }
         }
         if (qname == null) {

Modified: incubator/cxf/trunk/tools2/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java?view=diff&rev=518299&r1=518298&r2=518299
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
(original)
+++ incubator/cxf/trunk/tools2/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
Wed Mar 14 13:09:19 2007
@@ -61,7 +61,8 @@
 
 public class JAXBDataBinding implements DataBindingProfile {
     private static final Logger LOG = LogUtils.getL7dLogger(JAXBDataBinding.class);
-    private static S2JJAXBModel rawJaxbModelGenCode;
+    
+    private S2JJAXBModel rawJaxbModelGenCode;
     private ToolContext env;
     private ServiceInfo serviceInfo;
     private Definition def;

Modified: incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/XMLFormatValidator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/XMLFormatValidator.java?view=diff&rev=518299&r1=518298&r2=518299
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/XMLFormatValidator.java
(original)
+++ incubator/cxf/trunk/tools2/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/XMLFormatValidator.java
Wed Mar 14 13:09:19 2007
@@ -55,10 +55,9 @@
             for (BindingInfo binding : bindings) {
                 System.err.println(binding.getBindingId());
                 System.err.println(WSDLConstants.XML_BINDING_NS);
-                if (WSDLConstants.XML_BINDING_NS.equalsIgnoreCase(binding.getBindingId()))
{
-                    if (!checkXMLFormat(binding)) {
-                        return false;
-                    }
+                if (WSDLConstants.XML_BINDING_NS.equalsIgnoreCase(binding.getBindingId())
+                    && !checkXMLFormat(binding)) {
+                    return false;
                 }
             }
         }

Modified: incubator/cxf/trunk/tools2/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToService.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToService.java?view=diff&rev=518299&r1=518298&r2=518299
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToService.java
(original)
+++ incubator/cxf/trunk/tools2/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToService.java
Wed Mar 14 13:09:19 2007
@@ -38,7 +38,6 @@
 public class WSDLToService extends AbstractCXFToolContainer {
 
     static final String TOOL_NAME = "wsdl2service";
-    private static String[] args;
 
     public WSDLToService(ToolSpec toolspec) throws Exception {
         super(TOOL_NAME, toolspec);
@@ -60,7 +59,7 @@
                     env.put(ToolConstants.CFG_VERBOSE, Boolean.TRUE);
                 }
 
-                env.put(ToolConstants.CFG_CMD_ARG, args);
+                env.put(ToolConstants.CFG_CMD_ARG, getArgument());
 
                 validate(env);
 
@@ -70,7 +69,7 @@
         } catch (ToolException ex) {
             System.err.println("Error : " + ex.getMessage());
             if (ex.getCause() instanceof BadUsageException) {
-                getInstance().printUsageException(TOOL_NAME, (BadUsageException)ex.getCause());
+                printUsageException(TOOL_NAME, (BadUsageException)ex.getCause());
             }
             System.err.println();
             if (isVerboseOn()) {
@@ -101,12 +100,9 @@
     }
 
     public static void main(String[] pargs) {
-        args = pargs;
         try {
             ToolRunner.runTool(WSDLToService.class, WSDLToService.class
-                .getResourceAsStream("wsdl2service.xml"), false, args);
-        } catch (BadUsageException ex) {
-            getInstance().printUsageException(TOOL_NAME, ex);
+                .getResourceAsStream("wsdl2service.xml"), false, pargs);
         } catch (Exception ex) {
             System.err.println("Error : " + ex.getMessage());
             System.err.println();

Modified: incubator/cxf/trunk/tools2/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToSoap.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToSoap.java?view=diff&rev=518299&r1=518298&r2=518299
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToSoap.java
(original)
+++ incubator/cxf/trunk/tools2/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToSoap.java
Wed Mar 14 13:09:19 2007
@@ -42,8 +42,6 @@
     static final String STYLE_DEF_VALUE = "document";
     static final String USE_DEF_VALUE = "literal";
     
-    private static String[] args;
-
     public WSDLToSoap(ToolSpec toolspec) throws Exception {
         super(TOOL_NAME, toolspec);
     }
@@ -62,7 +60,7 @@
                 if (isVerboseOn()) {
                     env.put(ToolConstants.CFG_VERBOSE, Boolean.TRUE);
                 }
-                env.put(ToolConstants.CFG_CMD_ARG, args);
+                env.put(ToolConstants.CFG_CMD_ARG, getArgument());
 
                 validate(env);       
                 setEnvParamDefValues(env);
@@ -73,7 +71,7 @@
         } catch (ToolException ex) {
             System.err.println("Error : " + ex.getMessage());
             if (ex.getCause() instanceof BadUsageException) {
-                getInstance().printUsageException(TOOL_NAME, (BadUsageException)ex.getCause());
+                printUsageException(TOOL_NAME, (BadUsageException)ex.getCause());
             }
             System.err.println();
             if (isVerboseOn()) {
@@ -116,14 +114,11 @@
     }
 
     public static void main(String[] pargs) {
-        args = pargs;
         try {
             ToolRunner.runTool(WSDLToSoap.class,
                                WSDLToSoap.class.getResourceAsStream("wsdl2soap.xml"),
                                false,
-                               args);
-        } catch (BadUsageException ex) {
-            getInstance().printUsageException(TOOL_NAME, ex);
+                               pargs);
         } catch (Exception ex) {
             System.err.println("Error : " + ex.getMessage());
             System.err.println();

Modified: incubator/cxf/trunk/tools2/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToXML.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToXML.java?view=diff&rev=518299&r1=518298&r2=518299
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToXML.java
(original)
+++ incubator/cxf/trunk/tools2/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/WSDLToXML.java
Wed Mar 14 13:09:19 2007
@@ -42,8 +42,6 @@
     static final String SERVICE_NAME_POSFIX = "_XMLService";
     static final String PORT_NAME_POSFIX = "_XMLPort";
     
-    private static String[] args;
-
     public WSDLToXML(ToolSpec toolspec) throws Exception {
         super(TOOL_NAME, toolspec);
     }
@@ -62,7 +60,7 @@
                 if (isVerboseOn()) {
                     env.put(ToolConstants.CFG_VERBOSE, Boolean.TRUE);
                 }
-                env.put(ToolConstants.CFG_CMD_ARG, args);
+                env.put(ToolConstants.CFG_CMD_ARG, getArgument());
 
                 validate(env);       
                 setEnvParamDefValues(env);
@@ -74,7 +72,7 @@
             ex.printStackTrace();
             System.err.println("Error : " + ex.getMessage());
             if (ex.getCause() instanceof BadUsageException) {
-                getInstance().printUsageException(TOOL_NAME, (BadUsageException)ex.getCause());
+                printUsageException(TOOL_NAME, (BadUsageException)ex.getCause());
             }
             System.err.println();
             if (isVerboseOn()) {
@@ -118,14 +116,11 @@
     }
 
     public static void main(String[] pargs) {
-        args = pargs;
         try {
             ToolRunner.runTool(WSDLToXML.class,
                                WSDLToXML.class.getResourceAsStream("wsdl2xml.xml"),
                                false,
-                               args);
-        } catch (BadUsageException ex) {
-            getInstance().printUsageException(TOOL_NAME, ex);
+                               pargs);
         } catch (Exception ex) {
             System.err.println("Error : " + ex.getMessage());
             System.err.println();

Modified: incubator/cxf/trunk/tools2/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/XSDToWSDL.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools2/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/XSDToWSDL.java?view=diff&rev=518299&r1=518298&r2=518299
==============================================================================
--- incubator/cxf/trunk/tools2/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/XSDToWSDL.java
(original)
+++ incubator/cxf/trunk/tools2/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/XSDToWSDL.java
Wed Mar 14 13:09:19 2007
@@ -40,8 +40,6 @@
 
     static final String TOOL_NAME = "xsd2wsdl";
 
-    private static String[] args;
-
     public XSDToWSDL(ToolSpec toolspec) throws Exception {
         super(TOOL_NAME, toolspec);
     }
@@ -60,7 +58,7 @@
                 if (isVerboseOn()) {
                     env.put(ToolConstants.CFG_VERBOSE, Boolean.TRUE);
                 }
-                env.put(ToolConstants.CFG_CMD_ARG, args);
+                env.put(ToolConstants.CFG_CMD_ARG, getArgument());
                 validate(env);
                 processor.setEnvironment(env);
                 processor.process();
@@ -68,7 +66,7 @@
         } catch (ToolException ex) {
             System.err.println("Error : " + ex.getMessage());
             if (ex.getCause() instanceof BadUsageException) {
-                getInstance().printUsageException(TOOL_NAME, (BadUsageException)ex.getCause());
+                printUsageException(TOOL_NAME, (BadUsageException)ex.getCause());
             }
             System.err.println();
             if (isVerboseOn()) {
@@ -100,12 +98,9 @@
     }
 
     public static void main(String[] pargs) {
-        args = pargs;
         try {
             ToolRunner.runTool(XSDToWSDL.class, XSDToWSDL.class
-                .getResourceAsStream("xsd2wsdl.xml"), false, args);
-        } catch (BadUsageException ex) {
-            getInstance().printUsageException(TOOL_NAME, ex);
+                .getResourceAsStream("xsd2wsdl.xml"), false, pargs);
         } catch (Exception ex) {
             System.err.println("Error : " + ex.getMessage());
             System.err.println();



Mime
View raw message