Return-Path: Delivered-To: apmail-incubator-jackrabbit-commits-archive@www.apache.org Received: (qmail 10781 invoked from network); 19 Apr 2005 16:12:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 19 Apr 2005 16:12:33 -0000 Received: (qmail 40180 invoked by uid 500); 19 Apr 2005 16:12:33 -0000 Mailing-List: contact jackrabbit-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jackrabbit-dev@incubator.apache.org Delivered-To: mailing list jackrabbit-commits@incubator.apache.org Received: (qmail 40166 invoked by uid 500); 19 Apr 2005 16:12:32 -0000 Delivered-To: apmail-incubator-jackrabbit-cvs@incubator.apache.org Received: (qmail 40162 invoked by uid 99); 19 Apr 2005 16:12:32 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Tue, 19 Apr 2005 09:12:31 -0700 Received: (qmail 10776 invoked by uid 65534); 19 Apr 2005 16:12:30 -0000 Message-ID: <20050419161230.10775.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Mailer: svnmailer-1.0.0-dev Date: Tue, 19 Apr 2005 16:12:30 -0000 Subject: svn commit: r161912 - in incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core: NodeId.java PropertyId.java state/NodeReferencesId.java To: jackrabbit-cvs@incubator.apache.org From: stefan@apache.org X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: stefan Date: Tue Apr 19 09:12:29 2005 New Revision: 161912 URL: http://svn.apache.org/viewcvs?view=3Drev&rev=3D161912 Log: reverting change introduced in r161308: do not internalize uuid field of No= deId and PropertyId as uuid's are inherently random and the performance gai= n is questionable once the overhead of String.intern() is taken into accoun= t also.=20 Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeId.j= ava incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/Property= Id.java incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/No= deReferencesId.java Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/No= deId.java URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/= apache/jackrabbit/core/NodeId.java?view=3Ddiff&r1=3D161911&r2=3D161912 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeId.j= ava (original) +++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeId.j= ava Tue Apr 19 09:12:29 2005 @@ -29,11 +29,13 @@ if (uuid =3D=3D null) { throw new IllegalArgumentException("uuid can not be null"); } - this.uuid =3D uuid.intern(); + this.uuid =3D uuid; } =20 /** - * @see ItemId#denotesNode + * {@inheritDoc} + * + * @return always true */ public boolean denotesNode() { return true; @@ -43,17 +45,6 @@ return uuid; } =20 - public boolean equals(Object obj) { - if (this =3D=3D obj) { - return true; - } - if (obj instanceof NodeId) { - NodeId other =3D (NodeId) obj; - return uuid =3D=3D other.uuid; - } - return false; - } - /** * Returns a NodeId holding the value of the specified * string. The string must be in the format returned by the @@ -71,6 +62,19 @@ throw new IllegalArgumentException("invalid NodeId literal"); } return new NodeId(s); + } + + //-------------------------------------------< java.lang.Object overri= des > + + public boolean equals(Object obj) { + if (this =3D=3D obj) { + return true; + } + if (obj instanceof NodeId) { + NodeId other =3D (NodeId) obj; + return uuid.equals(other.uuid); + } + return false; } =20 public String toString() { Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/Pr= opertyId.java URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/= apache/jackrabbit/core/PropertyId.java?view=3Ddiff&r1=3D161911&r2=3D161912 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/Property= Id.java (original) +++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/Property= Id.java Tue Apr 19 09:12:29 2005 @@ -33,12 +33,14 @@ if (propName =3D=3D null) { throw new IllegalArgumentException("propName can not be null"); } - this.parentUUID =3D parentUUID.intern(); + this.parentUUID =3D parentUUID; this.propName =3D propName; } =20 /** * {@inheritDoc} + * + * @return always false */ public boolean denotesNode() { return false; @@ -52,18 +54,6 @@ return propName; } =20 - public boolean equals(Object obj) { - if (this =3D=3D obj) { - return true; - } - if (obj instanceof PropertyId) { - PropertyId other =3D (PropertyId) obj; - return parentUUID =3D=3D other.parentUUID - && propName.equals(other.propName); - } - return false; - } - /** * Returns a PropertyId holding the value of the specified * string. The string must be in the format returned by the @@ -88,6 +78,20 @@ QName name =3D QName.valueOf(s.substring(i + 1)); =20 return new PropertyId(uuid, name); + } + + //-------------------------------------------< java.lang.Object overri= des > + + public boolean equals(Object obj) { + if (this =3D=3D obj) { + return true; + } + if (obj instanceof PropertyId) { + PropertyId other =3D (PropertyId) obj; + return parentUUID.equals(other.parentUUID) + && propName.equals(other.propName); + } + return false; } =20 public String toString() { Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/st= ate/NodeReferencesId.java URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/= apache/jackrabbit/core/state/NodeReferencesId.java?view=3Ddiff&r1=3D161911&= r2=3D161912 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/No= deReferencesId.java (original) +++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/No= deReferencesId.java Tue Apr 19 09:12:29 2005 @@ -26,27 +26,12 @@ /** * Create a new instance of this class. Takes a UUID as parameter. * - * @param uuid uuid of node + * @param uuid uuid of target node */ public NodeReferencesId(String uuid) { super(uuid); } =20 - - /** - * {@inheritDoc} - */ - public boolean equals(Object obj) { - if (this =3D=3D obj) { - return true; - } - if (obj instanceof NodeReferencesId) { - NodeReferencesId other =3D (NodeReferencesId) obj; - return uuid =3D=3D other.uuid; - } - return false; - } - /** * Returns a NodeReferencesId holding the value of the sp= ecified * string. The string must be in the format returned by the @@ -54,9 +39,9 @@ * * @param s a String containing the NodeReferencesI= d * representation to be parsed. - * @return the NodeId represented by the argument + * @return the NodeReferencesId represented by the argume= nt * @throws IllegalArgumentException if the specified string can not be= parsed - * as a NodeId. + * as a NodeReferencesId. * @see #toString() */ public static NodeId valueOf(String s) { @@ -64,5 +49,24 @@ throw new IllegalArgumentException("invalid NodeReferencesId l= iteral"); } return new NodeReferencesId(s); + } + + //-------------------------------------------< java.lang.Object overri= des > + + /** + * {@inheritDoc} + */ + public boolean equals(Object obj) { + if (this =3D=3D obj) { + return true; + } + if (obj instanceof NodeReferencesId) { + return super.equals(obj); + } + return false; + } + + public String toString() { + return uuid; } }