commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bryce L Nordgren <bnordg...@fs.fed.us>
Subject Re: [collections] VOTE: Collections-java5 direction ; notifying collections
Date Tue, 13 Mar 2007 00:47:26 GMT


Stephen Smith <steve@stephen-smith.co.uk> wrote on 03/12/2007 03:35:06 PM:

> That sounds like a good point to me. Have you thought about submitting
> some backwards compatibility test cases to Jira, to ensure we don't trip
> over any such problems?

I believe I wrote two Predicates (SuperclassPredicate and
SubclassPredicate).  Construct the AndPredicate(SuperclassPredicate(lower),
SubclassPredicate(upper)) and Bob's your uncle.  I don't know how to write
the test cases for generics.  What happens when you do:

public class PredicatedCollection<T> {
      <T> public static Collection<T> decorate(Collection<T>, Predicate)
{
.. }
} ;

and then try to run

Collection safe = PredicatedCollection.decorate(new ArrayList(),
myPredicate);

Does the compiler figure this out correctly or does it do something subtly
nonintuitive?

===
It may be that Java generics adds type safety for some.  However, if you're
passing collections back and forth between 1.4 code and 1.5/1.6 code, you
have all the potential problems of the un-typechecked world _plus_ the
false sense of security that you're "safe".  In short, your library offers
real type safety.  Please don't limit the "reboot" to the incomplete type
safety offered by Java generics.  There is real value added here.

On another note, I messed with commons-events (dormant).  I did it in the
GeoTools subversion server because I had commit access there.  The product
is a little incomplete and provides a "notifying collections" framework.
Sooner or later I have to polish it off.  When that happens, is there any
interest in folding it into commons-collections before or after the reboot?
If not, GeoTools is going to need to petition Apache to release the code to
us under LGPL instead of the ASL in order to make licencing manageable.  At
that time, I'll refactor it into the GeoTools package space.

Bryce


---------------------------------------------------------------------
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