Hi Johann,
In 1d56e6d6, you changed the API for these methods—I assume "use interfaces as params where possible” from the log comment was your rationale here, and that seems pretty reasonable. Here are a couple of caveats for my comments to follow:
* We agreed that Wonder 7 need not maintain backwards compatibility—I was (and continue to be) a big proponent of this. * WOUnit is advertised as being built on Wonder 5, which, again, is perfectly fine.
However, in the course of upgrading our Jenkins build server to Java 8, and bringing in the latest Wonder 7 frameworks from master, I hit two issues:
1. With the new method signature for arrayMinusArray(), WOUnit’s MockEditingContext can’t even find that method:
java.lang.NoSuchMethodError: er.extensions.foundation.ERXArrayUtilities.arrayMinusArray(Lcom/webobjects/foundation/NSArray;Lcom/webobjects/foundation/NSArray;)Lcom/webobjects/foundation/NSArray;
at com.wounit.rules.MockEditingContext.saveChanges(MockEditingContext.java:310)
It’s not immediately clear to me why this would be the case, as obviously NSArray implements Collection, and the new signature is:
public static <T> NSArray<T> arrayMinusArray(Collection<T> array, Collection<?> minus)
2. Of greater concern is that the new arrayMinusObject() method seems to cause ERXEOControlUtilities.validateUniquenessOf() to throw a uniqueness violation exception when it shouldn’t—as far as I can tell, arrayMinusObject() _isn’t removing the object from the array_.
Rolling back the changes to these two methods made in 1d56e6d6 fixes both of these problems. I guess I’m just after your commentary: is it obvious to you why MockEditingContext can’t even find that method, and, even if I have to live with that one, would you agree that the second change seems to have broken ERXEOControlUtilities.validateUniquenessOf()? Let me know what you think.
|