8242208: Use Method.getParameterCount where applicable

Reviewed-by: redestad, chegar
This commit is contained in:
Christoph Dreis 2020-04-06 13:46:09 +02:00 committed by Claes Redestad
parent e9adf7bbe1
commit 08b90285b2
3 changed files with 5 additions and 5 deletions

View file

@ -276,13 +276,13 @@ public class MethodHandleProxies {
switch (m.getName()) {
case "toString":
return (m.getReturnType() == String.class
&& m.getParameterTypes().length == 0);
&& m.getParameterCount() == 0);
case "hashCode":
return (m.getReturnType() == int.class
&& m.getParameterTypes().length == 0);
&& m.getParameterCount() == 0);
case "equals":
return (m.getReturnType() == boolean.class
&& m.getParameterTypes().length == 1
&& m.getParameterCount() == 1
&& m.getParameterTypes()[0] == Object.class);
}
return false;