John, I just implemented the equals() method and committed it in
revision 371519 [1].

For commons-dev (not sure how many hang out there, so x-posting to
[EMAIL PROTECTED]) ... there is a potential problem with all subclasses of
XmlSchemaObject (there are lots) - none of them implement equals() so
any code calling equals on one of these subclasses will mean the
XmlSchemaObject.equals() method is called. Prior to rev 371519 this
just returned true. From rev 371519 the fields in XmlSchemaObject are
checked for equality.

Jeremy

[1] 
http://svn.apache.org/viewcvs.cgi/webservices/commons/trunk/XmlSchema/src/org/apache/ws/commons/schema/XmlSchemaObject.java?rev=371519&view=diff&r1=371519&r2=371518&p1=webservices/commons/trunk/XmlSchema/src/org/apache/ws/commons/schema/XmlSchemaObject.java&p2=/webservices/commons/trunk/XmlSchema/src/org/apache/ws/commons/schema/XmlSchemaObject.java

On 1/22/06, John Kaputin <[EMAIL PROTECTED]> wrote:
> I have fixed the XmlSchemaObject.equals method but I get a client
> authorization failure when I try to committ it to SVN. I am using the same
> id/pw that I use for Woden SVN. I will check with Lawrence Mandel to see
> how he resolved a similar problem with write access to ws-commons a few
> weeks back.
>
> Meantime, can someone with write access to XmlSchema apply this fix for me.
> It's a 1 line change. The comment and patch are below:
>
>
> Corrected the XmlSchemaObject.equals method so that it
> returns the result of an object reference comparison
> (i.e. return this = what;). Previously it was implemented
> as 'return true;', so it would always return true, even
> if the two objects were different. In its current form
> using the object ref comparison, the equals method does
> not really need to be implemented in XmlSchemaObject, but the
> existing TODO comment in the method indicates some future
> intention (probably equivalence checking), so the method
> has been left in place with its implementation changed
> as described above.
>
>
> Index:
> C:/workspace/wsdl20/XmlSchema/src/org/apache/ws/commons/schema/XmlSchemaObject.java
> ===================================================================
> ---
> C:/workspace/wsdl20/XmlSchema/src/org/apache/ws/commons/schema/XmlSchemaObject.java
>       (revision 349817)
> +++
> C:/workspace/wsdl20/XmlSchema/src/org/apache/ws/commons/schema/XmlSchemaObject.java
>       (working copy)
> @@ -59,7 +59,7 @@
>
>      public boolean equals(Object what) {
>          // toDO : implement this once everything completed
> -        return true;
> +        return this == what;
>      }
>
>
> thanks,
> John Kaputin
>
>
>
>
>              Sanjiva
>              Weerawarana
>              <[EMAIL PROTECTED]                                          To
>              ce.lk>                    [EMAIL PROTECTED]
>                                                                         cc
>              21/01/2006 23:10          [email protected],
>                                        [email protected]
>                                                                    Subject
>              Please respond to         Re: Fw: Bug in
>                   general              XmlSchemaObject.equals method
>
>
>
>
>
>
>
>
>
>
> +1 .. the current impl is busted so better fix it so the next person
> doesn't trip up too.
>
> Thanks,
>
> Sanjiva.
>
> On Sat, 2006-01-21 at 11:03 -0500, Davanum Srinivas wrote:
> > +1, please go ahead and fix XmlSchemaObject....please feel free to
> > make any changes u need. we are following a Commit-Then-Review policy
> > for all ws projects.
> >
> > thanks,
> > dims
> >
> > On 1/21/06, John Kaputin <[EMAIL PROTECTED]> wrote:
> > > I have implemented a work around in Woden, iterating through the List
> and
> > > using '==' rather than .equals(). So I am not held up by
> > > XmlSchemaObject.equals, but I'm still willing to make the suggested
> change
> > > in XmlSchema if it's agreed.
> > >
> > > John Kaputin
> > >
> > > ----- Forwarded by John Kaputin/UK/IBM on 21/01/2006 13:02 -----
> > >
> > >              John
> > >              Kaputin/UK/IBM
> > >
> To
> > >              21/01/2006 12:28          [email protected]
> > >
> cc
> > >                                        [email protected]
> > >
> Subject
> > >                                        Bug in XmlSchemaObject.equals
> > >                                        method
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > The XmlSchemaObject.equals method is:
> > >
> > >     public boolean equals(Object what) {
> > >         // toDO : implement this once everything completed
> > >         return true;
> > >     }
> > >
> > > This is causing a problem in Woden. I have a java.util.List of
> XmlSchema. I
> > > use the List.contains(object) method and the java.util.Vector
> > > implementation calls the equals method on the XmlSchema instance, which
> > > inherits XmlSchemaObject.equals. True is always returned, even if the
> > > XmlSchema objects are different.
> > >
> > > There may be some longer term plan to override the equals method in the
> > > subclasses of XmlSchemaObject to perform equivalence checking rather
> than
> > > an object reference comparison, but I can't see the purpose of the
> current
> > > XmlSchemaObject.equals implementation - even as a short term measure.
> I
> > > propose either changing XmlSchemaObject.equals to perform an object
> > > reference comparison (or just removing the method altogether), or
> otherwise
> > > overriding it in XmlSchema to perform an object reference comparison.
> > > This would allow me to move forward in Woden in the short term, even if
> > > there is a longer term plan for equivalence checking in XmlSchema.
> > >
> > > I am happy to make this change. Any agreement or objections?
> > >
> > > regards,
> > > John Kaputin
> > >
> > >
> >
> >
> > --
> > Davanum Srinivas : http://wso2.com/blogs/
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to