commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1775886 - in /commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging: color/ColorCmyk.java formats/pnm/PnmImageParser.java
Date Fri, 23 Dec 2016 18:50:18 GMT
Author: ggregory
Date: Fri Dec 23 18:50:18 2016
New Revision: 1775886

URL: http://svn.apache.org/viewvc?rev=1775886&view=rev
Log:
Always use blocks.

Modified:
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/color/ColorCmyk.java
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PnmImageParser.java

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/color/ColorCmyk.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/color/ColorCmyk.java?rev=1775886&r1=1775885&r2=1775886&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/color/ColorCmyk.java
(original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/color/ColorCmyk.java
Fri Dec 23 18:50:18 2016
@@ -128,7 +128,9 @@ public final class ColorCmyk {
         if (this == o) {
             return true;
         }
-        if (o == null || getClass() != o.getClass()) return false;
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
 
         ColorCmyk colorCmyk = (ColorCmyk) o;
         if (Double.compare(colorCmyk.C, C) != 0) {

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PnmImageParser.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PnmImageParser.java?rev=1775886&r1=1775885&r2=1775886&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PnmImageParser.java
(original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PnmImageParser.java
Fri Dec 23 18:50:18 2016
@@ -156,28 +156,33 @@ public class PnmImageParser extends Imag
                 final String type = tokenizer.nextToken();
                 if ("WIDTH".equals(type)) {
                     seenWidth = true;
-                    if(!tokenizer.hasMoreTokens())
+                    if(!tokenizer.hasMoreTokens()) {
                         throw new ImageReadException("PAM header has no WIDTH value");
+                    }
                     width = Integer.parseInt(tokenizer.nextToken());
                 } else if ("HEIGHT".equals(type)) {
                     seenHeight = true;
-                    if(!tokenizer.hasMoreTokens())
+                    if(!tokenizer.hasMoreTokens()) {
                         throw new ImageReadException("PAM header has no HEIGHT value");
+                    }
                     height = Integer.parseInt(tokenizer.nextToken());
                 } else if ("DEPTH".equals(type)) {
                     seenDepth = true;
-                    if(!tokenizer.hasMoreTokens())
+                    if(!tokenizer.hasMoreTokens()) {
                         throw new ImageReadException("PAM header has no DEPTH value");
+                    }
                     depth = Integer.parseInt(tokenizer.nextToken());
                 } else if ("MAXVAL".equals(type)) {
                     seenMaxVal = true;
-                    if(!tokenizer.hasMoreTokens())
+                    if(!tokenizer.hasMoreTokens()) {
                         throw new ImageReadException("PAM header has no MAXVAL value");
+                    }
                     maxVal = Integer.parseInt(tokenizer.nextToken());
                 } else if ("TUPLTYPE".equals(type)) {
                     seenTupleType = true;
-                    if(!tokenizer.hasMoreTokens())
+                    if(!tokenizer.hasMoreTokens()) {
                         throw new ImageReadException("PAM header has no TUPLTYPE value");
+                    }
                     tupleType.append(tokenizer.nextToken());
                 } else if ("ENDHDR".equals(type)) {
                     break;



Mime
View raw message