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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 5.0M9
    • 5.0M10
    • Classlib
    • None
    • 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

        1. HARMONY-6203.diff
          2 kB
          Kevin Zhou

        Activity

          People

            tellison Tim Ellison
            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