From 9e93319965efff36c6bd075b5915741b91f62ea2 Mon Sep 17 00:00:00 2001 From: Akash Yadav Date: Tue, 16 Aug 2022 10:01:27 +0530 Subject: [PATCH] Fixed: javac.** not included in packaged JAR; 'null' returned from SourceVersion.latest() and SourceVersion.getLatestSupported() --- make/langtools/netbeans/nb-javac/build.xml | 2 ++ .../share/classes/javax/lang/model/SourceVersion.java | 6 ++++-- .../share/classes/com/sun/tools/javac/jvm/ClassReader.java | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/make/langtools/netbeans/nb-javac/build.xml b/make/langtools/netbeans/nb-javac/build.xml index c2e1d8c..29491ee 100644 --- a/make/langtools/netbeans/nb-javac/build.xml +++ b/make/langtools/netbeans/nb-javac/build.xml @@ -99,6 +99,7 @@ + @@ -107,6 +108,7 @@ + diff --git a/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java b/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java index be2fc11..3096d99 100644 --- a/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java +++ b/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java @@ -261,7 +261,8 @@ public static SourceVersion latest() { * need to be updated accordingly. */ private static SourceVersion getLatestSupported() { - return latest(); + // AndroidIDE changed: Allow overriding latest supported source version. + return JavacConfigProvider.getLatestSupportedSourceVersion(); } @@ -288,7 +289,8 @@ private static SourceVersion getLatestSupported() { * which may be earlier than the {@code latest} release. */ public static SourceVersion latestSupported() { - return latestSupported; + // AndroidIDE changed: Allow overriding latest supported source version. + return JavacConfigProvider.getLatestSupportedSourceVersion(); } /** diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java index 22bb3db..9699e75 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java @@ -2233,7 +2233,7 @@ VarSymbol readField() { /** Read a method. */ - MethodSymbol readMethod() { + protected MethodSymbol readMethod() { long flags = adjustMethodFlags(nextChar()); Name name = poolReader.getName(nextChar()); Type type = poolReader.getType(nextChar());