Return-Path: Delivered-To: apmail-jakarta-ecs-dev-archive@www.apache.org Received: (qmail 10753 invoked from network); 25 Jun 2008 19:06:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Jun 2008 19:06:48 -0000 Received: (qmail 41487 invoked by uid 500); 25 Jun 2008 19:06:49 -0000 Delivered-To: apmail-jakarta-ecs-dev-archive@jakarta.apache.org Received: (qmail 41480 invoked by uid 500); 25 Jun 2008 19:06:49 -0000 Mailing-List: contact ecs-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "ECS Developers List" Reply-To: "ECS Developers List" Delivered-To: mailing list ecs-dev@jakarta.apache.org Received: (qmail 44112 invoked by uid 99); 25 Jun 2008 16:25:37 -0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Message-ID: <764002602.1214411084922.JavaMail.jira@brutus> Date: Wed, 25 Jun 2008 09:24:44 -0700 (PDT) From: "Mauro Manfrin (JIRA)" To: ecs-dev@jakarta.apache.org Subject: [jira] Updated: (ECS-1) addElement(Element element) methods can fail In-Reply-To: <1681223829.1214410845128.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/ECS-1?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mauro Manfrin updated ECS-1: ---------------------------- Attachment: ecs-maintrunk-patches.zip This is a version of ConcreteElement that sotores object in the Map only if you give explicitly a key-name, otherwise it stores only in the Vector. That seems to work good, with a good retro-compatibility. I modified classes since the jakarta ECS SVN repository. You will find the ConcreteElement class, and subsequent 5 classes adaptions. Pay attention, these patches are based on the trunk, not the 1.4.2 version. > 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 > 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