users@jaxb-verification.java.net

Re: Comparing two jaxb-generated objects by value

From: Jean-Marie Condom <jmc_at_meteorage.com>
Date: Mon, 24 Jan 2005 17:25:27 +0100

Hello

yes it works now ;
thanks for your work !
this is a very useful method

bye

Jean-Marie

Aleksei Valikov wrote:

> Hi.
>
> public boolean equals(java.lang.Object obj) {
> System.out.println("geoColorTabImpl -equals");
> if (this == obj) {
> return true;
> }
> if ((null == obj)||(obj.getClass()!= this.getClass())) {
> return false;
> }
> meteorage.jobs.params.configuration.impl.GeoColorTabImpl target
> = ((meteorage.jobs.params.configuration.impl.GeoColorTabImpl) obj);
> {
> java.util.List value = this.getGeoColor();
> java.util.List targetValue = target.getGeoColor();
> if (!((value == targetValue)||((value!=
> null)&&value.equals(targetValue)))) {
> return false;
> }
> }
> return true;
> }
>
> > the condition " value.equals(targetValue)" in fact calls method
> > "boolean equals(Object o);"
> > in interface List and not method
> > "public boolean equals(java.lang.Object obj)" in
> > file GeoColorImpl.java
>
> Actually, value.equals(targetValue) should compare two lists here, not
> GeoColorImpls. The problem was that JAXB list implementation broke
> List contract by not implementing the equals method correctly.
> I have corrected this by hard-coding list comparision instead of
> list.equals(anotherList) (which is, actually, also supposed to work).
>
> Please check out a newer distribution.
>
> Bye.
> /lexi
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb-verification.dev.java.net
> For additional commands, e-mail:
> users-help_at_jaxb-verification.dev.java.net
>
>


-- 
Jean-Marie Condom
Software development team
Sté Météorage
2 av Angot
64053 PAU
France 
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb-verification.dev.java.net
For additional commands, e-mail: users-help_at_jaxb-verification.dev.java.net