diff options
author | Stefan Bodewig <bodewig@apache.org> | 2023-04-03 12:36:33 +0200 |
---|---|---|
committer | Stefan Bodewig <bodewig@apache.org> | 2023-04-03 12:39:14 +0200 |
commit | d29f62fcc2d263878c1b53fc10d9bd4b9dbc8377 (patch) | |
tree | 210244d74548871d0001e3aeecc5cf68747fcc85 | |
parent | ec02ae2c3df7ea40d8099ab1da35e1c9d3b3533f (diff) | |
download | ant-d29f62fcc2d263878c1b53fc10d9bd4b9dbc8377.tar.gz |
really compare the names as the javadocs claim
https://bz.apache.org/bugzilla/show_bug.cgi?id=66496
-rw-r--r-- | WHATSNEW | 7 | ||||
-rw-r--r-- | src/main/org/apache/tools/ant/types/Resource.java | 2 |
2 files changed, 8 insertions, 1 deletions
@@ -1,6 +1,13 @@ Changes from Ant 1.10.13 TO Ant 1.10.14 ======================================= +Changes that could break older environments: +------------------------------------------- + + * Resource#compareTo now invokes getName rather than toString as the + later may be costly (for example in the case of a StringResource). + Bugzilla Report 66496 + Fixed bugs: ----------- diff --git a/src/main/org/apache/tools/ant/types/Resource.java b/src/main/org/apache/tools/ant/types/Resource.java index 12563d426..954757f25 100644 --- a/src/main/org/apache/tools/ant/types/Resource.java +++ b/src/main/org/apache/tools/ant/types/Resource.java @@ -277,7 +277,7 @@ public class Resource extends DataType implements Comparable<Resource>, Resource if (isReference()) { return getRef().compareTo(other); } - return toString().compareTo(other.toString()); + return getName().compareTo(other.getName()); } /** |