PMD: Nested if statements can be combined
This commit is contained in:
parent
fb4803623b
commit
c82b1f062a
|
@ -372,12 +372,10 @@ public class RandomStringUtils {
|
||||||
final int zero_digit_ascii = 48;
|
final int zero_digit_ascii = 48;
|
||||||
final int first_letter_ascii = 65;
|
final int first_letter_ascii = 65;
|
||||||
|
|
||||||
if (chars == null) {
|
if (chars == null && (numbers && end <= zero_digit_ascii
|
||||||
if (numbers && end <= zero_digit_ascii
|
|| letters && end <= first_letter_ascii)) {
|
||||||
|| letters && end <= first_letter_ascii) {
|
throw new IllegalArgumentException("Parameter end (" + end + ") must be greater then (" + zero_digit_ascii + ") for generating digits " +
|
||||||
throw new IllegalArgumentException("Parameter end (" + end + ") must be greater then (" + zero_digit_ascii + ") for generating digits " +
|
"or greater then (" + first_letter_ascii + ") for generating letters.");
|
||||||
"or greater then (" + first_letter_ascii + ") for generating letters.");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
StringBuilder builder = new StringBuilder(count);
|
StringBuilder builder = new StringBuilder(count);
|
||||||
|
|
|
@ -211,10 +211,8 @@ public class MethodUtils {
|
||||||
messagePrefix = "No such method: ";
|
messagePrefix = "No such method: ";
|
||||||
method = getMatchingMethod(object.getClass(),
|
method = getMatchingMethod(object.getClass(),
|
||||||
methodName, parameterTypes);
|
methodName, parameterTypes);
|
||||||
if (method != null) {
|
if (method != null && !method.isAccessible()) {
|
||||||
if (!method.isAccessible()) {
|
method.setAccessible(true);
|
||||||
method.setAccessible(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
messagePrefix = "No such accessible method: ";
|
messagePrefix = "No such accessible method: ";
|
||||||
|
|
Loading…
Reference in New Issue