Harmony
  1. Harmony
  2. HARMONY-6203

[classlib][luni] java.util.Hashtable.remove(.) throws StackOverflowError while RI doesn't

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0M9
    • Fix Version/s: 5.0M10
    • Component/s: Classlib
    • Labels:
      None
    • Estimated Complexity:
      Moderate

      Description

      Given a test case below [1], RI passes it while HARMONY throws a java.lang.StackOverflowError error. The stack trace is given as [2], this error is thrown due to its hashCode method.

      [1] Test Case:
      public void test_HashTable_remove()

      { Hashtable hashTable = new Hashtable(); Set keySet = hashTable.keySet(); hashTable.put(hashTable, keySet); hashTable.remove(hashTable); }

      [2] Stack Trace:
      java.lang.StackOverflowError
      at java.util.Collections$SynchronizedCollection.iterator(Collections.java:449)
      at java.util.Hashtable.hashCode(Hashtable.java:541)
      at java.util.AbstractSet.hashCode(AbstractSet.java:79)
      at java.util.Collections$SynchronizedSet.hashCode(Collections.java:832)
      at java.util.Hashtable.hashCode(Hashtable.java:547)
      at java.util.AbstractSet.hashCode(AbstractSet.java:79)
      at java.util.Collections$SynchronizedSet.hashCode(Collections.java:832)

        Activity

        Hide
        Kevin Zhou added a comment -

        Thanks, Tim.

        Show
        Kevin Zhou added a comment - Thanks, Tim.
        Hide
        Tim Ellison added a comment -

        Thanks Kevin.

        Patch applied to LUNI module at repo revision r773884.

        Please verify it was applied as you expected.

        Show
        Tim Ellison added a comment - Thanks Kevin. Patch applied to LUNI module at repo revision r773884. Please verify it was applied as you expected.
        Hide
        Kevin Zhou added a comment -

        Would you please help to try it?

        Show
        Kevin Zhou added a comment - Would you please help to try it?
        Hide
        Kevin Zhou added a comment -

        The below test case [1] shows that this also happens to the constructor of Hashtable.

        [1] Test Case:
        public void test_HashTable_Constructor()

        { Hashtable hashTable = new Hashtable(); hashTable.put(hashTable, hashTable.keySet()); new Hashtable(hashTable); }
        Show
        Kevin Zhou added a comment - The below test case [1] shows that this also happens to the constructor of Hashtable. [1] Test Case: public void test_HashTable_Constructor() { Hashtable hashTable = new Hashtable(); hashTable.put(hashTable, hashTable.keySet()); new Hashtable(hashTable); }

          People

          • Assignee:
            Tim Ellison
            Reporter:
            Kevin Zhou
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 48h
              48h
              Remaining:
              Remaining Estimate - 48h
              48h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development