6379088: Suboptimal expression in javax.imageio.ImageTypeSpecifier.getBitsPerBand(int)
authorpsadhukhan
Thu, 17 Mar 2016 11:23:31 +0530
changeset 36889 e36687a00487
parent 36888 0905e6c2d1af
child 36890 b1b7c1f2ad89
6379088: Suboptimal expression in javax.imageio.ImageTypeSpecifier.getBitsPerBand(int) Reviewed-by: prr, serb, jdv
jdk/src/java.desktop/share/classes/javax/imageio/ImageTypeSpecifier.java
--- a/jdk/src/java.desktop/share/classes/javax/imageio/ImageTypeSpecifier.java	Wed Mar 16 15:55:27 2016 +0300
+++ b/jdk/src/java.desktop/share/classes/javax/imageio/ImageTypeSpecifier.java	Thu Mar 17 11:23:31 2016 +0530
@@ -997,7 +997,7 @@
      * negative or greater than the largest band index.
      */
     public int getBitsPerBand(int band) {
-        if (band < 0 | band >= getNumBands()) {
+        if (band < 0 || band >= getNumBands()) {
             throw new IllegalArgumentException("band out of range!");
         }
         return sampleModel.getSampleSize(band);