diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2013-03-24 19:14:10 +0100 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2013-05-23 21:25:30 +0200 |
commit | 4152eee126bcb6a0403d3e7a79fe336944031268 (patch) | |
tree | a255c5d4815752ca2a31c1e9eba7dd1a888b2f34 /test/core/src | |
parent | ffb3527daa05c966f40cccb3bbd93133b5775c7b (diff) | |
download | lombok-4152eee126bcb6a0403d3e7a79fe336944031268.tar.gz lombok-4152eee126bcb6a0403d3e7a79fe336944031268.tar.bz2 lombok-4152eee126bcb6a0403d3e7a79fe336944031268.zip |
Added a method to obtain latest java language spec supported by host
platform and implemented it for javac BUT NOT FOR ECJ!
Diffstat (limited to 'test/core/src')
-rw-r--r-- | test/core/src/lombok/DirectoryRunner.java | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/test/core/src/lombok/DirectoryRunner.java b/test/core/src/lombok/DirectoryRunner.java index a3b4de00..855db023 100644 --- a/test/core/src/lombok/DirectoryRunner.java +++ b/test/core/src/lombok/DirectoryRunner.java @@ -32,25 +32,18 @@ import java.util.TreeMap; import java.util.regex.Matcher; import java.util.regex.Pattern; +import lombok.javac.Javac; + import org.junit.runner.Description; import org.junit.runner.Runner; import org.junit.runner.notification.Failure; import org.junit.runner.notification.RunNotifier; -import com.sun.tools.javac.main.JavaCompiler; - public class DirectoryRunner extends Runner { public enum Compiler { DELOMBOK { @Override public int getVersion() { - Matcher m = VERSION_PARSER.matcher(JavaCompiler.version()); - if (m.matches()) { - int major = Integer.parseInt(m.group(1)); - int minor = Integer.parseInt(m.group(2)); - if (major == 1) return minor; - } - - return 6; + return Javac.getJavaCompilerVersion(); } }, JAVAC { @@ -64,7 +57,6 @@ public class DirectoryRunner extends Runner { } }; - private static final Pattern VERSION_PARSER = Pattern.compile("^(\\d+)\\.(\\d+).*$"); public abstract int getVersion(); } |