pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1783550 - in /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading: PatchMeshesShadingContext.java Type5ShadingContext.java
Date Sat, 18 Feb 2017 13:55:33 GMT
Author: tilman
Date: Sat Feb 18 13:55:33 2017
New Revision: 1783550

URL: http://svn.apache.org/viewvc?rev=1783550&view=rev
Log:
PDFBOX-2852: sonar fix: add an end condition to this loop

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/PatchMeshesShadingContext.java
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/Type5ShadingContext.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/PatchMeshesShadingContext.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/PatchMeshesShadingContext.java?rev=1783550&r1=1783549&r2=1783550&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/PatchMeshesShadingContext.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/PatchMeshesShadingContext.java
Sat Feb 18 13:55:33 2017
@@ -114,7 +114,8 @@ abstract class PatchMeshesShadingContext
                 LOG.error(ex);
             }
 
-            while (true)
+            boolean eof = false;
+            while (!eof)
             {
                 try
                 {
@@ -150,7 +151,7 @@ abstract class PatchMeshesShadingContext
                 }
                 catch (EOFException ex)
                 {
-                    break;
+                    eof = true;
                 }
             }
         }

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/Type5ShadingContext.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/Type5ShadingContext.java?rev=1783550&r1=1783549&r2=1783550&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/Type5ShadingContext.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/Type5ShadingContext.java
Sat Feb 18 13:55:33 2017
@@ -83,7 +83,8 @@ class Type5ShadingContext extends Gourau
         ImageInputStream mciis = new MemoryCacheImageInputStream(cosStream.createInputStream());
         try
         {
-            while (true)
+            boolean eof = false;
+            while (!eof)
             {
                 Vertex p;
                 try
@@ -93,7 +94,7 @@ class Type5ShadingContext extends Gourau
                 }
                 catch (EOFException ex)
                 {
-                    break;
+                    eof = true;
                 }
             }
         }



Mime
View raw message