Program: 150929
Project: 150929
Buggy source:
public static void checkEquals(BufferedImage imgA,ImageMultiBand imgB,boolean boofcvBandOrder,float tol){
  GImageMultiBand genericB=FactoryGImageMultiBand.wrap(imgB);
  float pixelB[]=new float[imgB.getNumBands()];
  if (imgA.getRaster() instanceof ByteInterleavedRaster && imgA.getType() != BufferedImage.TYPE_BYTE_INDEXED) {
    ByteInterleavedRaster raster=(ByteInterleavedRaster)imgA.getRaster();
    if (raster.getNumBands() == 1) {
      int strideA=raster.getScanlineStride();
      int offsetA=raster.getDataOffset(0) - raster.getPixelStride() + 1;
      for (int i=0; i < imgA.getHeight(); i++) {
        for (int j=0; j < imgA.getWidth(); j++) {
          genericB.get(j,i,pixelB);
          double valB=pixelB[0];
          int valA=raster.getDataStorage()[offsetA + i * strideA + j];
          valA&=0xFF;
          if (Math.abs(valA - valB) > tol)           throw new RuntimeException("String_Node_Str" + valA + "String_Node_Str"+ valB);
        }
      }
      return;
    }
  }
  int bandOrder[];
  if (boofcvBandOrder) {
    if (imgB.getNumBands() == 4) {
      bandOrder=new int[]{1,2,3,0};
    }
 else {
      bandOrder=new int[]{0,1,2};
    }
  }
 else {
    if (imgA.getType() == BufferedImage.TYPE_INT_RGB) {
      bandOrder=new int[]{0,1,2};
    }
 else     if (imgA.getType() == BufferedImage.TYPE_INT_BGR || imgA.getType() == BufferedImage.TYPE_3BYTE_BGR) {
      bandOrder=new int[]{2,1,0};
    }
 else     if (imgA.getType() == BufferedImage.TYPE_4BYTE_ABGR) {
      bandOrder=new int[]{0,3,2,1};
    }
 else     if (imgA.getType() == BufferedImage.TYPE_INT_ARGB) {
      bandOrder=new int[]{0,1,2,3};
    }
 else {
      bandOrder=new int[]{0,1,2};
    }
  }
  int expected[]=new int[4];
  for (int y=0; y < imgA.getHeight(); y++) {
    for (int x=0; x < imgA.getWidth(); x++) {
      int rgb=imgA.getRGB(x,y);
      expected[0]=((rgb >>> 24) & 0xFF);
      expected[1]=((rgb >>> 16) & 0xFF);
      expected[2]=((rgb >>> 8) & 0xFF);
      expected[3]=(rgb & 0xFF);
      if (imgB.getNumBands() == 4) {
        genericB.get(x,y,pixelB);
        for (int i=0; i < 4; i++) {
          double found=pixelB[bandOrder[i]];
          if (Math.abs(Math.exp(expected[i] - found)) > tol) {
            for (int j=0; j < 4; j++) {
              System.out.println(expected[j] + "String_Node_Str" + pixelB[bandOrder[j]]);
            }
            throw new RuntimeException("String_Node_Str" + i + "String_Node_Str"+ imgA.getType());
          }
        }
      }
 else       if (imgB.getNumBands() == 3) {
        genericB.get(x,y,pixelB);
        for (int i=0; i < 3; i++) {
          double found=pixelB[bandOrder[i]];
          if (Math.abs(expected[i + 1] - found) > tol) {
            for (int j=0; j < 3; j++) {
              System.out.println(expected[j + 1] + "String_Node_Str" + pixelB[bandOrder[j]]);
            }
            throw new RuntimeException("String_Node_Str" + i + "String_Node_Str"+ imgA.getType());
          }
        }
      }
 else {
        throw new RuntimeException("String_Node_Str");
      }
    }
  }
}

Fixed version (ground truth):
public static void checkEquals(BufferedImage imgA,ImageMultiBand imgB,boolean boofcvBandOrder,float tol){
  GImageMultiBand genericB=FactoryGImageMultiBand.wrap(imgB);
  float pixelB[]=new float[imgB.getNumBands()];
  if (imgA.getRaster() instanceof ByteInterleavedRaster && imgA.getType() != BufferedImage.TYPE_BYTE_INDEXED) {
    ByteInterleavedRaster raster=(ByteInterleavedRaster)imgA.getRaster();
    if (raster.getNumBands() == 1) {
      int strideA=raster.getScanlineStride();
      int offsetA=raster.getDataOffset(0) - raster.getPixelStride() + 1;
      for (int i=0; i < imgA.getHeight(); i++) {
        for (int j=0; j < imgA.getWidth(); j++) {
          genericB.get(j,i,pixelB);
          double valB=pixelB[0];
          int valA=raster.getDataStorage()[offsetA + i * strideA + j];
          valA&=0xFF;
          if (Math.abs(valA - valB) > tol)           throw new RuntimeException("String_Node_Str" + valA + "String_Node_Str"+ valB);
        }
      }
      return;
    }
  }
  int bandOrder[];
  if (boofcvBandOrder) {
    if (imgB.getNumBands() == 4) {
      bandOrder=new int[]{1,2,3,0};
    }
 else {
      bandOrder=new int[]{0,1,2};
    }
  }
 else {
    if (imgA.getType() == BufferedImage.TYPE_INT_RGB) {
      bandOrder=new int[]{0,1,2};
    }
 else     if (imgA.getType() == BufferedImage.TYPE_INT_BGR || imgA.getType() == BufferedImage.TYPE_3BYTE_BGR) {
      bandOrder=new int[]{2,1,0};
    }
 else     if (imgA.getType() == BufferedImage.TYPE_4BYTE_ABGR) {
      bandOrder=new int[]{0,3,2,1};
    }
 else     if (imgA.getType() == BufferedImage.TYPE_INT_ARGB) {
      bandOrder=new int[]{0,1,2,3};
    }
 else {
      bandOrder=new int[]{0,1,2};
    }
  }
  int expected[]=new int[4];
  for (int y=0; y < imgA.getHeight(); y++) {
    for (int x=0; x < imgA.getWidth(); x++) {
      int rgb=imgA.getRGB(x,y);
      expected[0]=((rgb >>> 24) & 0xFF);
      expected[1]=((rgb >>> 16) & 0xFF);
      expected[2]=((rgb >>> 8) & 0xFF);
      expected[3]=(rgb & 0xFF);
      if (imgB.getNumBands() == 4) {
        genericB.get(x,y,pixelB);
        for (int i=0; i < 4; i++) {
          double found=pixelB[bandOrder[i]];
          if (Math.abs(Math.exp(expected[i] - found)) > tol) {
            for (int j=0; j < 4; j++) {
              System.out.println(expected[j] + "String_Node_Str" + pixelB[bandOrder[j]]);
            }
            throw new RuntimeException("String_Node_Str" + i + "String_Node_Str"+ imgA.getType());
          }
        }
      }
 else       if (imgB.getNumBands() == 3) {
        genericB.get(x,y,pixelB);
        for (int i=0; i < 3; i++) {
          double found=pixelB[bandOrder[i]];
          if (Math.abs(expected[i + 1] - found) > tol) {
            for (int j=0; j < 3; j++) {
              System.out.println(expected[j + 1] + "String_Node_Str" + pixelB[bandOrder[j]]);
            }
            throw new RuntimeException("String_Node_Str" + i + "String_Node_Str"+ imgA.getType());
          }
        }
      }
 else       if (imgB.getNumBands() == 1) {
        genericB.get(x,y,pixelB);
        double expectedGray=(expected[1] + expected[2] + expected[3]) / 3.0;
        if (Math.abs(expectedGray - pixelB[0]) > tol) {
          throw new RuntimeException("String_Node_Str" + imgA.getType() + "String_Node_Str");
        }
      }
 else {
        throw new RuntimeException("String_Node_Str");
      }
    }
  }
}