Author: thomas.diesler(a)jboss.com
Date: 2008-05-20 20:19:47 -0400 (Tue, 20 May 2008)
New Revision: 7118
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/jaxws/impl/SunRIConsumerImpl.java
Log:
Throw the RTEs
Dont brute force wstx
Restore value of system properties
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/jaxws/impl/SunRIConsumerImpl.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/jaxws/impl/SunRIConsumerImpl.java 2008-05-20
22:58:46 UTC (rev 7117)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/jaxws/impl/SunRIConsumerImpl.java 2008-05-21
00:19:47 UTC (rev 7118)
@@ -209,41 +209,50 @@
args.add(wsdl.toString());
// See WsimportTool#compileGeneratedClasses()
- if(!additionalCompilerClassPath.isEmpty())
+ String orgJavaClassPath = System.getProperty("java.class.path");
+ String javaClassPath = (orgJavaClassPath != null ? orgJavaClassPath :
"");
+ if(additionalCompilerClassPath.isEmpty() == false)
{
- StringBuffer javaCP = new StringBuffer();
- for(String s : additionalCompilerClassPath)
+ for(String pathElement : additionalCompilerClassPath)
{
- javaCP.append(s).append(File.pathSeparator);
+ javaClassPath += pathElement + File.pathSeparator;
}
- System.setProperty("java.class.path", javaCP.toString());
+ System.setProperty("java.class.path", javaClassPath);
}
try
{
- // enforce woodstox
- if (null == System.getProperty("javax.xml.stream.XMLInputFactory"))
- System.setProperty("javax.xml.stream.XMLInputFactory",
"com.ctc.wstx.stax.WstxInputFactory");
-
-
-
WsimportTool compileTool = new WsimportTool(stream);
boolean success = compileTool.run(args.toArray(new String[args.size()]));
if (!success)
throw new IllegalStateException("WsImport invocation failed. Try the
verbose switch for more information");
}
- catch (Throwable t)
+ catch (RuntimeException rte)
{
if (messageStream != null)
{
messageStream.println("Failed to invoke WsImport");
- t.printStackTrace(messageStream);
+ rte.printStackTrace(messageStream);
}
else
{
- t.printStackTrace();
+ rte.printStackTrace();
}
+
+ throw rte;
}
+ finally
+ {
+ // restore the original value of the java.class.path property
+ if (orgJavaClassPath != null)
+ {
+ System.setProperty("java.class.path", orgJavaClassPath);
+ }
+ else
+ {
+ System.clearProperty("java.class.path");
+ }
+ }
}
}
Show replies by date