Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4230680

sun.awt.AppContext and javax.swing.AppContext

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P5
    • Resolution: Won't Fix
    • Affects Version/s: 1.2.1
    • Fix Version/s: None
    • Component/s: client-libs
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description



      Name: dbT83986 Date: 04/17/99


      Analyzing our app using the hat tool we noticed that in sun.awt.AppContext.dispose() the member table
      (Hashtable) gets cleared, but the mostRecentKeyValue (MostRecentKeyValue) doesn't get set to null.

      Now we didn't have any problems with this, but I guess it would be more correct to set it to null?

      In javax.swing.AppContext you use a similar strategy:
      There is the Hashtable table and there are two Objects lastKey and lastValue to cache the last retrieved value
      from the Hashtable.

      Now I guess in the remove method you have to set them to null, if lastKey is equal to the key given to the remove
      method. Otherwise it's possible to get a value previously removed.

          public synchronized Object remove(Object key) {
              if (key == lastKey)
                  lastValue = lastKey = null;
              return table.remove(key);
          }

      I didn't test this (we had no problems until now)

      Thank you
          Patrick
      (Review ID: 57064)
      ======================================================================

        Attachments

          Activity

            People

            • Assignee:
              mmartaksunw Michael Martak (Inactive)
              Reporter:
              dblairsunw Dave Blair (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: