< prev index next >

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

Print this page

        

@@ -1260,12 +1260,10 @@
         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;
             }

@@ -2335,21 +2333,10 @@
                 //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));
             }

@@ -2387,11 +2374,10 @@
             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()));
< prev index next >