Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Arthanareeswaran2019-02-11 06:58:20 +0000
committerJay Arthanareeswaran2019-02-11 06:58:20 +0000
commit52fb2f239c518024e4bca3818b156c9bd366d53c (patch)
tree5cb7c62c02bf2d317e2c7af88fce40e4b684b64b /org.eclipse.jdt.compiler.tool
parent483ab93ad3c761e3ba7e5a33837bc735d8b4a520 (diff)
downloadeclipse.jdt.core-52fb2f239c518024e4bca3818b156c9bd366d53c.tar.gz
eclipse.jdt.core-52fb2f239c518024e4bca3818b156c9bd366d53c.tar.xz
eclipse.jdt.core-52fb2f239c518024e4bca3818b156c9bd366d53c.zip
Bug 543511 - [12] JSR 269 API changes for Java 12
Also includes changes to remove hard-coded latest Java version in both batch compiler as well as JSR 199 interface. Change-Id: Id52e83636a3d10488e5b2517d4959699a5fa0b75 Signed-off-by: Jay Arthanareeswaran <jarthana@in.ibm.com>
Diffstat (limited to 'org.eclipse.jdt.compiler.tool')
-rw-r--r--org.eclipse.jdt.compiler.tool/src/org/eclipse/jdt/internal/compiler/tool/EclipseCompiler.java7
-rw-r--r--org.eclipse.jdt.compiler.tool/src/org/eclipse/jdt/internal/compiler/tool/EclipseFileManager.java8
2 files changed, 8 insertions, 7 deletions
diff --git a/org.eclipse.jdt.compiler.tool/src/org/eclipse/jdt/internal/compiler/tool/EclipseCompiler.java b/org.eclipse.jdt.compiler.tool/src/org/eclipse/jdt/internal/compiler/tool/EclipseCompiler.java
index a8033daa7f..b942161690 100644
--- a/org.eclipse.jdt.compiler.tool/src/org/eclipse/jdt/internal/compiler/tool/EclipseCompiler.java
+++ b/org.eclipse.jdt.compiler.tool/src/org/eclipse/jdt/internal/compiler/tool/EclipseCompiler.java
@@ -119,9 +119,10 @@ public class EclipseCompiler implements JavaCompiler {
eclipseCompiler2.fileManager = this.getStandardFileManager(someDiagnosticListener, null, null);
}
- eclipseCompiler2.options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12);
- eclipseCompiler2.options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_12);
- eclipseCompiler2.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_12);
+ String latest = CompilerOptions.getLatestVersion();
+ eclipseCompiler2.options.put(CompilerOptions.OPTION_Compliance, latest);
+ eclipseCompiler2.options.put(CompilerOptions.OPTION_Source, latest);
+ eclipseCompiler2.options.put(CompilerOptions.OPTION_TargetPlatform, latest);
ArrayList<String> allOptions = new ArrayList<>();
if (options != null) {
diff --git a/org.eclipse.jdt.compiler.tool/src/org/eclipse/jdt/internal/compiler/tool/EclipseFileManager.java b/org.eclipse.jdt.compiler.tool/src/org/eclipse/jdt/internal/compiler/tool/EclipseFileManager.java
index 05b2908229..cd80ce6633 100644
--- a/org.eclipse.jdt.compiler.tool/src/org/eclipse/jdt/internal/compiler/tool/EclipseFileManager.java
+++ b/org.eclipse.jdt.compiler.tool/src/org/eclipse/jdt/internal/compiler/tool/EclipseFileManager.java
@@ -1365,10 +1365,10 @@ public class EclipseFileManager implements StandardJavaFileManager {
// FIXME: same for module source path?
Map<String, String> options = new HashMap<>();
// FIXME: Find a way to get the options from the EclipseCompiler and pass it to the parser.
- // FIXME: need to be the latest and not hardcoded value
- options.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_12);
- options.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_12);
- options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_12);
+ String latest = CompilerOptions.getLatestVersion();
+ options.put(CompilerOptions.OPTION_Compliance, latest);
+ options.put(CompilerOptions.OPTION_Source, latest);
+ options.put(CompilerOptions.OPTION_TargetPlatform, latest);
CompilerOptions compilerOptions = new CompilerOptions(options);
ProblemReporter problemReporter =
new ProblemReporter(

Back to the top