Repository: ant Updated Branches: refs/heads/master e18de97c4 -> 9f4587ca6
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 Project: http://git-wip-us.apache.org/repos/asf/ant/repo Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/bb975e67 Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/bb975e67 Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/bb975e67 Branch: refs/heads/master Commit: bb975e67e154a84b5dd47b5a5b24f853758dc7a5 Parents: 3a5bf99 Author: Kui LIU <[email protected]> Authored: Wed Oct 11 11:54:00 2017 +0200 Committer: Stefan Bodewig <[email protected]> Committed: Wed Oct 11 12:03:11 2017 +0200 ---------------------------------------------------------------------- .../org/apache/tools/ant/types/resources/comparators/Reverse.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ant/blob/bb975e67/src/main/org/apache/tools/ant/types/resources/comparators/Reverse.java ---------------------------------------------------------------------- diff --git a/src/main/org/apache/tools/ant/types/resources/comparators/Reverse.java b/src/main/org/apache/tools/ant/types/resources/comparators/Reverse.java index c787a76..5da3ebb 100644 --- a/src/main/org/apache/tools/ant/types/resources/comparators/Reverse.java +++ b/src/main/org/apache/tools/ant/types/resources/comparators/Reverse.java @@ -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); }
