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


##########
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:
   > getOrDefault() is used in 2 other locations as well
   
   Yes, I just made that comment to remind whoever integrates this change 
doesn't pull it into PDFBox 2. Many fixes and improvements are backported to 
the old release that still supports Java 6.



-- 
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: dev-unsubscr...@pdfbox.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org

Reply via email to