Since 1.6 of MMBase we find the function 'isInstanceOfBuilder()' in
MMObjectBuilder. It was originally created private by Rob, but I made
it public because I needed it somewhere else and also because this
information seemed naturally 'public'.
Only now I'm getting aware that the function is working the wrong way
around (yes, yes, I'm slow..).
The javadoc sais:
/**
* checks if the attribute buildername is an instance of this builder.
* @param buildername a builder name
* @return <true> if the buildername is an instance of this builder, <false>
otherwise.
*
* @since MMBase-1.6
*/
public boolean isInstanceOfBuilder(String builderName) {
So, I'd say this is completely counterintuitive. I think every
programmer would expect posrel.isInstanceOfBuilder(insrel) to be true
and not insrel.isInstanceOfBuilder(posrel).
I suppose I back then supposed I could live with this, but now I'm
coming to the insight that I can't.
I suggest to deprecate this function immediately (also in 1.6) and
make a new one isInstanceOf(String builder) (or even
isInstanceOf(MMObjectBuilder builder?), or both) with the inverse
behavior.
Your opinions please.
Michiel
--
mihxil' Michiel Meeuwissen
Mediapark C101 Hilversum
+31 (0)35 6772979
[]()