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

Use Hashtable.putIfAbsent in CSS constructor

XMLWordPrintable

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

      We can use Hashtable.putIfAbsent instead of pair get/put methods.
      It's faster and cleaner.

              int n = CSS.Attribute.allAttributes.length;
              for (int i = 0; i < n; i++) {
                  CSS.Attribute key = CSS.Attribute.allAttributes[i];
                  if (valueConvertor.get(key) == null) {
                      valueConvertor.put(key, generic);
                  }
              }

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

              Created:
              Updated: