You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bo...@apache.org on 2020/07/29 13:06:55 UTC

[ant] branch master updated: Refactor getCheckedRef()

This is an automated email from the ASF dual-hosted git repository.

bodewig pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ant.git


The following commit(s) were added to refs/heads/master by this push:
     new 612faa8  Refactor getCheckedRef()
     new 3b06118  Merge pull request #131 from twogee/getref
612faa8 is described below

commit 612faa8f44e2e31450ccf7bc5105f506453cd485
Author: twogee <g....@gmail.com>
AuthorDate: Mon Jul 27 14:02:24 2020 +0200

    Refactor getCheckedRef()
---
 .../types/resources/comparators/DelegatedResourceComparator.java  | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/main/org/apache/tools/ant/types/resources/comparators/DelegatedResourceComparator.java b/src/main/org/apache/tools/ant/types/resources/comparators/DelegatedResourceComparator.java
index 55a13f1..34069a9 100644
--- a/src/main/org/apache/tools/ant/types/resources/comparators/DelegatedResourceComparator.java
+++ b/src/main/org/apache/tools/ant/types/resources/comparators/DelegatedResourceComparator.java
@@ -64,7 +64,7 @@ public class DelegatedResourceComparator extends ResourceComparator {
             return true;
         }
         if (isReference()) {
-            return getCheckedRef(DelegatedResourceComparator.class).equals(o);
+            return getRef().equals(o);
         }
         if (o instanceof DelegatedResourceComparator) {
             List<ResourceComparator> ov = ((DelegatedResourceComparator) o).resourceComparators;
@@ -80,7 +80,7 @@ public class DelegatedResourceComparator extends ResourceComparator {
     @Override
     public synchronized int hashCode() {
         if (isReference()) {
-            return getCheckedRef(DelegatedResourceComparator.class).hashCode();
+            return getRef().hashCode();
         }
         return resourceComparators == null ? 0 : resourceComparators.hashCode();
     }
@@ -118,6 +118,10 @@ s.
         }
     }
 
+    private DelegatedResourceComparator getRef() {
+        return getCheckedRef(DelegatedResourceComparator.class);
+    }
+
     private static Comparator<Resource> composite(List<? extends Comparator<Resource>> foo) {
         Comparator<Resource> result = null;
         if (foo != null) {