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/01/16 06:27:53 UTC

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

Author: tilman
Date: Sat Jan 16 06:27:53 2021
New Revision: 1885546

URL: http://svn.apache.org/viewvc?rev=1885546&view=rev
Log:
PDFBOX-5080: throw IOException only, as suggested by Hao Zhong 

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=1885546&r1=1885545&r2=1885546&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 Sat Jan 16 06:27:53 2021
@@ -73,14 +73,14 @@ final class Type1Parser
     {
         if (bytes.length == 0)
         {
-            throw new IllegalArgumentException("byte[] is empty");
+            throw new IOException("ASCII segment of type 1 font is empty");
         }
 
         // %!FontType1-1.0
         // %!PS-AdobeFont-1.0
         if (bytes.length < 2 || (bytes[0] != '%' && bytes[1] != '!'))
         {
-            throw new IOException("Invalid start of ASCII segment");
+            throw new IOException("Invalid start of ASCII segment of type 1 font");
         }
 
         lexer = new Type1Lexer(bytes);