On Aug 15, 2008, at 9:28 PM, Adam Heath wrote:
One more bug I've noticed as I've been converting the code.
I started out adding generics to framework; firstly, base. One
common pattern in base, is several methods take a List of
errorMessages; the idea is that the code can build up the errors
that it detects.
Initially, before I checked anything in, I had that list only
allowing String. However, as I dug in further, I found that some
methods not only added String, but MessageString. Namely, I first
hit upon this when updating the service component(ServiceUtil.java,
line 219).
As I have continued to change code, I have come across instances
that do *not* handle this correctly. They try to cast the error
message to a String. It's only random luck that it hasn't had any
problems.
Ideally the MessageString class would extend String, but if I remember
right that wasn't allowed (don't know if it is now or not in Java 5).
-David