Bill de h�ra wrote:
[[[
1) Implement what the spec says
2) If the spec is ambiguous, talk to the spec lead
3) If you think the spec/lead is is wrong, do what the RI does
4) If the RI has a bug, file the bug, but stay bug compatible
]]]

Trying to stay bug compatible with a reference implementation is a nightmare: it's like trying to write code that conforms to a spec you're not allowed to see that changes from version to version without notification.


I guess the real question that our theoretical friends haven't been addressing is whether the implementation of the equals() method is actually something of any real practical importance. Is there software out there that's likely to run into the situation where the question of whether the equals() method for URLName is transitive in certain cases where different subclasses of URLName are compared becomes an issue? If not, then I'd prefer to see a 'correct' implementation as proposed by Alex. If it *is* an issue, and software is likely to depend on the 'bugged' RI, then Jeremy's version of the code is a lot more appealing - practicality has to override theory at some point. Although some notoriously stupid bugs have been perpetuated by a refusal to fix them and potentially break code that relies on the bug in the first place (Java bug 4030718 springs to mind as an example). And as has already been suggested, ensure the bug in the RI has been reported to Sun.

But what do I know? I'm only a lurker round here. :)

Adrian




Reply via email to