aboutsummaryrefslogtreecommitdiff
path: root/test/core/src
diff options
context:
space:
mode:
Diffstat (limited to 'test/core/src')
-rw-r--r--test/core/src/lombok/LombokTestSource.java8
-rw-r--r--test/core/src/lombok/RunTestsViaEcj.java53
2 files changed, 10 insertions, 51 deletions
diff --git a/test/core/src/lombok/LombokTestSource.java b/test/core/src/lombok/LombokTestSource.java
index 57a32333..a0a6407a 100644
--- a/test/core/src/lombok/LombokTestSource.java
+++ b/test/core/src/lombok/LombokTestSource.java
@@ -113,10 +113,10 @@ public class LombokTestSource {
return formatPreferences;
}
- private static final Pattern VERSION_STYLE_1 = Pattern.compile("^(\\d+)$");
- private static final Pattern VERSION_STYLE_2 = Pattern.compile("^\\:(\\d+)$");
- private static final Pattern VERSION_STYLE_3 = Pattern.compile("^(\\d+):$");
- private static final Pattern VERSION_STYLE_4 = Pattern.compile("^(\\d+):(\\d+)$");
+ private static final Pattern VERSION_STYLE_1 = Pattern.compile("^(\\d+)(?:\\s+.*)?$");
+ private static final Pattern VERSION_STYLE_2 = Pattern.compile("^\\:(\\d+)(?:\\s+.*)?$");
+ private static final Pattern VERSION_STYLE_3 = Pattern.compile("^(\\d+):(?:\\s+.*)?$");
+ private static final Pattern VERSION_STYLE_4 = Pattern.compile("^(\\d+):(\\d+)(?:\\s+.*)?$");
private int[] parseVersionLimit(String spec) {
/* Single version: '5' */ {
diff --git a/test/core/src/lombok/RunTestsViaEcj.java b/test/core/src/lombok/RunTestsViaEcj.java
index 5c29533c..b98c19b7 100644
--- a/test/core/src/lombok/RunTestsViaEcj.java
+++ b/test/core/src/lombok/RunTestsViaEcj.java
@@ -23,20 +23,14 @@ package lombok;
import java.io.File;
import java.io.StringWriter;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Enumeration;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
import lombok.eclipse.Eclipse;
import lombok.javac.CapturingDiagnosticListener.CompilerMessage;
@@ -160,48 +154,13 @@ public class RunTestsViaEcj extends AbstractRunTests {
Map<String, String> options = new HashMap<String, String>();
options.put(JavaCore.COMPILER_SOURCE, "11");
options.put("org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures", "enabled");
- try {
- org.eclipse.jdt.internal.core.CompilationUnit ccu = new org.eclipse.jdt.internal.core.CompilationUnit(null, null, null) {
- @Override public char[] getContents() {
- return source;
- }
- };
- return AST.convertCompilationUnit(4, cud, options, false, ccu, 0, null);
- } catch (SecurityException e) {
- try {
- debugClasspathConflicts("org/eclipse/jdt/internal/compiler");
- } catch (Exception e2) {
- throw Lombok.sneakyThrow(e2);
- }
- throw e;
- }
- }
- }
-
- @SuppressWarnings({"all"})
- private static void debugClasspathConflicts(String prefixToLookFor) throws Exception {
- String[] paths = System.getProperty("java.class.path").split(":");
- for (String p : paths) {
- Path cp = Paths.get(p);
- if (Files.isDirectory(cp)) {
- if (Files.isDirectory(cp.resolve(prefixToLookFor))) System.out.println("** DIR-BASED: " + cp);
- } else if (Files.isRegularFile(cp)) {
- JarFile jf = new JarFile(cp.toFile());
- try {
- Enumeration<JarEntry> jes = jf.entries();
- while (jes.hasMoreElements()) {
- JarEntry je = jes.nextElement();
- if (je.getName().startsWith(prefixToLookFor)) {
- System.out.println("** JAR-BASED: " + cp);
- break;
- }
- }
- } finally {
- jf.close();
+
+ org.eclipse.jdt.internal.core.CompilationUnit ccu = new org.eclipse.jdt.internal.core.CompilationUnit(null, null, null) {
+ @Override public char[] getContents() {
+ return source;
}
- } else {
- System.out.println("** MISSING: " + cp);
- }
+ };
+ return AST.convertCompilationUnit(4, cud, options, false, ccu, 0, null);
}
}