8286573: Remove the unnecessary method Attr#attribTopLevel and its usage

Reviewed-by: vromero
This commit is contained in:
Guoxiong Li 2022-05-12 13:05:57 +00:00
parent dea6e886af
commit 36bdd25159

View File

@ -5155,9 +5155,6 @@ public class Attr extends JCTree.Visitor {
case MODULEDEF:
attribModule(env.tree.pos(), ((JCModuleDecl)env.tree).sym);
break;
case TOPLEVEL:
attribTopLevel(env);
break;
case PACKAGEDEF:
attribPackage(env.tree.pos(), ((JCPackageDecl) env.tree).packge);
break;
@ -5166,19 +5163,6 @@ public class Attr extends JCTree.Visitor {
}
}
/**
* Attribute a top level tree. These trees are encountered when the
* package declaration has annotations.
*/
public void attribTopLevel(Env<AttrContext> env) {
JCCompilationUnit toplevel = env.toplevel;
try {
annotate.flush();
} catch (CompletionFailure ex) {
chk.completionError(toplevel.pos(), ex);
}
}
public void attribPackage(DiagnosticPosition pos, PackageSymbol p) {
try {
annotate.flush();