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

Avoid redundant HashMap.get to obtain old value in Toolkit.setDesktopProperty

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P5 P5
    • None
    • None
    • client-libs

              synchronized (this) {
                  oldValue = desktopProperties.get(name);
                  desktopProperties.put(name, newValue);
              }

      To obtain previous value of HashMap we can use result of desktopProperties.put call. In this case we can avoid redundant HashMap.get call.

            aturbanov Andrey Turbanov
            aturbanov Andrey Turbanov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: