Using Method.getParameterCount() per Rémi's suggestion. Updated: http://cr.openjdk.java.net/~sundar/8157819/webrev.02/
Thanks, -Sundar On 5/25/2016 5:39 PM, Remi Forax wrote: > ----- Mail original ----- >> De: "Michael Haupt" <michael.ha...@oracle.com> >> À: "Sundararajan Athijegannathan" <sundararajan.athijegannat...@oracle.com> >> Cc: nashorn-dev@openjdk.java.net >> Envoyé: Mercredi 25 Mai 2016 13:49:39 >> Objet: Re: RFR 8157819: TypeError when a java.util.Comparator object is >> invoked as a function >> > > Hi Sundar, Hi Mickael, > >> Hi Sundar, >> >> lower-case thumbs up, with remarks. >> >> * "is this a overridable" -> "... an overridable" >> >> * My feeling: the name isOverridableObjectMethod would describe the method's >> intent more clearly. > yes > >> * How about comparing the method types to statically initialised MethodType >> instances obtained from the methods in question? > you need to go to the route that create a MethodType from a Method, which > require an allocation. > > Sundar, i think you can use Method.getParamaterCount() [1] instead of > m.getParameterTypes().length, because m.getParameterTypes() clones the > returning array. > >> Best, >> >> Michael > cheers, > > Rémi > > [1] > https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Method.html#getParameterCount-- > > >>> Am 25.05.2016 um 12:49 schrieb Sundararajan Athijegannathan >>> <sundararajan.athijegannat...@oracle.com>: >>> >>> Please review http://cr.openjdk.java.net/~sundar/8157819/webrev.00 for >>> https://bugs.openjdk.java.net/browse/JDK-8157819 >>> >>> Thanks, >>> >>> -Sundar >>> >> -- >> >> <http://www.oracle.com/> >> Dr. Michael Haupt | Principal Member of Technical Staff >> Phone: +49 331 200 7277 | Fax: +49 331 200 7561 >> Oracle Java Platform Group | LangTools Team | Nashorn >> Oracle Deutschland B.V. & Co. KG | Schiffbauergasse 14 | 14467 Potsdam, >> Germany >> >> ORACLE Deutschland B.V. & Co. KG | Hauptverwaltung: Riesstraße 25, D-80992 >> München >> Registergericht: Amtsgericht München, HRA 95603 >> >> Komplementärin: ORACLE Deutschland Verwaltung B.V. | Hertogswetering 163/167, >> 3543 AS Utrecht, Niederlande >> Handelsregister der Handelskammer Midden-Nederland, Nr. 30143697 >> Geschäftsführer: Alexander van der Ven, Jan Schultheiss, Val Maher >> <http://www.oracle.com/commitment> Oracle is committed to developing >> practices and products that help protect the environment >> >>