aboutsummaryrefslogtreecommitdiff
path: root/test/core/src/lombok
diff options
context:
space:
mode:
authorReinier Zwitserloot <r.zwitserloot@projectlombok.org>2021-03-23 06:01:50 +0100
committerReinier Zwitserloot <r.zwitserloot@projectlombok.org>2021-03-23 06:01:50 +0100
commit3d7754e269ec84604d43be97a684bb26b519c6b9 (patch)
tree00f6a9e348b6cba0c025b46134ece5f86649f22f /test/core/src/lombok
parentcc98adac012d0d18c70628eb5e6f1646ce574e8a (diff)
downloadlombok-3d7754e269ec84604d43be97a684bb26b519c6b9.tar.gz
lombok-3d7754e269ec84604d43be97a684bb26b519c6b9.tar.bz2
lombok-3d7754e269ec84604d43be97a684bb26b519c6b9.zip
[testing] wahey, ecj testing works again, and now we can test JDK16 features in it!
Diffstat (limited to 'test/core/src/lombok')
-rw-r--r--test/core/src/lombok/RunTestsViaEcj.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/test/core/src/lombok/RunTestsViaEcj.java b/test/core/src/lombok/RunTestsViaEcj.java
index 1c2be160..2e89f99b 100644
--- a/test/core/src/lombok/RunTestsViaEcj.java
+++ b/test/core/src/lombok/RunTestsViaEcj.java
@@ -110,6 +110,11 @@ public class RunTestsViaEcj extends AbstractRunTests {
};
}
+ private ICompilationUnit getSourceUnit(File file, String source) {
+ if (eclipseAvailable()) return new TestCompilationUnitEclipse(file.getName(), source);
+ return new TestCompilationUnitEcj(file.getName(), source);
+ }
+
@Override
public boolean transformCode(Collection<CompilerMessage> messages, StringWriter result, File file, String encoding, Map<String, String> formatPreferences, int minVersion, boolean checkPositions) throws Throwable {
final AtomicReference<CompilationResult> compilationResult_ = new AtomicReference<CompilationResult>();
@@ -124,11 +129,7 @@ public class RunTestsViaEcj extends AbstractRunTests {
char[] sourceArray = source.toCharArray();
final ICompilationUnit sourceUnit;
try {
- if (eclipseAvailable()) {
- sourceUnit = new TestCompilationUnitEclipse(file.getName(), source);
- } else {
- sourceUnit = new TestCompilationUnitEcj(file.getName(), source);
- }
+ sourceUnit = getSourceUnit(file, source);
} catch (Throwable t) {
t.printStackTrace();
return false;