From 6b9060ac8f5ad393506d0a2bfb4e09636a585da9 Mon Sep 17 00:00:00 2001 From: Eric McCorkle Date: Mon, 3 Mar 2014 16:17:32 -0500 Subject: [PATCH] 8036142: Remove redundant call to annotateTypeLater with null Symbol AnnotateTypeLater (formerly typeAnnotate) with null as the symbol was a way to force attribution of type annotations, but this is now obsolete and problematic, and a silent noop condition Reviewed-by: jjg --- .../share/classes/com/sun/tools/javac/comp/Annotate.java | 2 +- .../src/share/classes/com/sun/tools/javac/comp/Attr.java | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) 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();