Remove Method.getParameterCount() because it is only available in Java 8. Use getParameterTypes().length instead.

pull/419/head
Brett Wooldridge 10 years ago
parent 1e8ea2b3e2
commit dbeb5ab1cb

@ -127,7 +127,7 @@ public final class PropertyElf
List<Method> methods = Arrays.asList(target.getClass().getMethods());
for (Method method : methods) {
if (method.getName().equals(methodName) && method.getParameterCount() == 1) {
if (method.getName().equals(methodName) && method.getParameterTypes().length == 1) {
writeMethod = method;
break;
}
@ -136,7 +136,7 @@ public final class PropertyElf
if (writeMethod == null) {
methodName = "set" + propName.toUpperCase();
for (Method method : methods) {
if (method.getName().equals(methodName) && method.getParameterCount() == 1) {
if (method.getName().equals(methodName) && method.getParameterTypes().length == 1) {
writeMethod = method;
break;
}

Loading…
Cancel
Save