< prev index next >

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

Print this page

        

*** 1260,1271 **** if (refSym.isConstructor()) { return ClassFile.REF_newInvokeSpecial; } else { if (refSym.isStatic()) { return ClassFile.REF_invokeStatic; - } else if ((refSym.flags() & PRIVATE) != 0) { - return ClassFile.REF_invokeSpecial; } else if (refSym.enclClass().isInterface()) { return ClassFile.REF_invokeInterface; } else { return ClassFile.REF_invokeVirtual; } --- 1260,1269 ----
*** 2335,2355 **** //when 292 issue is fixed we should remove this and change the backend //code to always generate a method handle to an accessible method return tree.ownerAccessible; } - /** - * The VM does not support access across nested classes (8010319). - * Were that ever to change, this should be removed. - */ - boolean isPrivateInOtherClass() { - return (tree.sym.flags() & PRIVATE) != 0 && - !types.isSameType( - types.erasure(tree.sym.enclClass().asType()), - types.erasure(owner.enclClass().asType())); - } - boolean isProtectedInSuperClassOfEnclosingClassInOtherPackage() { return ((tree.sym.flags() & PROTECTED) != 0 && tree.sym.packge() != owner.packge() && !owner.enclClass().isSubClass(tree.sym.owner, types)); } --- 2333,2342 ----
*** 2387,2397 **** final boolean needsConversionToLambda() { return interfaceParameterIsIntersectionOrUnionType() || isSuper || needsVarArgsConversion() || isArrayOp() || - isPrivateInOtherClass() || isProtectedInSuperClassOfEnclosingClassInOtherPackage() || !receiverAccessible() || (tree.getMode() == ReferenceMode.NEW && tree.kind != ReferenceKind.ARRAY_CTOR && (tree.sym.owner.isLocal() || tree.sym.owner.isInner())); --- 2374,2383 ----
< prev index next >