< prev index next >

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

Print this page

 71     boolean isSerializableLambda = false;
 72 
 73     /** Is this a lambda environment?
 74      */
 75     boolean isLambda = false;
 76 
 77     /** Is this a speculative attribution environment?
 78      */
 79     AttributionMode attributionMode = AttributionMode.FULL;
 80 
 81     /**
 82      *  Is this an attribution environment for an anonymous class instantiated using <> ?
 83      */
 84     boolean isAnonymousDiamond = false;
 85 
 86     /**
 87      *  Is this an attribution environment for an instance creation expression?
 88      */
 89     boolean isNewClass = false;
 90 





 91     /** Indicate if the type being visited is a service implementation
 92      */
 93     boolean visitingServiceImplementation = false;
 94 
 95     /** Are arguments to current function applications boxed into an array for varargs?
 96      */
 97     Resolve.MethodResolutionPhase pendingResolutionPhase = null;
 98 
 99     /** A record of the lint/SuppressWarnings currently in effect
100      */
101     Lint lint;
102 
103     /** The variable whose initializer is being attributed
104      * useful for detecting self-references in variable initializers
105      */
106     Symbol enclVar = null;
107 
108     /** ResultInfo to be used for attributing 'return' statement expressions
109      * (set by Attr.visitMethod and Attr.visitLambda)
110      */

130      */
131     AttrContext dup(WriteableScope scope) {
132         AttrContext info = new AttrContext();
133         info.scope = scope;
134         info.staticLevel = staticLevel;
135         info.isSelfCall = isSelfCall;
136         info.constructorArgs = constructorArgs;
137         info.selectSuper = selectSuper;
138         info.pendingResolutionPhase = pendingResolutionPhase;
139         info.lint = lint;
140         info.enclVar = enclVar;
141         info.returnResult = returnResult;
142         info.yieldResult = yieldResult;
143         info.defaultSuperCallSite = defaultSuperCallSite;
144         info.isSerializable = isSerializable;
145         info.isLambda = isLambda;
146         info.isSerializableLambda = isSerializableLambda;
147         info.attributionMode = attributionMode;
148         info.isAnonymousDiamond = isAnonymousDiamond;
149         info.isNewClass = isNewClass;

150         info.preferredTreeForDiagnostics = preferredTreeForDiagnostics;
151         info.visitingServiceImplementation = visitingServiceImplementation;
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();

 71     boolean isSerializableLambda = false;
 72 
 73     /** Is this a lambda environment?
 74      */
 75     boolean isLambda = false;
 76 
 77     /** Is this a speculative attribution environment?
 78      */
 79     AttributionMode attributionMode = AttributionMode.FULL;
 80 
 81     /**
 82      *  Is this an attribution environment for an anonymous class instantiated using <> ?
 83      */
 84     boolean isAnonymousDiamond = false;
 85 
 86     /**
 87      *  Is this an attribution environment for an instance creation expression?
 88      */
 89     boolean isNewClass = false;
 90 
 91     /**
 92      *  Is this an attribution environment for a withfield operation ?
 93      */
 94     boolean inWithField = false;
 95 
 96     /** Indicate if the type being visited is a service implementation
 97      */
 98     boolean visitingServiceImplementation = false;
 99 
100     /** Are arguments to current function applications boxed into an array for varargs?
101      */
102     Resolve.MethodResolutionPhase pendingResolutionPhase = null;
103 
104     /** A record of the lint/SuppressWarnings currently in effect
105      */
106     Lint lint;
107 
108     /** The variable whose initializer is being attributed
109      * useful for detecting self-references in variable initializers
110      */
111     Symbol enclVar = null;
112 
113     /** ResultInfo to be used for attributing 'return' statement expressions
114      * (set by Attr.visitMethod and Attr.visitLambda)
115      */

135      */
136     AttrContext dup(WriteableScope scope) {
137         AttrContext info = new AttrContext();
138         info.scope = scope;
139         info.staticLevel = staticLevel;
140         info.isSelfCall = isSelfCall;
141         info.constructorArgs = constructorArgs;
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.inWithField = inWithField;
156         info.preferredTreeForDiagnostics = preferredTreeForDiagnostics;
157         info.visitingServiceImplementation = visitingServiceImplementation;
158         return info;
159     }
160 
161     /** Duplicate this context, copying all fields.
162      */
163     AttrContext dup() {
164         return dup(scope);
165     }
166 
167     public Iterable<Symbol> getLocalElements() {
168         if (scope == null)
169             return List.nil();
170         return scope.getSymbols();
171     }
172 
173     boolean lastResolveVarargs() {
174         return pendingResolutionPhase != null &&
175                 pendingResolutionPhase.isVarargsRequired();
< prev index next >