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

Suspicious getAttMap.containsKey call in sun.print.IPPPrintService#opGetAttributes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • tbd
    • 9
    • client-libs
    • None
    • 2d
    • 9

      Found suspicious code in the method sun.print.IPPPrintService#opGetAttributes which was introduced in JDK-8170578.
      There is getAttMap field in IPPPrintService class.

          private HashMap<String, AttributeClass> getAttMap;

      And it used like this in 'opGetAttributes' method:

         for (Map.Entry<String, AttributeClass> entry : responseMap[i].entrySet()) {
              if (!getAttMap.containsKey(entry.getValue())) {
                  getAttMap.put(entry.getKey(), entry.getValue());
              }
          }

      This call 'getAttMap.containsKey(entry.getValue())' will always result in false.
      It seems it should be 'getAttMap.containsKey(entry.getKey())' instead.

            psadhukhan Prasanta Sadhukhan
            aturbanov Andrey Turbanov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: