< prev index next >

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

Print this page




2292                         TypeVar tv = (TypeVar) t;
2293                         return isIntersectionOrUnionType(tv.getUpperBound());
2294                 }
2295                 return false;
2296             }
2297 
2298             /**
2299              * Does this reference need to be converted to a lambda
2300              * (i.e. var args need to be expanded or "super" is used)
2301              */
2302             final boolean needsConversionToLambda() {
2303                 return interfaceParameterIsIntersectionOrUnionType() ||
2304                         isSuper ||
2305                         needsVarArgsConversion() ||
2306                         isArrayOp() ||
2307                         isPrivateInOtherClass() ||
2308                         isProtectedInSuperClassOfEnclosingClassInOtherPackage() ||
2309                         !receiverAccessible() ||
2310                         (tree.getMode() == ReferenceMode.NEW &&
2311                           tree.kind != ReferenceKind.ARRAY_CTOR &&
2312                           (tree.sym.owner.isLocal() || tree.sym.owner.isInner()));
2313             }
2314 
2315             Type generatedRefSig() {
2316                 return types.erasure(tree.sym.type);
2317             }
2318 
2319             Type bridgedRefSig() {
2320                 return types.erasure(types.findDescriptorSymbol(tree.target.tsym).type);
2321             }
2322         }
2323     }
2324     // </editor-fold>
2325 
2326     /*
2327      * These keys provide mappings for various translated lambda symbols
2328      * and the prevailing order must be maintained.
2329      */
2330     enum LambdaSymbolKind {
2331         PARAM,          // original to translated lambda parameters
2332         LOCAL_VAR,      // original to translated lambda locals




2292                         TypeVar tv = (TypeVar) t;
2293                         return isIntersectionOrUnionType(tv.getUpperBound());
2294                 }
2295                 return false;
2296             }
2297 
2298             /**
2299              * Does this reference need to be converted to a lambda
2300              * (i.e. var args need to be expanded or "super" is used)
2301              */
2302             final boolean needsConversionToLambda() {
2303                 return interfaceParameterIsIntersectionOrUnionType() ||
2304                         isSuper ||
2305                         needsVarArgsConversion() ||
2306                         isArrayOp() ||
2307                         isPrivateInOtherClass() ||
2308                         isProtectedInSuperClassOfEnclosingClassInOtherPackage() ||
2309                         !receiverAccessible() ||
2310                         (tree.getMode() == ReferenceMode.NEW &&
2311                           tree.kind != ReferenceKind.ARRAY_CTOR &&
2312                           (tree.sym.owner.isLocal() || tree.sym.owner.isInner() || tree.sym.owner.isValue()));
2313             }
2314 
2315             Type generatedRefSig() {
2316                 return types.erasure(tree.sym.type);
2317             }
2318 
2319             Type bridgedRefSig() {
2320                 return types.erasure(types.findDescriptorSymbol(tree.target.tsym).type);
2321             }
2322         }
2323     }
2324     // </editor-fold>
2325 
2326     /*
2327      * These keys provide mappings for various translated lambda symbols
2328      * and the prevailing order must be maintained.
2329      */
2330     enum LambdaSymbolKind {
2331         PARAM,          // original to translated lambda parameters
2332         LOCAL_VAR,      // original to translated lambda locals


< prev index next >