Author: tilman Date: Thu Nov 23 04:42:10 2023 New Revision: 1914062 URL: http://svn.apache.org/viewvc?rev=1914062&view=rev Log: PDFBOX-5713: Sonar fix
Modified: pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/pfb/PfbParser.java Modified: pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/pfb/PfbParser.java URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/pfb/PfbParser.java?rev=1914062&r1=1914061&r2=1914062&view=diff ============================================================================== --- pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/pfb/PfbParser.java (original) +++ pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/pfb/PfbParser.java Thu Nov 23 04:42:10 2023 @@ -143,7 +143,7 @@ public class PfbParser } // read into segments and keep them List<Integer> typeList = new ArrayList<Integer>(3); - List<byte[]> barrList = new ArrayList<byte[]>(); + List<byte[]> barrList = new ArrayList<byte[]>(3); ByteArrayInputStream in = new ByteArrayInputStream(pfb); int total = 0; do @@ -171,8 +171,11 @@ public class PfbParser size += in.read() << 8; size += in.read() << 16; size += in.read() << 24; - LOG.debug("record type: " + recordType + ", segment size: " + size); - byte ar[] = new byte[size]; + if (LOG.isDebugEnabled()) + { + LOG.debug("record type: " + recordType + ", segment size: " + size); + } + byte[] ar = new byte[size]; int got = in.read(ar); if (got != size) {