Uploaded image for project: 'Harmony'
  1. Harmony
  2. HARMONY-6203

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: 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)

        Attachments

          Activity

            People

            • Assignee:
              tellison Tim Ellison
              Reporter:
              zhoukevin 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