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 2017/08/01 20:09:07 UTC

svn commit: r1803696 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/BaseParser.java

Author: tilman
Date: Tue Aug  1 20:09:07 2017
New Revision: 1803696

URL: http://svn.apache.org/viewvc?rev=1803696&view=rev
Log:
PDFBOX-2852: remove unneeded nullcheck; improve javadoc

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/BaseParser.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/BaseParser.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/BaseParser.java?rev=1803696&r1=1803695&r2=1803696&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/BaseParser.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/BaseParser.java Tue Aug  1 20:09:07 2017
@@ -952,7 +952,7 @@ public abstract class BaseParser
                 //so we are more compatible with POS writers that don't
                 //follow the spec
                 String badString = readString();
-                if( badString == null || badString.length() == 0 )
+                if (badString.isEmpty())
                 {
                     int peek = seqSource.peek();
                     // we can end up in an infinite loop otherwise
@@ -975,7 +975,7 @@ public abstract class BaseParser
     /**
      * This will read the next string from the stream.
      *
-     * @return The string that was read from the stream.
+     * @return The string that was read from the stream, never null.
      *
      * @throws IOException If there is an error reading from the stream.
      */