Combine nested 'if' statement in 'else' block to 'else if'.
MODIFY
src/main/java/org/apache/commons/io/FilenameUtils.java
src/main/java/org/apache/commons/io/FilenameUtils.java
@@ -1427,13 +1427,11 @@ public static boolean wildcardMatch(final String fileName, final String wildcard
if (repeat >= 0) {
backtrack.push(new int[] {wcsIdx, repeat});
}
- } else {
+ } else if (!caseSensitivity.checkRegionMatches(fileName, textIdx, wcs[wcsIdx])) {
// matching from current position
- if (!caseSensitivity.checkRegionMatches(fileName, textIdx, wcs[wcsIdx])) {
// couldn't match token
break;
}
- }
// matched text token, move text index to end of matched token
textIdx += wcs[wcsIdx].length();

MODIFY
src/main/java/org/apache/commons/io/output/XmlStreamWriter.java
src/main/java/org/apache/commons/io/output/XmlStreamWriter.java
@@ -178,13 +178,11 @@ private void detectEncoding(final char[] cbuf, final int off, final int len)
// encoding
encoding = defaultEncoding;
}
- } else {
- if (xmlProlog.length() >= BUFFER_SIZE) {
+ } else if (xmlProlog.length() >= BUFFER_SIZE) {
// no encoding found in first characters: using default
// encoding
encoding = defaultEncoding;
}
- }
} else {
// no XML prolog: using default encoding
encoding = defaultEncoding;

Combine nested 'if' statement in 'else' block to 'else if'.