xzel23 commented on code in PR #186: URL: https://github.com/apache/pdfbox/pull/186#discussion_r1498274646
########## pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/encoding/MacExpertEncoding.java: ########## @@ -27,6 +27,7 @@ public class MacExpertEncoding extends Encoding /** * Table of octal character codes and their corresponding names. */ + @SuppressWarnings("OctalInteger") Review Comment: I think that's IntelliJ specific and might in turn produce a warning in other IDEs. ########## pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/encoding/MacOSRomanEncoding.java: ########## @@ -27,7 +27,9 @@ public class MacOSRomanEncoding extends MacRomanEncoding /** * Table of octal character codes and their corresponding names * on top of {@link MacRomanEncoding}. + * ToDo are these really octals?? leading 0 seems to be missing Review Comment: Good catch! ########## 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 available from Java 8 on, ok for PDFBox 3+. ########## pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/encoding/MacRomanEncoding.java: ########## @@ -29,6 +29,7 @@ public class MacRomanEncoding extends Encoding /** * Table of octal character codes and their corresponding names. */ + @SuppressWarnings("OctalInteger") Review Comment: same as above -- 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