[jbossws-commits] JBossWS SVN: r17237 - thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Wed Jan 16 23:40:31 EST 2013


Author: jim.ma
Date: 2013-01-16 23:40:31 -0500 (Wed, 16 Jan 2013)
New Revision: 17237

Modified:
   thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
Log:
JBPAPP-10584:Unable to create JAXBContext for generated packages error on Windows when classpath is empty

Modified: thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java	2013-01-15 00:00:52 UTC (rev 17236)
+++ thirdparty/cxf/branches/cxf-2.2.12/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java	2013-01-17 04:40:31 UTC (rev 17237)
@@ -444,24 +444,26 @@
     }
 
     protected boolean compileJavaSrc(String classPath, List<File> srcList, String dest) {
-        String[] javacCommand = new String[srcList.size() + 7];
+        int i = !StringUtils.isEmpty(classPath) ? 7 : 5;
+        String[] javacCommand = new String[srcList.size() + i];
         
         javacCommand[0] = "javac";
-        javacCommand[1] = "-classpath";
-        javacCommand[2] = classPath;        
-        javacCommand[3] = "-d";
-        javacCommand[4] = dest;
-        javacCommand[5] = "-target";
-        javacCommand[6] = "1.5";
+        javacCommand[1] = "-d";
+        javacCommand[2] = dest;
+        javacCommand[3] = "-target";
+        javacCommand[4] = "1.5";
+        if (!StringUtils.isEmpty(classPath)) {
+            javacCommand[5] = "-classpath";
+            javacCommand[6] = classPath;
+        }
         
-        int i = 7;
         for (File f : srcList) {
             javacCommand[i++] = f.getAbsolutePath();            
         }
         org.apache.cxf.common.util.Compiler javaCompiler 
             = new org.apache.cxf.common.util.Compiler();
         
-        return javaCompiler.internalCompile(javacCommand, 7); 
+        return javaCompiler.internalCompile(javacCommand, i); 
     }
     
     static void addClasspathFromManifest(StringBuilder classPath, File file) 



More information about the jbossws-commits mailing list