langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/AttrContext.java
changeset 34854 d90aa0a83be4
parent 29842 826ac2519523
child 41629 9d203cde7d84
equal deleted inserted replaced
34764:f9bcdce2df26 34854:d90aa0a83be4
    23  * questions.
    23  * questions.
    24  */
    24  */
    25 
    25 
    26 package com.sun.tools.javac.comp;
    26 package com.sun.tools.javac.comp;
    27 
    27 
       
    28 import com.sun.tools.javac.tree.JCTree;
    28 import com.sun.tools.javac.util.*;
    29 import com.sun.tools.javac.util.*;
    29 import com.sun.tools.javac.code.*;
    30 import com.sun.tools.javac.code.*;
    30 import com.sun.tools.javac.code.Scope.WriteableScope;
    31 import com.sun.tools.javac.code.Scope.WriteableScope;
    31 
    32 
    32 /** Contains information specific to the attribute and enter
    33 /** Contains information specific to the attribute and enter
    93 
    94 
    94     /** Symbol corresponding to the site of a qualified default super call
    95     /** Symbol corresponding to the site of a qualified default super call
    95      */
    96      */
    96     Type defaultSuperCallSite = null;
    97     Type defaultSuperCallSite = null;
    97 
    98 
       
    99     /** Tree that when non null, is to be preferentially used in diagnostics.
       
   100      *  Usually Env<AttrContext>.tree is the tree to be referred to in messages,
       
   101      *  but this may not be true during the window a method is looked up in enclosing
       
   102      *  contexts (JDK-8145466)
       
   103      */
       
   104     JCTree preferredTreeForDiagnostics;
       
   105 
    98     /** Duplicate this context, replacing scope field and copying all others.
   106     /** Duplicate this context, replacing scope field and copying all others.
    99      */
   107      */
   100     AttrContext dup(WriteableScope scope) {
   108     AttrContext dup(WriteableScope scope) {
   101         AttrContext info = new AttrContext();
   109         AttrContext info = new AttrContext();
   102         info.scope = scope;
   110         info.scope = scope;
   110         info.defaultSuperCallSite = defaultSuperCallSite;
   118         info.defaultSuperCallSite = defaultSuperCallSite;
   111         info.isSerializable = isSerializable;
   119         info.isSerializable = isSerializable;
   112         info.isSpeculative = isSpeculative;
   120         info.isSpeculative = isSpeculative;
   113         info.isAnonymousDiamond = isAnonymousDiamond;
   121         info.isAnonymousDiamond = isAnonymousDiamond;
   114         info.isNewClass = isNewClass;
   122         info.isNewClass = isNewClass;
       
   123         info.preferredTreeForDiagnostics = preferredTreeForDiagnostics;
   115         return info;
   124         return info;
   116     }
   125     }
   117 
   126 
   118     /** Duplicate this context, copying all fields.
   127     /** Duplicate this context, copying all fields.
   119      */
   128      */