One thing under the "Seeking Opinions" section of the Wiki...
# [WWW]26056 [lang] Add methods to ArrayUtils: add at end and insert-like ops - DONE - add(Object[], Object) is overloaded for all the primitives, but add(Object[], int, Object) and addAll(Object[], Object[]) are not overloaded for primitives. Should they be?
There are two alternatives:
1) Overload for each primitive. This approach enforces type safety at compile time for users of [lang] but means duplicate code in [lang] itself. This is the approach currently taken by EqualsBuilder in EqualsBuilder's append methods.
2) Use Object in the signature instead of Object[], int[], long[], etc. This approach does not enforce type satefy for users of [lang] at compile time, but can enforce type safety at runtime by including code like this at the beginning of the method
If !(objectToAdd.getClass().isArray()) then throw IllegalArgumentException
This approach makes use of the Array class (http://java.sun.com/j2se/1.4.2/docs/api/java/lang/reflect/Array.html)
for the implementation.
I personally opt for approach #2 in my work, but you could certainly make a valid argument that #1 is better for a library like [lang].
Henri Yandell wrote:
Sorry for the silence from me. As I've probably said a million times, baby happened.
I hadn't heard... congrats!
I'm full of coding energy, or perhaps the need to 'have coded' that leads to coding happening and looking to direct some of it to Lang 2.1.
Looking at the wiki and bugzilla, we were nearly there as far as I recall. Not a lot has cropped up in the 2 months or so that have passed, couple of bugs I've easily closed out and a couple of trickier ones.
Gary seems to have taken care of http://issues.apache.org/bugzilla/show_bug.cgi?id=32625. Is it ready for closure Gary? Despite Matt Blum's comment on a work-around, it still sounds like a fine change to the library.
Thanks for including this for me :)
As per my comments above, are we sure we want all the duplicate append() methods in EqualsBuilder?
Also, what would you guys think of including deep comparisons of Maps and Collections to the EqualsBuilder? I wrote similar code in Morph's TestUtils.equals class which could probably be ported to EqualsBuilder for lang 2.2. Should I open an enhancement ticket? The Morph code is avail under the Apache license so feel free to steal it.
Matt
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
