On Jul 18, 2007, at 23:31, Jeremias Maerki wrote:

<snip />
All we really need to uniquely identify a NumberProperty is the
number-member, I think...

I dont' think that works, since Number doesn't implement hashCode (), for

Right, but its concrete subclasses in the java.lang package do.
Since the Number class itself is abstract, number will in fact have a runtime type of Integer or Double, so we would rely on the subclass implementation here... Hmm, made me wonder:

  Number oneInt = new Integer(1);
  Number oneDouble = new Double(1.0);
  boolean check = (oneInt.hashCode() != oneDouble.hashCode());

=> (check == true)

Can this be relied upon?

BTW, I don't know if we should do anything about the "specVal" member
variable in Property. I think it's mostly set to null.

Looking a bit closer, I think that member could even be dropped entirely. The only place where this value is accessed by means of getSpecifiedValue() is in LineHeightPropertyMaker. I'd be surprised if that cannot be avoided.



Reply via email to