lehmi commented on code in PR #186:
URL: https://github.com/apache/pdfbox/pull/186#discussion_r1498750997


##########
pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/encoding/Encoding.java:
##########
@@ -159,23 +159,18 @@ public boolean contains(int code)
 
     /**
      * This will take a character code and get the name from the code.
-     * 
+     *
      * @param code character code
-     * @return PostScript glyph name
+     * @return PostScript glyph name, or ".notdef" when not found.
      */
     public String getName(int code)
     {
-       String name = codeToName.get(code);
-       if (name != null)
-       {
-          return name;
-       }
-       return ".notdef";
+       return codeToName.getOrDefault(code, ".notdef");

Review Comment:
   I've added the proposed change as well, see PDFBOX-5660



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to