ffang commented on a change in pull request #558: CXF-8049: Enclosing class path entries that contain whitespaces in double quotes URL: https://github.com/apache/cxf/pull/558#discussion_r288163673
########## File path: core/src/main/java/org/apache/cxf/common/util/Compiler.java ########## @@ -85,6 +85,31 @@ public void setClassPath(String s) { classPath = StringUtils.isEmpty(s) ? null : s; } + // https://issues.apache.org/jira/browse/CXF-8049 + private String getSystemClassPath() { + String javaClasspath = SystemPropertyAction.getProperty("java.class.path"); + + if (!StringUtils.isEmpty(javaClasspath)) { + List<String> correctedEntries = new ArrayList<>(); + + String[] toks = javaClasspath.split(File.pathSeparator); + + for (String tok: toks) { + // if any classpath entry contains a whitespace char, + // enclose the entry in double quotes + if (tok.matches(".*\\s+.*")) { + correctedEntries.add("\"" + tok + "\""); + } else { + correctedEntries.add(tok); + } + } + + return String.join(File.pathSeparator, correctedEntries); + } + + return ""; Review comment: +1 @coheigea , sorry I missed your comment and merged the PR, I will make another commit to address accordingly. Cheers Freeman ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services