changeset 1141:ec50962638d3

Bug: Compiler is generating redundant bridges for unbound method references
author mcimadamore
date Fri, 26 Aug 2011 12:29:56 +0100
parents 6a38e7ad078f
children 1b669fe38c5d
files src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java	Thu Aug 25 14:42:31 2011 +0100
+++ b/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java	Fri Aug 26 12:29:56 2011 +0100
@@ -813,6 +813,9 @@
          */
         boolean needsBridge() {
             Type samDesc = types.findDescriptor(tree.targetType);
+            if (isUnbound()) {
+                samDesc = types.createMethodTypeWithParameters(samDesc, samDesc.getParameterTypes().tail);
+            }
             return !types.hasSameArgs(types.erasure(samDesc), types.erasure(tree.sym.type));
         }