You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ecs-dev@jakarta.apache.org by "Robert Burrell Donkin (JIRA)" <ji...@apache.org> on 2008/07/01 22:40:44 UTC

[jira] Commented: (ECS-1) addElement(Element element) methods can fail

    [ https://issues.apache.org/jira/browse/ECS-1?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12609702#action_12609702 ] 

Robert Burrell Donkin commented on ECS-1:
-----------------------------------------

Hi Mauro

I'm going to take a look at these now. 

Please bear in mind that patches containing just the differences are preferred. To create a suitable patch, use svn diff against a checkout.

Robert

> addElement(Element element) methods can fail
> --------------------------------------------
>
>                 Key: ECS-1
>                 URL: https://issues.apache.org/jira/browse/ECS-1
>             Project: ECS
>          Issue Type: Bug
>         Environment: in Ibm Virtual Machines, but probabily also in Sun Virtual Machines
>            Reporter: Mauro Manfrin
>            Assignee: Robert Burrell Donkin
>            Priority: Critical
>         Attachments: ecs-maintrunk-patches.zip
>
>
> The class ConcreteElement exposes a method
> addElement(Element element)
> that calls
> addElementToRegistry(Integer.toString(element.hashCode()),element);
> so it gives a key valued element.hashCode() to that element.
> That's the point: element.hashCode() can't be a unique key because sometimes we can have two elements with the same hasocode.
> javadoc states:
> "It is not required that if two objects are unequal according to the 
> equals(java.lang.Object) method, then calling the hashCode method on each of 
> the two objects must produce distinct integer results. However, the 
> programmer should be aware that producing distinct integer results for 
> unequal objects may improve the performance of hashtables."
> So sometimes, two different objects can have the same hashCode!
> So, sometimes two calls to addElement(element) can result in only the second 
> object stored in the ConcreteElement.
> So sometimes, on out instalaltion some table rows misses, or some row cells 
> misses or...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: ecs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: ecs-dev-help@jakarta.apache.org