Browse Source

make AntClassLoader$ResourceEnumeration adhere to the Enumeration contract. PR 51579

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@1155197 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 14 years ago
parent
commit
021d52822a
2 changed files with 10 additions and 0 deletions
  1. +6
    -0
      WHATSNEW
  2. +4
    -0
      src/main/org/apache/tools/ant/AntClassLoader.java

+ 6
- 0
WHATSNEW View File

@@ -4,6 +4,12 @@ Changes from Ant 1.8.2 TO Ant 1.8.3
Changes that could break older environments:
-------------------------------------------

* The Enumeration returned by AntClassLoader#getResources used to
return null in nextElement after hasNextElement would return false.
It has been changed to throw a NoSuchElementException instead so
that it now adheres to the contract of java.util.Enumeration.
Bugzilla Report 51579.

Fixed bugs:
-----------



+ 4
- 0
src/main/org/apache/tools/ant/AntClassLoader.java View File

@@ -33,6 +33,7 @@ import java.util.Enumeration;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.StringTokenizer;
import java.util.Vector;
import java.util.jar.Attributes;
@@ -127,6 +128,9 @@ public class AntClassLoader extends ClassLoader implements SubBuildListener {
*/
public Object nextElement() {
URL ret = this.nextResource;
if (ret == null) {
throw new NoSuchElementException();
}
findNextResource();
return ret;
}


Loading…
Cancel
Save