pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1799282 - /pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/afm/AFMParser.java
Date Mon, 19 Jun 2017 21:25:32 GMT
Author: tilman
Date: Mon Jun 19 21:25:32 2017
New Revision: 1799282

URL: http://svn.apache.org/viewvc?rev=1799282&view=rev
Log:
PDFBOX-2852: refactor

Modified:
    pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/afm/AFMParser.java

Modified: pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/afm/AFMParser.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/afm/AFMParser.java?rev=1799282&r1=1799281&r2=1799282&view=diff
==============================================================================
--- pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/afm/AFMParser.java (original)
+++ pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/afm/AFMParser.java Mon Jun 19 21:25:32
2017
@@ -637,10 +637,10 @@ public class AFMParser
             throw new IOException( "String should be enclosed by angle brackets '" + hexString+
"'" );
         }
         hexString = hexString.substring( 1, hexString.length() -1 );
-        byte[] data = new byte[ (hexString.length() / 2) ];
+        byte[] data = new byte[hexString.length() / 2];
         for( int i=0; i<hexString.length(); i+=2 )
         {
-            String hex = "" + hexString.charAt( i ) + hexString.charAt( i+1 );
+            String hex = Character.toString(hexString.charAt(i)) + hexString.charAt(i + 1);
             try
             {
                 data[ i / 2 ] = (byte)Integer.parseInt( hex, BITS_IN_HEX );
@@ -838,7 +838,7 @@ public class AFMParser
         if( tokenizer.hasMoreTokens() )
         {
             String semicolon = tokenizer.nextToken();
-            if( !semicolon.equals( ";" ) )
+            if (!";".equals(semicolon))
             {
                 throw new IOException( "Error: Expected semicolon in stream actual='" +
                                             semicolon + "'" );



Mime
View raw message