8304443: bootcycle builds fail after JDK-8015831

Reviewed-by: vromero
This commit is contained in:
Archie L. Cobbs 2023-03-20 14:33:16 +00:00 committed by Vicente Romero
parent ded6a81319
commit c396f1ed8b
63 changed files with 74 additions and 3 deletions

View File

@ -82,7 +82,7 @@ public class BasicImageReader implements AutoCloseable {
private final ImageStringsReader stringsReader; private final ImageStringsReader stringsReader;
private final Decompressor decompressor; private final Decompressor decompressor;
@SuppressWarnings("removal") @SuppressWarnings({ "removal", "this-escape" })
protected BasicImageReader(Path path, ByteOrder byteOrder) protected BasicImageReader(Path path, ByteOrder byteOrder)
throws IOException { throws IOException {
this.imagePath = Objects.requireNonNull(path); this.imagePath = Objects.requireNonNull(path);

View File

@ -86,6 +86,7 @@ public class BasicJavacTask extends JavacTask {
return instance; return instance;
} }
@SuppressWarnings("this-escape")
public BasicJavacTask(Context c, boolean register) { public BasicJavacTask(Context c, boolean register) {
context = c; context = c;
options = Options.instance(c); options = Options.instance(c);

View File

@ -198,6 +198,7 @@ public class JavacTrees extends DocTrees {
return instance; return instance;
} }
@SuppressWarnings("this-escape")
protected JavacTrees(Context context) { protected JavacTrees(Context context) {
this.breakIterator = null; this.breakIterator = null;
context.put(JavacTrees.class, this); context.put(JavacTrees.class, this);

View File

@ -62,6 +62,7 @@ public class MultiTaskListener implements TaskListener {
return instance; return instance;
} }
@SuppressWarnings("this-escape")
protected MultiTaskListener(Context context) { protected MultiTaskListener(Context context) {
context.put(taskListenerKey, this); context.put(taskListenerKey, this);
ccw = ClientCodeWrapper.instance(context); ccw = ClientCodeWrapper.instance(context);

View File

@ -180,6 +180,7 @@ public class ClassFinder {
} }
/** Construct a new class finder. */ /** Construct a new class finder. */
@SuppressWarnings("this-escape")
protected ClassFinder(Context context) { protected ClassFinder(Context context) {
context.put(classFinderKey, this); context.put(classFinderKey, this);
reader = ClassReader.instance(context); reader = ClassReader.instance(context);

View File

@ -120,6 +120,7 @@ public class DeferredCompletionFailureHandler {
private Handler handler = javacCodeHandler; private Handler handler = javacCodeHandler;
@SuppressWarnings("this-escape")
protected DeferredCompletionFailureHandler(Context context) { protected DeferredCompletionFailureHandler(Context context) {
context.put(deferredCompletionFailureHandlerKey, this); context.put(deferredCompletionFailureHandlerKey, this);
} }

View File

@ -52,6 +52,7 @@ public class DeferredLintHandler {
return instance; return instance;
} }
@SuppressWarnings("this-escape")
protected DeferredLintHandler(Context context) { protected DeferredLintHandler(Context context) {
context.put(deferredLintHandlerKey, this); context.put(deferredLintHandlerKey, this);
this.currentPos = IMMEDIATE_POSITION; this.currentPos = IMMEDIATE_POSITION;

View File

@ -100,6 +100,7 @@ public class Lint
private static final Map<String, LintCategory> map = new ConcurrentHashMap<>(20); private static final Map<String, LintCategory> map = new ConcurrentHashMap<>(20);
@SuppressWarnings("this-escape")
protected Lint(Context context) { protected Lint(Context context) {
// initialize values according to the lint options // initialize values according to the lint options
Options options = Options.instance(context); Options options = Options.instance(context);

View File

@ -53,6 +53,7 @@ public class MissingInfoHandler {
private final Names names; private final Names names;
private ParameterNameProvider parameterNameProvider; private ParameterNameProvider parameterNameProvider;
@SuppressWarnings("this-escape")
protected MissingInfoHandler(Context context) { protected MissingInfoHandler(Context context) {
context.put(missingInfoHandlerWrapperKey, this); context.put(missingInfoHandlerWrapperKey, this);
names = Names.instance(context); names = Names.instance(context);

View File

@ -104,6 +104,7 @@ public class ModuleFinder {
} }
/** Construct a new module finder. */ /** Construct a new module finder. */
@SuppressWarnings("this-escape")
protected ModuleFinder(Context context) { protected ModuleFinder(Context context) {
context.put(moduleFinderKey, this); context.put(moduleFinderKey, this);
names = Names.instance(context); names = Names.instance(context);

View File

@ -1000,6 +1000,7 @@ public abstract class Symbol extends AnnoConstruct implements PoolConstant, Elem
return msym; return msym;
} }
@SuppressWarnings("this-escape")
public ModuleSymbol(Name name, Symbol owner) { public ModuleSymbol(Name name, Symbol owner) {
super(MDL, 0, name, null, owner); super(MDL, 0, name, null, owner);
Assert.checkNonNull(name); Assert.checkNonNull(name);
@ -1153,6 +1154,7 @@ public abstract class Symbol extends AnnoConstruct implements PoolConstant, Elem
this.fullname = formFullName(name, owner); this.fullname = formFullName(name, owner);
} }
@SuppressWarnings("this-escape")
public PackageSymbol(Name name, Symbol owner) { public PackageSymbol(Name name, Symbol owner) {
this(name, null, owner); this(name, null, owner);
this.type = new PackageType(this); this.type = new PackageType(this);

View File

@ -392,6 +392,7 @@ public class Symtab {
/** Constructor; enters all predefined identifiers and operators /** Constructor; enters all predefined identifiers and operators
* into symbol table. * into symbol table.
*/ */
@SuppressWarnings("this-escape")
protected Symtab(Context context) throws CompletionFailure { protected Symtab(Context context) throws CompletionFailure {
context.put(symtabKey, this); context.put(symtabKey, this);

View File

@ -1646,6 +1646,7 @@ public abstract class Type extends AnnoConstruct implements TypeMirror, PoolCons
*/ */
public Type lower; public Type lower;
@SuppressWarnings("this-escape")
public TypeVar(Name name, Symbol owner, Type lower) { public TypeVar(Name name, Symbol owner, Type lower) {
super(null, List.nil()); super(null, List.nil());
Assert.checkNonNull(lower); Assert.checkNonNull(lower);
@ -1658,6 +1659,7 @@ public abstract class Type extends AnnoConstruct implements TypeMirror, PoolCons
this(tsym, bound, lower, List.nil()); this(tsym, bound, lower, List.nil());
} }
@SuppressWarnings("this-escape")
public TypeVar(TypeSymbol tsym, Type bound, Type lower, public TypeVar(TypeSymbol tsym, Type bound, Type lower,
List<TypeMetadata> metadata) { List<TypeMetadata> metadata) {
super(tsym, metadata); super(tsym, metadata);
@ -1734,6 +1736,7 @@ public abstract class Type extends AnnoConstruct implements TypeMirror, PoolCons
public WildcardType wildcard; public WildcardType wildcard;
@SuppressWarnings("this-escape")
public CapturedType(Name name, public CapturedType(Name name,
Symbol owner, Symbol owner,
Type upper, Type upper,
@ -1967,6 +1970,7 @@ public abstract class Type extends AnnoConstruct implements TypeMirror, PoolCons
return v.visitUndetVar(this, s); return v.visitUndetVar(this, s);
} }
@SuppressWarnings("this-escape")
public UndetVar(TypeVar origin, UndetVarListener listener, Types types) { public UndetVar(TypeVar origin, UndetVarListener listener, Types types) {
// This is a synthesized internal type, so we cannot annotate it. // This is a synthesized internal type, so we cannot annotate it.
super(UNDETVAR, origin); super(UNDETVAR, origin);

View File

@ -110,6 +110,7 @@ public class TypeAnnotations {
final Annotate annotate; final Annotate annotate;
final Attr attr; final Attr attr;
@SuppressWarnings("this-escape")
protected TypeAnnotations(Context context) { protected TypeAnnotations(Context context) {
context.put(typeAnnosKey, this); context.put(typeAnnosKey, this);
names = Names.instance(context); names = Names.instance(context);

View File

@ -108,6 +108,7 @@ public class Types {
return instance; return instance;
} }
@SuppressWarnings("this-escape")
protected Types(Context context) { protected Types(Context context) {
context.put(typesKey, this); context.put(typesKey, this);
syms = Symtab.instance(context); syms = Symtab.instance(context);

View File

@ -119,6 +119,7 @@ public class Analyzer {
return instance; return instance;
} }
@SuppressWarnings("this-escape")
protected Analyzer(Context context) { protected Analyzer(Context context) {
context.put(analyzerKey, this); context.put(analyzerKey, this);
types = Types.instance(context); types = Types.instance(context);

View File

@ -103,6 +103,7 @@ public class Annotate {
private final Attribute theUnfinishedDefaultValue; private final Attribute theUnfinishedDefaultValue;
private final String sourceName; private final String sourceName;
@SuppressWarnings("this-escape")
protected Annotate(Context context) { protected Annotate(Context context) {
context.put(annotateKey, this); context.put(annotateKey, this);

View File

@ -120,6 +120,7 @@ public class ArgumentAttr extends JCTree.Visitor {
return instance; return instance;
} }
@SuppressWarnings("this-escape")
protected ArgumentAttr(Context context) { protected ArgumentAttr(Context context) {
context.put(methodAttrKey, this); context.put(methodAttrKey, this);
deferredAttr = DeferredAttr.instance(context); deferredAttr = DeferredAttr.instance(context);

View File

@ -132,6 +132,7 @@ public class Attr extends JCTree.Visitor {
return instance; return instance;
} }
@SuppressWarnings("this-escape")
protected Attr(Context context) { protected Attr(Context context) {
context.put(attrKey, this); context.put(attrKey, this);

View File

@ -79,6 +79,7 @@ public class AttrRecover {
return instance; return instance;
} }
@SuppressWarnings("this-escape")
protected AttrRecover(Context context) { protected AttrRecover(Context context) {
context.put(attrRepairKey, this); context.put(attrRepairKey, this);

View File

@ -133,6 +133,7 @@ public class Check {
return instance; return instance;
} }
@SuppressWarnings("this-escape")
protected Check(Context context) { protected Check(Context context) {
context.put(checkKey, this); context.put(checkKey, this);

View File

@ -80,6 +80,7 @@ public class CompileStates extends HashMap<Env<AttrContext>, CompileStates.Compi
protected transient Context context; protected transient Context context;
@SuppressWarnings("this-escape")
public CompileStates(Context context) { public CompileStates(Context context) {
this.context = context; this.context = context;
context.put(compileStatesKey, this); context.put(compileStatesKey, this);

View File

@ -109,6 +109,7 @@ public class DeferredAttr extends JCTree.Visitor {
return instance; return instance;
} }
@SuppressWarnings("this-escape")
protected DeferredAttr(Context context) { protected DeferredAttr(Context context) {
context.put(deferredAttrKey, this); context.put(deferredAttrKey, this);
annotate = Annotate.instance(context); annotate = Annotate.instance(context);

View File

@ -114,6 +114,7 @@ public class Enter extends JCTree.Visitor {
return instance; return instance;
} }
@SuppressWarnings("this-escape")
protected Enter(Context context) { protected Enter(Context context) {
context.put(enterKey, this); context.put(enterKey, this);

View File

@ -325,6 +325,7 @@ public class Flow {
} }
} }
@SuppressWarnings("this-escape")
protected Flow(Context context) { protected Flow(Context context) {
context.put(flowKey, this); context.put(flowKey, this);
names = Names.instance(context); names = Names.instance(context);

View File

@ -104,6 +104,7 @@ public class Infer {
return instance; return instance;
} }
@SuppressWarnings("this-escape")
protected Infer(Context context) { protected Infer(Context context) {
context.put(inferKey, this); context.put(inferKey, this);

View File

@ -104,6 +104,7 @@ public class Lower extends TreeTranslator {
private final boolean optimizeOuterThis; private final boolean optimizeOuterThis;
private final boolean useMatchException; private final boolean useMatchException;
@SuppressWarnings("this-escape")
protected Lower(Context context) { protected Lower(Context context) {
context.put(lowerKey, this); context.put(lowerKey, this);
names = Names.instance(context); names = Names.instance(context);

View File

@ -71,6 +71,7 @@ public class MemberEnter extends JCTree.Visitor {
return instance; return instance;
} }
@SuppressWarnings("this-escape")
protected MemberEnter(Context context) { protected MemberEnter(Context context) {
context.put(memberEnterKey, this); context.put(memberEnterKey, this);
enter = Enter.instance(context); enter = Enter.instance(context);

View File

@ -181,6 +181,7 @@ public class Modules extends JCTree.Visitor {
return instance; return instance;
} }
@SuppressWarnings("this-escape")
protected Modules(Context context) { protected Modules(Context context) {
context.put(Modules.class, this); context.put(Modules.class, this);
log = Log.instance(context); log = Log.instance(context);

View File

@ -89,6 +89,7 @@ public class Operators {
return instance; return instance;
} }
@SuppressWarnings("this-escape")
protected Operators(Context context) { protected Operators(Context context) {
context.put(operatorsKey, this); context.put(operatorsKey, this);
syms = Symtab.instance(context); syms = Symtab.instance(context);

View File

@ -116,6 +116,7 @@ public class Resolve {
WriteableScope polymorphicSignatureScope; WriteableScope polymorphicSignatureScope;
@SuppressWarnings("this-escape")
protected Resolve(Context context) { protected Resolve(Context context) {
context.put(resolveKey, this); context.put(resolveKey, this);
syms = Symtab.instance(context); syms = Symtab.instance(context);

View File

@ -56,6 +56,7 @@ public class Todo extends AbstractQueue<Env<AttrContext>> {
} }
/** Create a new todo list. */ /** Create a new todo list. */
@SuppressWarnings("this-escape")
protected Todo(Context context) { protected Todo(Context context) {
context.put(todoKey, this); context.put(todoKey, this);
} }

View File

@ -179,6 +179,7 @@ public class TransPatterns extends TreeTranslator {
private Set<JCMethodInvocation> deconstructorCalls; private Set<JCMethodInvocation> deconstructorCalls;
private int variableIndex = 0; private int variableIndex = 0;
@SuppressWarnings("this-escape")
protected TransPatterns(Context context) { protected TransPatterns(Context context) {
context.put(transPatternsKey, this); context.put(transPatternsKey, this);
syms = Symtab.instance(context); syms = Symtab.instance(context);

View File

@ -76,6 +76,7 @@ public class TransTypes extends TreeTranslator {
private final Resolve resolve; private final Resolve resolve;
private final CompileStates compileStates; private final CompileStates compileStates;
@SuppressWarnings("this-escape")
protected TransTypes(Context context) { protected TransTypes(Context context) {
context.put(transTypesKey, this); context.put(transTypesKey, this);
compileStates = CompileStates.instance(context); compileStates = CompileStates.instance(context);

View File

@ -122,6 +122,7 @@ public class TypeEnter implements Completer {
return instance; return instance;
} }
@SuppressWarnings("this-escape")
protected TypeEnter(Context context) { protected TypeEnter(Context context) {
context.put(typeEnterKey, this); context.put(typeEnterKey, this);
names = Names.instance(context); names = Names.instance(context);

View File

@ -71,6 +71,7 @@ import com.sun.tools.javac.util.Options;
* java.io.File or java.nio.file.Path. * java.io.File or java.nio.file.Path.
*/ */
public abstract class BaseFileManager implements JavaFileManager { public abstract class BaseFileManager implements JavaFileManager {
@SuppressWarnings("this-escape")
protected BaseFileManager(Charset charset) { protected BaseFileManager(Charset charset) {
this.charset = charset; this.charset = charset;
byteBufferCache = new ByteBufferCache(); byteBufferCache = new ByteBufferCache();

View File

@ -70,6 +70,7 @@ public class FSInfo {
protected FSInfo() { protected FSInfo() {
} }
@SuppressWarnings("this-escape")
protected FSInfo(Context context) { protected FSInfo(Context context) {
context.put(FSInfo.class, this); context.put(FSInfo.class, this);
} }

View File

@ -157,6 +157,7 @@ public class JavacFileManager extends BaseFileManager implements StandardJavaFil
* Create a JavacFileManager using a given context, optionally registering * Create a JavacFileManager using a given context, optionally registering
* it as the JavaFileManager for that context. * it as the JavaFileManager for that context.
*/ */
@SuppressWarnings("this-escape")
public JavacFileManager(Context context, boolean register, Charset charset) { public JavacFileManager(Context context, boolean register, Charset charset) {
super(charset); super(charset);
if (register) if (register)

View File

@ -258,6 +258,7 @@ public class ClassReader {
} }
/** Construct a new class reader. */ /** Construct a new class reader. */
@SuppressWarnings("this-escape")
protected ClassReader(Context context) { protected ClassReader(Context context) {
context.put(classReaderKey, this); context.put(classReaderKey, this);
annotate = Annotate.instance(context); annotate = Annotate.instance(context);

View File

@ -164,6 +164,7 @@ public class ClassWriter extends ClassFile {
/** Construct a class writer, given an options table. /** Construct a class writer, given an options table.
*/ */
@SuppressWarnings("this-escape")
protected ClassWriter(Context context) { protected ClassWriter(Context context) {
context.put(classWriterKey, this); context.put(classWriterKey, this);

View File

@ -97,6 +97,7 @@ public class Gen extends JCTree.Visitor {
*/ */
final PoolWriter poolWriter; final PoolWriter poolWriter;
@SuppressWarnings("this-escape")
protected Gen(Context context) { protected Gen(Context context) {
context.put(genKey, this); context.put(genKey, this);

View File

@ -105,6 +105,7 @@ public abstract class StringConcat {
} }
} }
@SuppressWarnings("this-escape")
protected StringConcat(Context context) { protected StringConcat(Context context) {
context.put(concatKey, this); context.put(concatKey, this);
gen = Gen.instance(context); gen = Gen.instance(context);

View File

@ -114,6 +114,7 @@ public class Arguments {
return instance; return instance;
} }
@SuppressWarnings("this-escape")
protected Arguments(Context context) { protected Arguments(Context context) {
context.put(argsKey, this); context.put(argsKey, this);
options = Options.instance(context); options = Options.instance(context);

View File

@ -371,6 +371,7 @@ public class JavaCompiler {
/** Construct a new compiler using a shared context. /** Construct a new compiler using a shared context.
*/ */
@SuppressWarnings("this-escape")
public JavaCompiler(Context context) { public JavaCompiler(Context context) {
this.context = context; this.context = context;
context.put(compilerKey, this); context.put(compilerKey, this);

View File

@ -105,6 +105,7 @@ public class JavacElements implements Elements {
return instance; return instance;
} }
@SuppressWarnings("this-escape")
protected JavacElements(Context context) { protected JavacElements(Context context) {
context.put(JavacElements.class, this); context.put(JavacElements.class, this);
javaCompiler = JavaCompiler.instance(context); javaCompiler = JavaCompiler.instance(context);

View File

@ -63,6 +63,7 @@ public class JavacTypes implements javax.lang.model.util.Types {
return instance; return instance;
} }
@SuppressWarnings("this-escape")
protected JavacTypes(Context context) { protected JavacTypes(Context context) {
context.put(JavacTypes.class, this); context.put(JavacTypes.class, this);
syms = Symtab.instance(context); syms = Symtab.instance(context);

View File

@ -166,6 +166,7 @@ public class JavacParser implements Parser {
} }
/** Construct a parser from a given scanner, tree factory and log. /** Construct a parser from a given scanner, tree factory and log.
*/ */
@SuppressWarnings("this-escape")
protected JavacParser(ParserFactory fac, protected JavacParser(ParserFactory fac,
Lexer S, Lexer S,
boolean keepDocComments, boolean keepDocComments,

View File

@ -69,6 +69,7 @@ public class ParserFactory {
final ScannerFactory scannerFactory; final ScannerFactory scannerFactory;
final Locale locale; final Locale locale;
@SuppressWarnings("this-escape")
protected ParserFactory(Context context) { protected ParserFactory(Context context) {
super(); super();
context.put(parserFactoryKey, this); context.put(parserFactoryKey, this);

View File

@ -63,6 +63,7 @@ public class ScannerFactory {
final Lint lint; final Lint lint;
/** Create a new scanner factory. */ /** Create a new scanner factory. */
@SuppressWarnings("this-escape")
protected ScannerFactory(Context context) { protected ScannerFactory(Context context) {
context.put(scannerFactoryKey, this); context.put(scannerFactoryKey, this);
this.log = Log.instance(context); this.log = Log.instance(context);

View File

@ -61,6 +61,7 @@ public class Tokens {
return instance; return instance;
} }
@SuppressWarnings("this-escape")
protected Tokens(Context context) { protected Tokens(Context context) {
context.put(tokensKey, this); context.put(tokensKey, this);
names = Names.instance(context); names = Names.instance(context);

View File

@ -102,6 +102,7 @@ public class UnicodeReader {
* @param array array containing contents of source. * @param array array containing contents of source.
* @param length length of meaningful content in buffer. * @param length length of meaningful content in buffer.
*/ */
@SuppressWarnings("this-escape")
protected UnicodeReader(ScannerFactory sf, char[] array, int length) { protected UnicodeReader(ScannerFactory sf, char[] array, int length) {
this.buffer = array; this.buffer = array;
this.length = length; this.length = length;

View File

@ -133,6 +133,7 @@ public class DocTreeMaker implements DocTreeFactory {
/** Create a tree maker with NOPOS as initial position. /** Create a tree maker with NOPOS as initial position.
*/ */
@SuppressWarnings("this-escape")
protected DocTreeMaker(Context context) { protected DocTreeMaker(Context context) {
context.put(treeMakerKey, this); context.put(treeMakerKey, this);
this.pos = Position.NOPOS; this.pos = Position.NOPOS;

View File

@ -80,6 +80,7 @@ public class TreeMaker implements JCTree.Factory {
/** Create a tree maker with null toplevel and NOPOS as initial position. /** Create a tree maker with null toplevel and NOPOS as initial position.
*/ */
@SuppressWarnings("this-escape")
protected TreeMaker(Context context) { protected TreeMaker(Context context) {
context.put(treeMakerKey, this); context.put(treeMakerKey, this);
this.pos = Position.NOPOS; this.pos = Position.NOPOS;

View File

@ -411,6 +411,7 @@ public abstract class AbstractDiagnosticFormatter implements DiagnosticFormatter
protected EnumSet<DiagnosticPart> visibleParts; protected EnumSet<DiagnosticPart> visibleParts;
protected boolean caretEnabled; protected boolean caretEnabled;
@SuppressWarnings("this-escape")
public SimpleConfiguration(Set<DiagnosticPart> parts) { public SimpleConfiguration(Set<DiagnosticPart> parts) {
multilineLimits = new HashMap<>(); multilineLimits = new HashMap<>();
setVisible(parts); setVisible(parts);
@ -419,7 +420,7 @@ public abstract class AbstractDiagnosticFormatter implements DiagnosticFormatter
setCaretEnabled(true); setCaretEnabled(true);
} }
@SuppressWarnings("fallthrough") @SuppressWarnings({ "fallthrough", "this-escape" })
public SimpleConfiguration(Options options, Set<DiagnosticPart> parts) { public SimpleConfiguration(Options options, Set<DiagnosticPart> parts) {
this(parts); this(parts);
String showSource = null; String showSource = null;

View File

@ -221,7 +221,7 @@ public class BasicDiagnosticFormatter extends AbstractDiagnosticFormatter {
protected Map<BasicFormatKind, String> availableFormats; protected Map<BasicFormatKind, String> availableFormats;
protected SourcePosition sourcePosition; protected SourcePosition sourcePosition;
@SuppressWarnings("fallthrough") @SuppressWarnings({ "fallthrough", "this-escape" })
public BasicConfiguration(Options options) { public BasicConfiguration(Options options) {
super(options, EnumSet.of(DiagnosticPart.SUMMARY, super(options, EnumSet.of(DiagnosticPart.SUMMARY,
DiagnosticPart.DETAILS, DiagnosticPart.DETAILS,
@ -272,6 +272,7 @@ public class BasicDiagnosticFormatter extends AbstractDiagnosticFormatter {
} }
} }
@SuppressWarnings("this-escape")
public BasicConfiguration() { public BasicConfiguration() {
super(EnumSet.of(DiagnosticPart.SUMMARY, super(EnumSet.of(DiagnosticPart.SUMMARY,
DiagnosticPart.DETAILS, DiagnosticPart.DETAILS,

View File

@ -71,6 +71,7 @@ public abstract class Dependencies {
return instance; return instance;
} }
@SuppressWarnings("this-escape")
protected Dependencies(Context context) { protected Dependencies(Context context) {
context.put(dependenciesKey, this); context.put(dependenciesKey, this);
} }

View File

@ -68,6 +68,7 @@ public class JCDiagnostic implements Diagnostic<JavaFileObject> {
final Set<DiagnosticFlag> defaultErrorFlags; final Set<DiagnosticFlag> defaultErrorFlags;
/** Create a new diagnostic factory. */ /** Create a new diagnostic factory. */
@SuppressWarnings("this-escape")
protected Factory(Context context) { protected Factory(Context context) {
this(JavacMessages.instance(context), "compiler"); this(JavacMessages.instance(context), "compiler");
context.put(diagnosticFactoryKey, this); context.put(diagnosticFactoryKey, this);

View File

@ -85,6 +85,7 @@ public class JavacMessages implements Messages {
/** Creates a JavacMessages object. /** Creates a JavacMessages object.
*/ */
@SuppressWarnings("this-escape")
public JavacMessages(Context context) { public JavacMessages(Context context) {
this(defaultBundleName, context.get(Locale.class)); this(defaultBundleName, context.get(Locale.class));
this.context = context; this.context = context;
@ -105,6 +106,7 @@ public class JavacMessages implements Messages {
/** Creates a JavacMessages object. /** Creates a JavacMessages object.
* @param bundleName the name to identify the resource bundle of localized messages. * @param bundleName the name to identify the resource bundle of localized messages.
*/ */
@SuppressWarnings("this-escape")
public JavacMessages(String bundleName, Locale locale) throws MissingResourceException { public JavacMessages(String bundleName, Locale locale) throws MissingResourceException {
bundleHelpers = List.nil(); bundleHelpers = List.nil();
bundleCache = new HashMap<>(); bundleCache = new HashMap<>();

View File

@ -114,6 +114,7 @@ public class Log extends AbstractLog {
* A DiagnosticHandler that discards all diagnostics. * A DiagnosticHandler that discards all diagnostics.
*/ */
public static class DiscardDiagnosticHandler extends DiagnosticHandler { public static class DiscardDiagnosticHandler extends DiagnosticHandler {
@SuppressWarnings("this-escape")
public DiscardDiagnosticHandler(Log log) { public DiscardDiagnosticHandler(Log log) {
install(log); install(log);
} }
@ -137,6 +138,7 @@ public class Log extends AbstractLog {
this(log, null); this(log, null);
} }
@SuppressWarnings("this-escape")
public DeferredDiagnosticHandler(Log log, Predicate<JCDiagnostic> filter) { public DeferredDiagnosticHandler(Log log, Predicate<JCDiagnostic> filter) {
this.filter = filter; this.filter = filter;
install(log); install(log);
@ -251,6 +253,7 @@ public class Log extends AbstractLog {
* it will be used for all output. * it will be used for all output.
* Otherwise, the log will be initialized to use both streams found in the context. * Otherwise, the log will be initialized to use both streams found in the context.
*/ */
@SuppressWarnings("this-escape")
protected Log(Context context) { protected Log(Context context) {
this(context, initWriters(context)); this(context, initWriters(context));
} }
@ -278,6 +281,7 @@ public class Log extends AbstractLog {
/** /**
* Construct a log with all output sent to a single output stream. * Construct a log with all output sent to a single output stream.
*/ */
@SuppressWarnings("this-escape")
protected Log(Context context, PrintWriter writer) { protected Log(Context context, PrintWriter writer) {
this(context, initWriters(writer, writer)); this(context, initWriters(writer, writer));
} }
@ -287,6 +291,7 @@ public class Log extends AbstractLog {
* The log will be initialized to use stdOut for normal output, and stdErr * The log will be initialized to use stdOut for normal output, and stdErr
* for all diagnostic output. * for all diagnostic output.
*/ */
@SuppressWarnings("this-escape")
protected Log(Context context, PrintWriter out, PrintWriter err) { protected Log(Context context, PrintWriter out, PrintWriter err) {
this(context, initWriters(out, err)); this(context, initWriters(out, err));
} }

View File

@ -224,6 +224,7 @@ public class Names {
public final Name.Table table; public final Name.Table table;
@SuppressWarnings("this-escape")
public Names(Context context) { public Names(Context context) {
Options options = Options.instance(context); Options options = Options.instance(context);
table = createTable(options); table = createTable(options);

View File

@ -55,6 +55,7 @@ public class Options {
return instance; return instance;
} }
@SuppressWarnings("this-escape")
protected Options(Context context) { protected Options(Context context) {
// DEBUGGING -- Use LinkedHashMap for reproducibility // DEBUGGING -- Use LinkedHashMap for reproducibility
values = new LinkedHashMap<>(); values = new LinkedHashMap<>();

View File

@ -94,6 +94,7 @@ public class RichDiagnosticFormatter extends
return instance; return instance;
} }
@SuppressWarnings("this-escape")
protected RichDiagnosticFormatter(Context context) { protected RichDiagnosticFormatter(Context context) {
super((AbstractDiagnosticFormatter)Log.instance(context).getDiagnosticFormatter()); super((AbstractDiagnosticFormatter)Log.instance(context).getDiagnosticFormatter());
setRichPrinter(new RichPrinter()); setRichPrinter(new RichPrinter());

View File

@ -74,6 +74,7 @@ public class StandardDoclet implements Doclet {
* Creates an instance of the standard doclet, used to generate HTML-formatted * Creates an instance of the standard doclet, used to generate HTML-formatted
* documentation. * documentation.
*/ */
@SuppressWarnings("this-escape")
public StandardDoclet() { public StandardDoclet() {
htmlDoclet = new HtmlDoclet(this); htmlDoclet = new HtmlDoclet(this);
} }