Denis Kishenko 写道:
2006/7/28, Alexey Petrenko <[EMAIL PROTECTED]>:
2006/7/27, Denis Kishenko <[EMAIL PROTECTED]>:
> Unfortunately
> 1. class can has temporary private fields (see BasicStroke.java)
We can mark such fields as transient. As for serialization.

> 2. class can has final fields which take part in hash code calculation
> (see EllipticCurve.java)
It's probably the reason to add final fields to hash code calculation.

Yep, we can do this, but as you remember Alex suggested use Eclipse
tool to make hashCode automatically - it would be easier. But before
run this tool we have to made a lot of routine work =)

Agree. I think using automatic tool is a better way than using hashCode.append() diagram for most of the classes. And if there is specific need, customizing hash code calculation is necessary.

Best regards

Alex's suggestion
"Lastly, an easier approach is to use a tool (such as Eclipse) to
generate the implementation of hashCode() automatically based on the
non-static, non-final variables of a class. This one sounds like (a)
the easiest, and (b) all-round better performant than any of the
above."

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Spark Shen
China Software Development Lab, IBM



---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to