ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeffrey E Care <ca...@us.ibm.com>
Subject Re: Do we want to break BWC in AntClassLoader$ResourceEnumeration? (was Re: DO NOT REPLY [Bug 51579] ...)
Date Sat, 06 Aug 2011 19:48:37 GMT
Stefan Bodewig <bodewig@apache.org> wrote on 08/06/2011 12:43:28 PM:

> On 2011-07-29, <bugzilla@apache.org> wrote:
> 
> > https://issues.apache.org/bugzilla/show_bug.cgi?id=51579
> 
> The Enumeration returned by AntClassloader#getResources violates the
> Enumeration contract in that getNextElement() returns null rather than
> throwing a NoSuchElementException when the enumeration is exhausted.  It
> has done so for ten years now.
> 
> Do we want to make it adhere to the contract or does anybody feel this
> is too dangerous?

Obviously since I reported the problem I think it should be fixed. If 
Enumeration is used as intended (i.e. looping against hasMoreElements) 
then the fix is invisible; the fix only comes into play when code is 
written to the API contract for nextElement to throw an exception.

JEC
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message