diff -r 7fe655cad9b1 -r 6b48ebae2569 src/share/classes/com/sun/tools/javac/code/Types.java --- a/src/share/classes/com/sun/tools/javac/code/Types.java Tue Jun 11 09:59:34 2013 +0100 +++ b/src/share/classes/com/sun/tools/javac/code/Types.java Fri Jun 14 16:25:09 2013 +0100 @@ -951,6 +951,22 @@ } /** + * A polymorphic signature method (JLS SE 7, 8.4.1) is a method that + * (i) is declared in the java.lang.invoke.MethodHandle class, (ii) takes + * a single variable arity parameter (iii) whose declared type is Object[], + * (iv) has a return type of Object and (v) is native. + */ + public boolean isSignaturePolymorphic(MethodSymbol msym) { + List argtypes = msym.type.getParameterTypes(); + return (msym.flags_field & NATIVE) != 0 && + msym.owner == syms.methodHandleType.tsym && + argtypes.tail.tail == null && + argtypes.head.hasTag(TypeTag.ARRAY) && + msym.type.getReturnType().tsym == syms.objectType.tsym && + ((ArrayType)argtypes.head).elemtype.tsym == syms.objectType.tsym; + } + + /** * Is t the same type as s? */ public boolean isSameType(Type t, Type s) {