langtools/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java
changeset 16328 8b9eb42167f6
parent 16327 01a0c0cb811c
child 16332 4297c99c4899
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java	Tue Mar 05 14:16:07 2013 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java	Tue Mar 05 14:19:49 2013 +0000
@@ -1775,16 +1775,26 @@
             }
 
             boolean isPrivateConstructor() {
+                //hack needed to workaround 292 bug (8005122)
+                //when 292 issue is fixed we should simply remove this
                 return tree.sym.name == names.init &&
                         (tree.sym.flags() & PRIVATE) != 0;
             }
 
+            boolean receiverAccessible() {
+                //hack needed to workaround 292 bug (7087658)
+                //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;
+            }
+
             /**
              * Does this reference needs a bridge (i.e. var args need to be
              * expanded or "super" is used)
              */
             final boolean needsBridge() {
-                return isSuper || needsVarArgsConversion() || isArrayOp() || isPrivateConstructor();
+                return isSuper || needsVarArgsConversion() || isArrayOp() ||
+                        isPrivateConstructor() || !receiverAccessible();
             }
 
             Type generatedRefSig() {