< prev index next >

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

Print this page




  62     boolean isSerializable = false;
  63 
  64     /** Is this a lambda environment?
  65      */
  66     boolean isLambda = false;
  67 
  68     /** Is this a speculative attribution environment?
  69      */
  70     boolean isSpeculative = false;
  71 
  72     /**
  73      *  Is this an attribution environment for an anonymous class instantiated using <> ?
  74      */
  75     boolean isAnonymousDiamond = false;
  76 
  77     /**
  78      *  Is this an attribution environment for an instance creation expression?
  79      */
  80     boolean isNewClass = false;
  81 










  82     /** Indicate if the type being visited is a service implementation
  83      */
  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      */


 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.yieldResult = yieldResult;
 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();
 153         return scope.getSymbols();
 154     }
 155 
 156     boolean lastResolveVarargs() {
 157         return pendingResolutionPhase != null &&
 158                 pendingResolutionPhase.isVarargsRequired();


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


 129 
 130     /** Duplicate this context, replacing scope field and copying all others.
 131      */
 132     AttrContext dup(WriteableScope scope) {
 133         AttrContext info = new AttrContext();
 134         info.scope = scope;
 135         info.staticLevel = staticLevel;
 136         info.isSelfCall = isSelfCall;
 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.isSpeculative = isSpeculative;
 147         info.isAnonymousDiamond = isAnonymousDiamond;
 148         info.isNewClass = isNewClass;
 149         info.inWithField = inWithField;
 150         info.isQuestioned = isQuestioned;
 151         info.preferredTreeForDiagnostics = preferredTreeForDiagnostics;
 152         info.visitingServiceImplementation = visitingServiceImplementation;
 153         return info;
 154     }
 155 
 156     /** Duplicate this context, copying all fields.
 157      */
 158     AttrContext dup() {
 159         return dup(scope);
 160     }
 161 
 162     public Iterable<Symbol> getLocalElements() {
 163         if (scope == null)
 164             return List.nil();
 165         return scope.getSymbols();
 166     }
 167 
 168     boolean lastResolveVarargs() {
 169         return pendingResolutionPhase != null &&
 170                 pendingResolutionPhase.isVarargsRequired();
< prev index next >