Polishing
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -66,8 +66,7 @@ abstract class PropertyDescriptorUtils {
|
||||
Class<?> propertyType = null;
|
||||
|
||||
if (readMethod != null) {
|
||||
int parameterCount = readMethod.getParameterCount();
|
||||
if (parameterCount != 0) {
|
||||
if (readMethod.getParameterCount() != 0) {
|
||||
throw new IntrospectionException("Bad read method arg count: " + readMethod);
|
||||
}
|
||||
propertyType = readMethod.getReturnType();
|
||||
|
||||
@@ -342,22 +342,20 @@ class ConstructorResolver {
|
||||
if (uniqueCandidate == null) {
|
||||
uniqueCandidate = candidate;
|
||||
}
|
||||
else {
|
||||
boolean paramsNotMatch = isParamsNotMatch(uniqueCandidate, candidate);
|
||||
if (paramsNotMatch) {
|
||||
uniqueCandidate = null;
|
||||
break;
|
||||
}
|
||||
else if (isParamMismatch(uniqueCandidate, candidate)) {
|
||||
uniqueCandidate = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
mbd.factoryMethodToIntrospect = uniqueCandidate;
|
||||
}
|
||||
|
||||
private boolean isParamsNotMatch(Method uniqueCandidate, Method candidate) {
|
||||
private boolean isParamMismatch(Method uniqueCandidate, Method candidate) {
|
||||
int uniqueCandidateParameterCount = uniqueCandidate.getParameterCount();
|
||||
int candidateParameterCount = candidate.getParameterCount();
|
||||
return uniqueCandidateParameterCount != candidateParameterCount || !Arrays.equals(uniqueCandidate.getParameterTypes(), candidate.getParameterTypes());
|
||||
return (uniqueCandidateParameterCount != candidateParameterCount ||
|
||||
!Arrays.equals(uniqueCandidate.getParameterTypes(), candidate.getParameterTypes()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user