[cal10n-dev] Congratulations on a useful project; here's my suggestion

Rick Beton rick.beton at gmail.com
Tue Sep 1 15:11:36 CEST 2009


2009/8/31 Ceki Gulcu <ceki at qos.ch>

> Thank you Rick. FYI, you could replace the comparison of this.args and
> other.args (about 10 lines) with just Arrays.equals(this.args, other.args).
>

Indeed - much simpler.



> Moreover, you could implement hashCode as follows, which correct and
> efficient at the same time. Having args contribute to the hashCode is a
> waste of time.
>
>  @Override
>  public int hashCode() {
>    return e.hashCode();
>  }
>

That's probably better (simpler often means better), but now hashCode() and
equals() have different behaviour so there ought to be a remark in the
JavaDoc to say so.  It could, for example, mean that a hashtable of
instances may be less efficient because more linear searching might happen.



>  How about renaming ResourceMessage as MessageParameterObj. See also
>
>  http://www.refactoring.com/catalog/introduceParameterObject.html
>

I see from the Git patch email you've already done this.  :-D

-- 
Big Bee Consultants Limited : Registered in England & Wales No. 6397941
Registered Office: 71 The Hundred, Romsey, Hampshire, SO51 8BZ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://qos.ch/pipermail/cal10n-dev/attachments/20090901/ccf82bfa/attachment.htm>


More information about the cal10n-dev mailing list