langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java Mon Aug 31 15:50:20 2015 +0100
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java Mon Aug 31 17:33:34 2015 +0100
@@ -87,7 +87,7 @@
*/
public class JavaCompiler {
/** The context key for the compiler. */
- protected static final Context.Key<JavaCompiler> compilerKey = new Context.Key<>();
+ public static final Context.Key<JavaCompiler> compilerKey = new Context.Key<>();
/** Get the JavaCompiler instance for this context. */
public static JavaCompiler instance(Context context) {
@@ -821,7 +821,7 @@
// as a JavaCompiler can only be used once, throw an exception if
// it has been used before.
if (hasBeenUsed)
- throw new AssertionError("attempt to reuse JavaCompiler");
+ checkReusable();
hasBeenUsed = true;
// forcibly set the equivalent of -Xlint:-options, so that no further
@@ -898,6 +898,10 @@
}
}
+ protected void checkReusable() {
+ throw new AssertionError("attempt to reuse JavaCompiler");
+ }
+
/**
* Set needRootClasses to true, in JavaCompiler subclass constructor
* that want to collect public apis of classes supplied on the command line.