You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2021/12/27 09:17:03 UTC

svn commit: r1896443 - /pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/type1/Type1Parser.java

Author: tilman
Date: Mon Dec 27 09:17:02 2021
New Revision: 1896443

URL: http://svn.apache.org/viewvc?rev=1896443&view=rev
Log:
PDFBOX-4892: improve javadoc, remove unneeded code

Modified:
    pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/type1/Type1Parser.java

Modified: pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/type1/Type1Parser.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/type1/Type1Parser.java?rev=1896443&r1=1896442&r2=1896443&view=diff
==============================================================================
--- pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/type1/Type1Parser.java (original)
+++ pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/type1/Type1Parser.java Mon Dec 27 09:17:02 2021
@@ -863,7 +863,9 @@ final class Type1Parser
     }
 
     /**
-     * Reads the next token and throws an error if it is not of the given kind.
+     * Reads the next token and throws an exception if it is not of the given kind.
+     * 
+     * @return token, never null
      */
     private Token read(Token.Kind kind) throws IOException
     {
@@ -876,13 +878,15 @@ final class Type1Parser
     }
 
     /**
-     * Reads the next token and throws an error if it is not of the given kind
+     * Reads the next token and throws an exception if it is not of the given kind
      * and does not have the given value.
+     * 
+     * @return token, never null
      */
     private void read(Token.Kind kind, String name) throws IOException
     {
         Token token = read(kind);
-        if (token == null || token.getText() == null || !token.getText().equals(name))
+        if (token.getText() == null || !token.getText().equals(name))
         {
             throw new IOException("Found " + token + " but expected " + name);
         }
@@ -891,6 +895,8 @@ final class Type1Parser
     /**
      * Reads the next token if and only if it is of the given kind and
      * has the given value.
+     * 
+     * @return token or null if not the expected one
      */
     private Token readMaybe(Token.Kind kind, String name) throws IOException
     {