Merge conditions using the same blocks.
This commit is contained in:
parent
36111ba582
commit
9214c65371
|
@ -8879,9 +8879,7 @@ public class StringUtils {
|
|||
for (int i = 0; i < strLen; ) {
|
||||
final int oldCodepoint = str.codePointAt(i);
|
||||
final int newCodePoint;
|
||||
if (Character.isUpperCase(oldCodepoint)) {
|
||||
newCodePoint = Character.toLowerCase(oldCodepoint);
|
||||
} else if (Character.isTitleCase(oldCodepoint)) {
|
||||
if (Character.isUpperCase(oldCodepoint) || Character.isTitleCase(oldCodepoint)) {
|
||||
newCodePoint = Character.toLowerCase(oldCodepoint);
|
||||
} else if (Character.isLowerCase(oldCodepoint)) {
|
||||
newCodePoint = Character.toUpperCase(oldCodepoint);
|
||||
|
|
|
@ -195,9 +195,7 @@ public class EventListenerSupport<L> implements Serializable {
|
|||
*/
|
||||
public void addListener(final L listener, final boolean allowDuplicate) {
|
||||
Validate.notNull(listener, "Listener object cannot be null.");
|
||||
if (allowDuplicate) {
|
||||
listeners.add(listener);
|
||||
} else if (!listeners.contains(listener)) {
|
||||
if (allowDuplicate || !listeners.contains(listener)) {
|
||||
listeners.add(listener);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -757,10 +757,8 @@ public class MethodUtils {
|
|||
return method;
|
||||
} else if (methodName.equals(method.getName()) &&
|
||||
ClassUtils.isAssignable(parameterTypes, method.getParameterTypes(), true)) {
|
||||
if (inexactMatch == null) {
|
||||
inexactMatch = method;
|
||||
} else if (distance(parameterTypes, method.getParameterTypes())
|
||||
< distance(parameterTypes, inexactMatch.getParameterTypes())) {
|
||||
if ((inexactMatch == null) || (distance(parameterTypes, method.getParameterTypes())
|
||||
< distance(parameterTypes, inexactMatch.getParameterTypes()))) {
|
||||
inexactMatch = method;
|
||||
}
|
||||
}
|
||||
|
@ -1007,14 +1005,10 @@ public class MethodUtils {
|
|||
Class<?> acls;
|
||||
if (interfaceIndex >= allInterfaces.size()) {
|
||||
acls = allSuperclasses.get(superClassIndex++);
|
||||
} else if (superClassIndex >= allSuperclasses.size()) {
|
||||
} else if ((superClassIndex >= allSuperclasses.size()) || (interfaceIndex < superClassIndex) || !(superClassIndex < interfaceIndex)) {
|
||||
acls = allInterfaces.get(interfaceIndex++);
|
||||
} else if (interfaceIndex < superClassIndex) {
|
||||
acls = allInterfaces.get(interfaceIndex++);
|
||||
} else if (superClassIndex < interfaceIndex) {
|
||||
acls = allSuperclasses.get(superClassIndex++);
|
||||
} else {
|
||||
acls = allInterfaces.get(interfaceIndex++);
|
||||
acls = allSuperclasses.get(superClassIndex++);
|
||||
}
|
||||
allSuperClassesAndInterfaces.add(acls);
|
||||
}
|
||||
|
|
|
@ -582,10 +582,7 @@ public class WordUtils {
|
|||
|
||||
for (int i = 0; i < buffer.length; i++) {
|
||||
final char ch = buffer[i];
|
||||
if (Character.isUpperCase(ch)) {
|
||||
buffer[i] = Character.toLowerCase(ch);
|
||||
whitespace = false;
|
||||
} else if (Character.isTitleCase(ch)) {
|
||||
if (Character.isUpperCase(ch) || Character.isTitleCase(ch)) {
|
||||
buffer[i] = Character.toLowerCase(ch);
|
||||
whitespace = false;
|
||||
} else if (Character.isLowerCase(ch)) {
|
||||
|
|
Loading…
Reference in New Issue