commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Colebourne" <scolebou...@btopenworld.com>
Subject [collections] Bag interface
Date Sun, 25 Apr 2004 23:46:35 GMT
The current Bag interface has the following javadoc warning:

 * <i>Note that this interface violates the {@link Collection} contract.</i>
 * The behavior specified in many of these methods is <i>not</i> the same
 * as the behavior specified by <code>Collection</code>.  The noncompliant
methods
 * are clearly marked with "(Violation)".  A future
 * version of this class will specify the same behavior as
<code>Collection</code>,
 * which unfortunately will break backwards compatibility with this version.

This has caused bile-like derision in some quarters, and is not something
I've ever liked - its basically an artifact of collections history.

I propose that we change this to state that its wrong, but that we will keep
compatability:

 * <i>NOTE: This interface violates the {@link Collection} contract.</i>
 * The behavior specified in many of these methods is <i>not</i> the same
 * as the behavior specified by <code>Collection</code>.
 * The noncompliant methods are clearly marked with "(Violation)".
 * Exercise caution when using a bag as a <code>Collection</code>.
 * <p>
 * This violation resulted from the original specification of the interface.
 * In an ideal world, the interface would be changed to fix the problems,
however
 * it has been decided to maintain backwards compatibility instead.

Opinions?

Stephen



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message