diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/Annotate.java b/langtools/src/share/classes/com/sun/tools/javac/comp/Annotate.java index d7b5f4a11cc..cd1383b3b0a 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/comp/Annotate.java +++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Annotate.java @@ -842,7 +842,7 @@ public class Annotate { final Env env, final Symbol sym, final DiagnosticPosition deferPos) { - + Assert.checkNonNull(sym); normal(new Annotate.Worker() { @Override public String toString() { diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java index 6090a579acb..1ab10af50e0 100644 --- a/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java +++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java @@ -769,13 +769,6 @@ public class Attr extends JCTree.Visitor { = deferredLintHandler.setPos(variable.pos()); try { - // Use null as symbol to not attach the type annotation to any symbol. - // The initializer will later also be visited and then we'll attach - // to the symbol. - // This prevents having multiple type annotations, just because of - // lazy constant value evaluation. - annotate.annotateTypeLater(variable.init, env, null, variable.pos()); - annotate.flush(); Type itype = attribExpr(variable.init, env, type); if (itype.constValue() != null) { return coerce(itype, type).constValue();