< prev index next >

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

Print this page

109      * (set by Attr.visitMethod and Attr.visitLambda)
110      */
111     Attr.ResultInfo returnResult = null;
112 
113     /** ResultInfo to be used for attributing 'yield' statement expressions
114      * (set by Attr.visitSwitchExpression)
115      */
116     Attr.ResultInfo yieldResult = null;
117 
118     /** Symbol corresponding to the site of a qualified default super call
119      */
120     Type defaultSuperCallSite = null;
121 
122     /** Tree that when non null, is to be preferentially used in diagnostics.
123      *  Usually Env<AttrContext>.tree is the tree to be referred to in messages,
124      *  but this may not be true during the window a method is looked up in enclosing
125      *  contexts (JDK-8145466)
126      */
127     JCTree preferredTreeForDiagnostics;
128 


129     /** Duplicate this context, replacing scope field and copying all others.
130      */
131     AttrContext dup(WriteableScope scope) {
132         AttrContext info = new AttrContext();
133         info.scope = scope;
134         info.staticLevel = staticLevel;
135         info.ctorPrologue = ctorPrologue;
136         info.selectSuper = selectSuper;
137         info.pendingResolutionPhase = pendingResolutionPhase;
138         info.lint = lint;
139         info.enclVar = enclVar;
140         info.returnResult = returnResult;
141         info.yieldResult = yieldResult;
142         info.defaultSuperCallSite = defaultSuperCallSite;
143         info.isSerializable = isSerializable;
144         info.isLambda = isLambda;
145         info.isSerializableLambda = isSerializableLambda;
146         info.attributionMode = attributionMode;
147         info.isAnonymousDiamond = isAnonymousDiamond;
148         info.isNewClass = isNewClass;
149         info.preferredTreeForDiagnostics = preferredTreeForDiagnostics;
150         info.visitingServiceImplementation = visitingServiceImplementation;
151         info.allowProtectedAccess = allowProtectedAccess;

152         return info;
153     }
154 
155     /** Duplicate this context, copying all fields.
156      */
157     AttrContext dup() {
158         return dup(scope);
159     }
160 
161     public Iterable<Symbol> getLocalElements() {
162         if (scope == null)
163             return List.nil();
164         return scope.getSymbols();
165     }
166 
167     boolean lastResolveVarargs() {
168         return pendingResolutionPhase != null &&
169                 pendingResolutionPhase.isVarargsRequired();
170     }
171 

109      * (set by Attr.visitMethod and Attr.visitLambda)
110      */
111     Attr.ResultInfo returnResult = null;
112 
113     /** ResultInfo to be used for attributing 'yield' statement expressions
114      * (set by Attr.visitSwitchExpression)
115      */
116     Attr.ResultInfo yieldResult = null;
117 
118     /** Symbol corresponding to the site of a qualified default super call
119      */
120     Type defaultSuperCallSite = null;
121 
122     /** Tree that when non null, is to be preferentially used in diagnostics.
123      *  Usually Env<AttrContext>.tree is the tree to be referred to in messages,
124      *  but this may not be true during the window a method is looked up in enclosing
125      *  contexts (JDK-8145466)
126      */
127     JCTree preferredTreeForDiagnostics;
128 
129     boolean instanceInitializerBlock = false;
130 
131     /** Duplicate this context, replacing scope field and copying all others.
132      */
133     AttrContext dup(WriteableScope scope) {
134         AttrContext info = new AttrContext();
135         info.scope = scope;
136         info.staticLevel = staticLevel;
137         info.ctorPrologue = ctorPrologue;
138         info.selectSuper = selectSuper;
139         info.pendingResolutionPhase = pendingResolutionPhase;
140         info.lint = lint;
141         info.enclVar = enclVar;
142         info.returnResult = returnResult;
143         info.yieldResult = yieldResult;
144         info.defaultSuperCallSite = defaultSuperCallSite;
145         info.isSerializable = isSerializable;
146         info.isLambda = isLambda;
147         info.isSerializableLambda = isSerializableLambda;
148         info.attributionMode = attributionMode;
149         info.isAnonymousDiamond = isAnonymousDiamond;
150         info.isNewClass = isNewClass;
151         info.preferredTreeForDiagnostics = preferredTreeForDiagnostics;
152         info.visitingServiceImplementation = visitingServiceImplementation;
153         info.allowProtectedAccess = allowProtectedAccess;
154         info.instanceInitializerBlock = instanceInitializerBlock;
155         return info;
156     }
157 
158     /** Duplicate this context, copying all fields.
159      */
160     AttrContext dup() {
161         return dup(scope);
162     }
163 
164     public Iterable<Symbol> getLocalElements() {
165         if (scope == null)
166             return List.nil();
167         return scope.getSymbols();
168     }
169 
170     boolean lastResolveVarargs() {
171         return pendingResolutionPhase != null &&
172                 pendingResolutionPhase.isVarargsRequired();
173     }
174 
< prev index next >