Fixing situations where all eclipse tests would fail.

This is another one of those: Wait.. this does not work and never has? bug. Fixed, at any rate. If _every_ eclipse test throws NPE, this fix is for you.
This commit is contained in:
Reinier Zwitserloot
2022-01-14 02:32:46 +01:00
parent 2685d37748
commit daee44decf
+5 -5
View File
@@ -239,11 +239,6 @@ public class RunTestsViaEcj extends AbstractRunTests {
private FileSystem createFileSystem(File file, int minVersion) {
List<String> classpath = new ArrayList<String>();
for (Iterator<String> i = classpath.iterator(); i.hasNext();) {
if (FileSystem.getClasspath(i.next(), "UTF-8", null) == null) {
i.remove();
}
}
if (new File("bin/main").exists()) classpath.add("bin/main");
classpath.add("dist/lombok.jar");
classpath.add("build/teststubs");
@@ -255,6 +250,11 @@ public class RunTestsViaEcj extends AbstractRunTests {
if (!fn.substring(fn.length() - 4).toLowerCase().equals(".jar")) continue;
classpath.add("lib/test/" + fn);
}
for (Iterator<String> i = classpath.iterator(); i.hasNext();) {
if (FileSystem.getClasspath(i.next(), "UTF-8", null) == null) {
i.remove();
}
}
return new FileSystem(classpath.toArray(new String[0]), new String[] {file.getAbsolutePath()}, "UTF-8");
}