axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glen Daniels <gdani...@macromedia.com>
Subject RE: Q. about equals() in WSDL generated datatypes
Date Thu, 19 Dec 2002 13:59:08 GMT

Hi Rich!

Hm - I'm trying to imagine an example for when this would actually get used, and having trouble
coming up with one.  Could you elucidate?  I guess what I'm really asking is why doesn't "if
(this == obj) return true" catch this?

--G

P.S.  Nice to see you back!

> -----Original Message-----
> From: R J Scheuerle Jr [mailto:scheu@us.ibm.com]
> Sent: Wednesday, December 18, 2002 8:27 PM
> To: axis-dev@xml.apache.org
> Subject: Re: Q. about equals() in WSDL generated datatypes
> 
> 
> 
> Yes __equalsCal was meant to support equals for objects that 
> had direct or
> indirectly references back to the object.
> 
> Rich Scheuerle
> IBM WebSphere & Axis Web Services Development
> 512-838-5115  (IBM TL 678-5115)
> 
> 
>                                                               
>                                                            
>                       "Steve Loughran"                        
>                                                            
>                       <steve_l@iseran.c        To:       
> "axis-dev" <axis-dev@xml.apache.org>                            
>                       om>                      cc:            
>                                                            
>                                                Subject:  Q. 
> about equals() in WSDL generated datatypes                   
>                       12/18/2002 02:38                        
>                                                            
>                       PM                                      
>                                                            
>                       Please respond to                       
>                                                            
>                       axis-dev                                
>                                                            
>                                                               
>                                                            
>                                                               
>                                                            
> 
> 
> 
> 
> So I'm staring at the equals() method that's been generated 
> for me from a
> datatype
> 
>     private java.lang.Object __equalsCalc = null;
> 
>     public synchronized boolean equals(java.lang.Object obj) {
>         if (!(obj instanceof JobInfo)) return false;
>         JobInfo other = (JobInfo) obj;
>         if (obj == null) return false;
>         if (this == obj) return true;
>         if (__equalsCalc != null) {
>             return (__equalsCalc == obj);
>         }
>         __equalsCalc = obj;
>         ...tests
>         __equalsCalc = null;
>         return _equals;
> 
> 
> My q. is: what is all this __equalsCalc stuff? It implies 
> that if there is
> a
> reentrant equality test then the test would return true while 
> the test is
> ongoing, but since the method is synchronized, you'd be hard 
> pressed to
> call
> equals() twice.
> 
> Is that what the __equalsCalc is there for? To catch recursion?
> 
> -steve
> 
> 
> 
> 
> 

Mime
View raw message