This is an automated email from the ASF dual-hosted git repository. jensdeppe pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git
The following commit(s) were added to refs/heads/develop by this push: new 876c84c GEODE-6307: Attempt to normalize file paths for correct comparison (#3104) 876c84c is described below commit 876c84c925c198c494341b572e31ad9a244c2b92 Author: Jens Deppe <jde...@pivotal.io> AuthorDate: Wed Jan 23 08:06:39 2019 -0800 GEODE-6307: Attempt to normalize file paths for correct comparison (#3104) - Trying to fix an issue with AnalyzeSerializablesJUnitTest on Windows and JDK 11. --- .../codeAnalysis/AnalyzeSerializablesJUnitTestBase.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/geode-junit/src/main/java/org/apache/geode/codeAnalysis/AnalyzeSerializablesJUnitTestBase.java b/geode-junit/src/main/java/org/apache/geode/codeAnalysis/AnalyzeSerializablesJUnitTestBase.java index fab9981..8d493ba 100644 --- a/geode-junit/src/main/java/org/apache/geode/codeAnalysis/AnalyzeSerializablesJUnitTestBase.java +++ b/geode-junit/src/main/java/org/apache/geode/codeAnalysis/AnalyzeSerializablesJUnitTestBase.java @@ -36,6 +36,7 @@ import java.lang.reflect.Constructor; import java.lang.reflect.Modifier; import java.nio.file.Paths; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; @@ -45,6 +46,7 @@ import java.util.Map; import java.util.Properties; import java.util.ServiceLoader; import java.util.Set; +import java.util.stream.Collectors; import org.apache.commons.lang3.JavaVersion; import org.apache.commons.lang3.SystemUtils; @@ -428,16 +430,20 @@ public abstract class AnalyzeSerializablesJUnitTestBase { String classpath = System.getProperty("java.class.path"); System.out.println("java classpath is " + classpath); - String[] entries = classpath.split(File.pathSeparator); + List<File> entries = + Arrays.stream(classpath.split(File.pathSeparator)).map(x -> new File(x)).collect( + Collectors.toList()); String gradleBuildDirName = Paths.get(getModuleName(), "build", "classes", "java", "main").toString(); + System.out.println("gradleBuildDirName is " + gradleBuildDirName); String ideaBuildDirName = Paths.get(getModuleName(), "out", "production", "classes").toString(); String buildDir = null; - for (String entry : entries) { + for (File entry : entries) { System.out.println("examining '" + entry + "'"); - if (entry.endsWith(gradleBuildDirName) || entry.endsWith(ideaBuildDirName)) { - buildDir = entry; + if (entry.toString().endsWith(gradleBuildDirName) + || entry.toString().endsWith(ideaBuildDirName)) { + buildDir = entry.toString(); break; } }