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