Wicket
  1. Wicket
  2. WICKET-1294

PrependingStringBuffer.hashCode() doesn't meet its contract

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3.2
    • Component/s: None
    • Labels:
      None
    • Environment:

      Description

      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()); + }

      }

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Igor Vaynberg
            Reporter:
            Martin Funk
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development