Browse Source

Fix the problem of instanceof test always return true.

This instanceof test will always return true because DataType is the superclass of variable nested's class ResourceComparator. The variable nested is not initialized, it would be better to do a null test rather than an instanceof test.
http://findbugs.sourceforge.net/bugDescriptions.html#BC_VACUOUS_INSTANCEOF
master
Kui LIU Stefan Bodewig 7 years ago
parent
commit
bb975e67e1
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/main/org/apache/tools/ant/types/resources/comparators/Reverse.java

+ 1
- 1
src/main/org/apache/tools/ant/types/resources/comparators/Reverse.java View File

@@ -81,7 +81,7 @@ public class Reverse extends ResourceComparator {
if (isReference()) {
super.dieOnCircularReference(stk, p);
} else {
if (nested instanceof DataType) {
if (nested != null) {
pushAndInvokeCircularReferenceCheck((DataType) nested, stk,
p);
}


Loading…
Cancel
Save