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
This commit is contained in:
Eric McCorkle 2014-03-03 16:17:32 -05:00
parent 74250736aa
commit 6b9060ac8f
2 changed files with 1 additions and 8 deletions

View File

@ -842,7 +842,7 @@ public class Annotate {
final Env<AttrContext> env,
final Symbol sym,
final DiagnosticPosition deferPos) {
Assert.checkNonNull(sym);
normal(new Annotate.Worker() {
@Override
public String toString() {

View File

@ -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();