< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/comp/AttrContext.java

Print this page
rev 51258 : imported patch switch.diff


  84     boolean visitingServiceImplementation = false;
  85 
  86     /** Are arguments to current function applications boxed into an array for varargs?
  87      */
  88     Resolve.MethodResolutionPhase pendingResolutionPhase = null;
  89 
  90     /** A record of the lint/SuppressWarnings currently in effect
  91      */
  92     Lint lint;
  93 
  94     /** The variable whose initializer is being attributed
  95      * useful for detecting self-references in variable initializers
  96      */
  97     Symbol enclVar = null;
  98 
  99     /** ResultInfo to be used for attributing 'return' statement expressions
 100      * (set by Attr.visitMethod and Attr.visitLambda)
 101      */
 102     Attr.ResultInfo returnResult = null;
 103 





 104     /** Symbol corresponding to the site of a qualified default super call
 105      */
 106     Type defaultSuperCallSite = null;
 107 
 108     /** Tree that when non null, is to be preferentially used in diagnostics.
 109      *  Usually Env<AttrContext>.tree is the tree to be referred to in messages,
 110      *  but this may not be true during the window a method is looked up in enclosing
 111      *  contexts (JDK-8145466)
 112      */
 113     JCTree preferredTreeForDiagnostics;
 114 
 115     /** Duplicate this context, replacing scope field and copying all others.
 116      */
 117     AttrContext dup(WriteableScope scope) {
 118         AttrContext info = new AttrContext();
 119         info.scope = scope;
 120         info.staticLevel = staticLevel;
 121         info.isSelfCall = isSelfCall;
 122         info.selectSuper = selectSuper;
 123         info.pendingResolutionPhase = pendingResolutionPhase;
 124         info.lint = lint;
 125         info.enclVar = enclVar;
 126         info.returnResult = returnResult;

 127         info.defaultSuperCallSite = defaultSuperCallSite;
 128         info.isSerializable = isSerializable;
 129         info.isLambda = isLambda;
 130         info.isSpeculative = isSpeculative;
 131         info.isAnonymousDiamond = isAnonymousDiamond;
 132         info.isNewClass = isNewClass;
 133         info.preferredTreeForDiagnostics = preferredTreeForDiagnostics;
 134         info.visitingServiceImplementation = visitingServiceImplementation;
 135         return info;
 136     }
 137 
 138     /** Duplicate this context, copying all fields.
 139      */
 140     AttrContext dup() {
 141         return dup(scope);
 142     }
 143 
 144     public Iterable<Symbol> getLocalElements() {
 145         if (scope == null)
 146             return List.nil();


  84     boolean visitingServiceImplementation = false;
  85 
  86     /** Are arguments to current function applications boxed into an array for varargs?
  87      */
  88     Resolve.MethodResolutionPhase pendingResolutionPhase = null;
  89 
  90     /** A record of the lint/SuppressWarnings currently in effect
  91      */
  92     Lint lint;
  93 
  94     /** The variable whose initializer is being attributed
  95      * useful for detecting self-references in variable initializers
  96      */
  97     Symbol enclVar = null;
  98 
  99     /** ResultInfo to be used for attributing 'return' statement expressions
 100      * (set by Attr.visitMethod and Attr.visitLambda)
 101      */
 102     Attr.ResultInfo returnResult = null;
 103 
 104     /** ResultInfo to be used for attributing 'break' statement expressions
 105      * (set by Attr.visitSwitchExpression)
 106      */
 107     Attr.ResultInfo breakResult = null;
 108 
 109     /** Symbol corresponding to the site of a qualified default super call
 110      */
 111     Type defaultSuperCallSite = null;
 112 
 113     /** Tree that when non null, is to be preferentially used in diagnostics.
 114      *  Usually Env<AttrContext>.tree is the tree to be referred to in messages,
 115      *  but this may not be true during the window a method is looked up in enclosing
 116      *  contexts (JDK-8145466)
 117      */
 118     JCTree preferredTreeForDiagnostics;
 119 
 120     /** Duplicate this context, replacing scope field and copying all others.
 121      */
 122     AttrContext dup(WriteableScope scope) {
 123         AttrContext info = new AttrContext();
 124         info.scope = scope;
 125         info.staticLevel = staticLevel;
 126         info.isSelfCall = isSelfCall;
 127         info.selectSuper = selectSuper;
 128         info.pendingResolutionPhase = pendingResolutionPhase;
 129         info.lint = lint;
 130         info.enclVar = enclVar;
 131         info.returnResult = returnResult;
 132         info.breakResult = breakResult;
 133         info.defaultSuperCallSite = defaultSuperCallSite;
 134         info.isSerializable = isSerializable;
 135         info.isLambda = isLambda;
 136         info.isSpeculative = isSpeculative;
 137         info.isAnonymousDiamond = isAnonymousDiamond;
 138         info.isNewClass = isNewClass;
 139         info.preferredTreeForDiagnostics = preferredTreeForDiagnostics;
 140         info.visitingServiceImplementation = visitingServiceImplementation;
 141         return info;
 142     }
 143 
 144     /** Duplicate this context, copying all fields.
 145      */
 146     AttrContext dup() {
 147         return dup(scope);
 148     }
 149 
 150     public Iterable<Symbol> getLocalElements() {
 151         if (scope == null)
 152             return List.nil();
< prev index next >