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 Decompressor decompressor;
@SuppressWarnings("removal")
@SuppressWarnings({ "removal", "this-escape" })
protected BasicImageReader(Path path, ByteOrder byteOrder)
throws IOException {
this.imagePath = Objects.requireNonNull(path);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -122,6 +122,7 @@ public class TypeEnter implements Completer {
return instance;
}
@SuppressWarnings("this-escape")
protected TypeEnter(Context context) {
context.put(typeEnterKey, this);
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.
*/
public abstract class BaseFileManager implements JavaFileManager {
@SuppressWarnings("this-escape")
protected BaseFileManager(Charset charset) {
this.charset = charset;
byteBufferCache = new ByteBufferCache();

View File

@ -70,6 +70,7 @@ public class FSInfo {
protected FSInfo() {
}
@SuppressWarnings("this-escape")
protected FSInfo(Context context) {
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
* it as the JavaFileManager for that context.
*/
@SuppressWarnings("this-escape")
public JavacFileManager(Context context, boolean register, Charset charset) {
super(charset);
if (register)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -63,6 +63,7 @@ public class JavacTypes implements javax.lang.model.util.Types {
return instance;
}
@SuppressWarnings("this-escape")
protected JavacTypes(Context context) {
context.put(JavacTypes.class, this);
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.
*/
@SuppressWarnings("this-escape")
protected JavacParser(ParserFactory fac,
Lexer S,
boolean keepDocComments,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -114,6 +114,7 @@ public class Log extends AbstractLog {
* A DiagnosticHandler that discards all diagnostics.
*/
public static class DiscardDiagnosticHandler extends DiagnosticHandler {
@SuppressWarnings("this-escape")
public DiscardDiagnosticHandler(Log log) {
install(log);
}
@ -137,6 +138,7 @@ public class Log extends AbstractLog {
this(log, null);
}
@SuppressWarnings("this-escape")
public DeferredDiagnosticHandler(Log log, Predicate<JCDiagnostic> filter) {
this.filter = filter;
install(log);
@ -251,6 +253,7 @@ public class Log extends AbstractLog {
* it will be used for all output.
* Otherwise, the log will be initialized to use both streams found in the context.
*/
@SuppressWarnings("this-escape")
protected Log(Context 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.
*/
@SuppressWarnings("this-escape")
protected Log(Context context, PrintWriter 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
* for all diagnostic output.
*/
@SuppressWarnings("this-escape")
protected Log(Context context, PrintWriter out, PrintWriter err) {
this(context, initWriters(out, err));
}

View File

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

View File

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

View File

@ -94,6 +94,7 @@ public class RichDiagnosticFormatter extends
return instance;
}
@SuppressWarnings("this-escape")
protected RichDiagnosticFormatter(Context context) {
super((AbstractDiagnosticFormatter)Log.instance(context).getDiagnosticFormatter());
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
* documentation.
*/
@SuppressWarnings("this-escape")
public StandardDoclet() {
htmlDoclet = new HtmlDoclet(this);
}