pdfbox-commits mailing list archives

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

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

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

Modified: pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/afm/AFMParser.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/afm/AFMParser.java?rev=1799283&r1=1799282&r2=1799283&view=diff
==============================================================================
--- pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/afm/AFMParser.java (original)
+++ pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/afm/AFMParser.java Mon Jun
19 21:25:36 2017
@@ -666,10 +666,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 );
@@ -881,7 +881,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