Incorrect use of ConcurrentHashMap.contains in SunFontManager.java

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P2
    • 9
    • Affects Version/s: None
    • Component/s: client-libs
    • 2d
    • b117
    • generic
    • linux

      SunFontManager.java invokes ConcurrentHashMap.contains(Object), which is denigrated.
      If you change that method to be @Deprecated, the build fails with

      jdk/src/java.desktop/share/classes/sun/font/SunFontManager.java:1847: warning: [deprecation] contains(Object) in ConcurrentHashMap has been deprecated
                  !registeredFonts.contains(file)) {

      contains is equivalent to containsValue and that would be a good change to make, except that it looks like the intent was to check for a key, i.e. the author intended a call to containsKey(Object) and fell into the contains trap.

            Assignee:
            Philip Race
            Reporter:
            Martin Buchholz
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: