commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Commons Wiki] Update of "Sanity Check of APIs, etc." by MattBenson
Date Sat, 21 Jan 2012 03:24:40 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Commons Wiki" for change notification.

The "Sanity Check of APIs, etc." page has been changed by MattBenson:

finish my comments

     (Same question would apply to -Predicate and -Procedure in addition to -Function) Using
a vararg parameter would preclude the binary (and hypothetical ternary, etc.) functors from
supporting different strongly typed arguments.  I think it would be a step backward.  MJB
   * '''''EachElement should be able to work on any Iterable. Also I'm not sure to understand
why its constructor is public.'''''
+    Agreed about the first point; added
.  As to why the ctor is public, the javadoc says "This constructor is public to permit tools
that require a JavaBean instance to operate."  Not sure how many tools actually still need
this.  Velocity was the primary suspect for ages; does anyone know if it still needs a bean
   * '''''Shouldn't Generator implement Iterable?'''''
+    It doesn't seem so to me.  It's possible some more expository name could be found for
   * '''''why are equals, hashCode and toString defined in the Functor interface?'''''
     I don't feel strongly about this.  The original author/s of [functor] presumably used
this as a natural place to put their javadoc comments urging that functor implementations
properly implement these methods.  Feel free to POLL or VOTE on the dev list.
@@ -25, +27 @@

     The static method is the option to choose for strong typing.  I don't feel strongly about
retaining the static fields which of course predated the generics work.  If you want, JFDI.
   * '''''The Javadoc for Limit states "A predicate that returns true the first n times it
is invoked.", but what happens after? Is it the opposite of Offset?'''''
+    Same Javadoc comment says "and <code>false</code> thereafter."  It is indeed
the opposite of offset.
   * '''''Why aren't Limit and Offset serializable like the other classes in the core package?'''''
+    Because these have state.  There is an open issue for this:
.  Please comment there and/or apply the available patch if you see fit.
   * '''''Limit and Offset could probably use an AtomicInteger instead of a synchronized block'''''
+    I'm not filing an issue for this yet, but feel free to make this change if on further
investigation you still feel it to be proper, or I will do the same.  I haven't made use of
the Atomic- number classes myself so I would have to study them first.  MJB
   * '''''the site has no example easily accessible, the reader is invited to browse the JUnit
tests. That's not really user friendly.'''''
@@ -43, +48 @@

     I agree with this.
   * '''''CollectionTransformer has a todo stating : "TODO revisit this class..."'''''
+    True; the issues noted need to be addressed before a release.
   * '''''There are several untested classes in the composite package'''''

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message