You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Igor Vaynberg (JIRA)" <ji...@apache.org> on 2008/02/09 21:33:07 UTC

[jira] Resolved: (WICKET-1294) PrependingStringBuffer.hashCode() doesn't meet its contract

     [ https://issues.apache.org/jira/browse/WICKET-1294?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg resolved WICKET-1294.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 1.3.2
         Assignee: Igor Vaynberg

> PrependingStringBuffer.hashCode() doesn't meet its contract
> -----------------------------------------------------------
>
>                 Key: WICKET-1294
>                 URL: https://issues.apache.org/jira/browse/WICKET-1294
>             Project: Wicket
>          Issue Type: Bug
>         Environment:  svn info
> Pfad: .
> URL: https://svn.apache.org/repos/asf/wicket/trunk
> Basis des Projektarchivs: https://svn.apache.org/repos/asf
> UUID des Projektarchivs: 13f79535-47bb-0310-9956-ffa450edef68
> Revision: 613174
> Knotentyp: Verzeichnis
> Plan: normal
> Letzter Autor: ivaynberg
> Letzte geänderte Rev: 612893
> Letztes Änderungsdatum: 2008-01-17 18:57:14 +0100 (Do, 17 Jan 2008)
>            Reporter: Martin Funk
>            Assignee: Igor Vaynberg
>             Fix For: 1.3.2
>
>
> PrependingStringBuffer.hashCode() doesn't meet its contract
> Test code showing this:
> svn diff
> Index: jdk-1.4/wicket/src/test/java/org/apache/wicket/util/string/PrependingStringBufferTest.java
> ===================================================================
> --- jdk-1.4/wicket/src/test/java/org/apache/wicket/util/string/PrependingStringBufferTest.java  (Revision 613174)
> +++ jdk-1.4/wicket/src/test/java/org/apache/wicket/util/string/PrependingStringBufferTest.java  (Arbeitskopie)
> @@ -70,5 +70,18 @@
>                 assertTrue(psb.equals(psb));
>         }
>  
> +       /**
> +        * Test if implementation of hashCode() meets its <a
> +        * href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#hashCode()">contract<a>.
> +        * 
> +        * @throws Exception
> +        */
> +       public void testHash() throws Exception
> +       {
> +               PrependingStringBuffer foo = new PrependingStringBuffer("foo");
> +               PrependingStringBuffer bar = new PrependingStringBuffer("foo");
> +               assertTrue(foo.equals(bar));
> +               assertEquals(foo.hashCode(), bar.hashCode());
> +       }
>  
>  }

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