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 2010/03/12 22:19:03 UTC

svn commit: r922429 - /cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/Compiler.java

Author: dkulp
Date: Fri Mar 12 21:19:00 2010
New Revision: 922429

URL: http://svn.apache.org/viewvc?rev=922429&view=rev
Log:
[CXF-2710] Check if params passed to javac are empty strings, not just
null.

Modified:
    cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/Compiler.java

Modified: cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/Compiler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/Compiler.java?rev=922429&r1=922428&r2=922429&view=diff
==============================================================================
--- cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/Compiler.java (original)
+++ cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/Compiler.java Fri Mar 12 21:19:00 2010
@@ -63,7 +63,7 @@ public class Compiler {
         outputDir = s.replace(File.pathSeparatorChar, '/');
     }
     public void setClassPath(String s) {
-        classPath = s;
+        classPath = StringUtils.isEmpty(s) ? null : s;
     }
     
     private void addArgs(List<String> list) {
@@ -75,17 +75,21 @@ public class Compiler {
             list.add(target);
         }
 
-        if (outputDir != null) {
+        if (!StringUtils.isEmpty(outputDir)) {
             list.add("-d");
             list.add(outputDir);
         }
         
-        if (classPath == null) {
+        if (StringUtils.isEmpty(classPath)) {
             String javaClasspath = System.getProperty("java.class.path");
             boolean classpathSetted = javaClasspath != null ? true : false;
             if (!classpathSetted) {
-                list.add("-extdirs");
-                list.add(getClass().getClassLoader().getResource(".").getFile() + "../lib/");
+                File f = new File(getClass().getClassLoader().getResource(".").getFile());
+                f = new File(f, "../lib");
+                if (f.exists() && f.isDirectory()) {
+                    list.add("-extdirs");
+                    list.add(f.toString());                    
+                }
             } else {
                 list.add("-classpath");
                 list.add(javaClasspath);