Hi Andreas,

Sorry for a late comment on this.

> Author: adelmelle
> Date: Fri Jul 20 09:48:55 2007
> New Revision: 558045
> URL: http://svn.apache.org/viewvc?view=rev&rev=558045
> Log:
> Slight correction: 
> - make NumberProperty, EnumProperty, EnumNumber and StringProperty final, so 
> instanceof suffices in the check for equality
> - instead of subclassing NumberProperty, make EnumNumber implement the 
> Numeric interface

> -    public int getValue() {
> -        log.error("getValue() called on " + enumProperty + " number");
> -        return 0;

That may be discussed, but I have strong feelings against that. If the 
method shouldn’t be called, why not throw an IllegalStateException or 
so? If it is called that means there’s a bug somewhere. Perhaps the code 
won’t crash, perhaps nothing will even be noticeable on the output, but 
I doubt it as there can only be a serious problem, that should be 
corrected sooner rather than later.

All that said... if most methods of the Numeric interface aren’t 
applicable to EnumNumber, should that class still be considered as 
a Numeric object? Does that make sense to cast an EnumNumber into 
a Numeric?


Reply via email to