1.1 --- a/src/share/classes/com/sun/tools/javac/comp/AttrContext.java Mon Jan 04 12:08:55 2016 -0800 1.2 +++ b/src/share/classes/com/sun/tools/javac/comp/AttrContext.java Thu Jan 07 08:45:19 2016 +0000 1.3 @@ -25,6 +25,7 @@ 1.4 1.5 package com.sun.tools.javac.comp; 1.6 1.7 +import com.sun.tools.javac.tree.JCTree; 1.8 import com.sun.tools.javac.util.*; 1.9 import com.sun.tools.javac.code.*; 1.10 1.11 @@ -80,6 +81,13 @@ 1.12 */ 1.13 Type defaultSuperCallSite = null; 1.14 1.15 + /** Tree that when non null, is to be preferentially used in diagnostics. 1.16 + * Usually Env<AttrContext>.tree is the tree to be referred to in messages, 1.17 + * but this may not be true during the window a method is looked up in enclosing 1.18 + * contexts (JDK-8145466) 1.19 + */ 1.20 + JCTree preferredTreeForDiagnostics; 1.21 + 1.22 /** Duplicate this context, replacing scope field and copying all others. 1.23 */ 1.24 AttrContext dup(Scope scope) { 1.25 @@ -94,6 +102,7 @@ 1.26 info.returnResult = returnResult; 1.27 info.defaultSuperCallSite = defaultSuperCallSite; 1.28 info.isSerializable = isSerializable; 1.29 + info.preferredTreeForDiagnostics = preferredTreeForDiagnostics; 1.30 return info; 1.31 } 1.32