pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1789788 - in /pdfbox/trunk: fontbox/src/main/java/org/apache/fontbox/type1/Type1Parser.java tools/src/main/java/org/apache/pdfbox/tools/imageio/ImageIOUtil.java
Date Sat, 01 Apr 2017 11:24:03 GMT
Author: tilman
Date: Sat Apr  1 11:24:03 2017
New Revision: 1789788

URL: http://svn.apache.org/viewvc?rev=1789788&view=rev
Log:
PDFBOX-2852: sonar fix

Modified:
    pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/type1/Type1Parser.java
    pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/imageio/ImageIOUtil.java

Modified: pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/type1/Type1Parser.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/type1/Type1Parser.java?rev=1789788&r1=1789787&r2=1789788&view=diff
==============================================================================
--- pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/type1/Type1Parser.java (original)
+++ pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/type1/Type1Parser.java Sat Apr 
1 11:24:03 2017
@@ -111,7 +111,7 @@ final class Type1Parser
             // premature end
             Token token = lexer.peekToken();
             if (token.getKind() == Token.NAME &&
-                (token.getText().equals("currentdict") || token.getText().equals("end")))
+                ("currentdict".equals(token.getText()) || "end".equals(token.getText())))
             {
                 break;
             }
@@ -723,6 +723,8 @@ final class Type1Parser
             case "noaccess":
                 token = read(Token.NAME);
                 break;
+            default:
+                break;
         }
 
         if (token.getText().equals("def"))
@@ -748,6 +750,8 @@ final class Type1Parser
             case "noaccess":
                 token = read(Token.NAME);
                 break;
+            default:
+                break;
         }
 
         if (token.getText().equals("put")) 

Modified: pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/imageio/ImageIOUtil.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/imageio/ImageIOUtil.java?rev=1789788&r1=1789787&r2=1789788&view=diff
==============================================================================
--- pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/imageio/ImageIOUtil.java (original)
+++ pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/imageio/ImageIOUtil.java Sat
Apr  1 11:24:03 2017
@@ -184,17 +184,16 @@ public final class ImageIOUtil
                     writer.dispose();
                 }
                 writer = writers.next();
-                if (writer == null)
+                if (writer != null)
                 {
-                    continue;
-                }
-                param = writer.getDefaultWriteParam();
-                metadata = writer.getDefaultImageMetadata(new ImageTypeSpecifier(image),
param);
-                if (metadata != null
-                        && !metadata.isReadOnly()
-                        && metadata.isStandardMetadataFormatSupported())
-                {
-                    break;
+                    param = writer.getDefaultWriteParam();
+                    metadata = writer.getDefaultImageMetadata(new ImageTypeSpecifier(image),
param);
+                    if (metadata != null
+                            && !metadata.isReadOnly()
+                            && metadata.isStandardMetadataFormatSupported())
+                    {
+                        break;
+                    }
                 }
             }
             if (writer == null)



Mime
View raw message