On Mon, 26 Apr 2004, Stephen Colebourne wrote: > The current Bag interface has the following javadoc warning: > > * <i>Note that this interface violates the [EMAIL PROTECTED] 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 [EMAIL PROTECTED] 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?
How about creating a Bag2 (or a better name) interface that does not violate the Collection contract and deprecating Bag and friends? michael --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]