cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r922429 - /cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/Compiler.java
Date Fri, 12 Mar 2010 21:19:03 GMT
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);



Mime
View raw message