Program: 151034
Project: 151034
Buggy source:
/** 
 * Converts the buffered image into an   {@link boofcv.struct.image.MultiSpectral} image of the specifiedtype. 
 * @param src Input image.
 * @param dst Where the converted image is written to.  If null a new unsigned image is created.
 * @param type Which type of data structure is each band. (ImageUInt8 or ImageFloat32)
 * @return Converted image.
 */
public static <T extends ImageSingleBand>MultiSpectral<T> convertFromMulti(BufferedImage src,MultiSpectral<T> dst,Class<T> type){
  if (dst != null) {
    if (src.getWidth() != dst.getWidth() || src.getHeight() != dst.getHeight()) {
      throw new IllegalArgumentException("String_Node_Str");
    }
  }
  try {
    WritableRaster raster=src.getRaster();
    int numBands;
    if (src.getType() == BufferedImage.TYPE_BYTE_INDEXED)     numBands=3;
 else     numBands=raster.getNumBands();
    if (dst == null)     dst=new MultiSpectral<T>(type,src.getWidth(),src.getHeight(),numBands);
 else     if (dst.getNumBands() != numBands)     throw new IllegalArgumentException("String_Node_Str" + numBands + "String_Node_Str");
    if (type == ImageUInt8.class) {
      if (src.getRaster() instanceof ByteInterleavedRaster && src.getType() != BufferedImage.TYPE_BYTE_INDEXED) {
        if (src.getType() == BufferedImage.TYPE_BYTE_GRAY) {
          for (int i=0; i < dst.getNumBands(); i++)           ConvertRaster.bufferedToGray(src,((MultiSpectral<ImageUInt8>)dst).getBand(i));
        }
 else {
          ConvertRaster.bufferedToMulti_U8((ByteInterleavedRaster)src.getRaster(),(MultiSpectral<ImageUInt8>)dst);
        }
      }
 else       if (src.getRaster() instanceof IntegerInterleavedRaster) {
        ConvertRaster.bufferedToMulti_U8((IntegerInterleavedRaster)src.getRaster(),(MultiSpectral<ImageUInt8>)dst);
      }
 else {
        ConvertRaster.bufferedToMulti_U8(src,(MultiSpectral<ImageUInt8>)dst);
      }
    }
 else     if (type == ImageFloat32.class) {
      if (src.getRaster() instanceof ByteInterleavedRaster && src.getType() != BufferedImage.TYPE_BYTE_INDEXED) {
        if (src.getType() == BufferedImage.TYPE_BYTE_GRAY) {
          for (int i=0; i < dst.getNumBands(); i++)           ConvertRaster.bufferedToGray(src,((MultiSpectral<ImageFloat32>)dst).getBand(i));
        }
 else {
          ConvertRaster.bufferedToMulti_F32((ByteInterleavedRaster)src.getRaster(),(MultiSpectral<ImageFloat32>)dst);
        }
      }
 else       if (src.getRaster() instanceof IntegerInterleavedRaster) {
        ConvertRaster.bufferedToMulti_F32((IntegerInterleavedRaster)src.getRaster(),(MultiSpectral<ImageFloat32>)dst);
      }
 else {
        ConvertRaster.bufferedToMulti_F32(src,(MultiSpectral<ImageFloat32>)dst);
      }
    }
 else {
      throw new IllegalArgumentException("String_Node_Str");
    }
  }
 catch (  java.security.AccessControlException e) {
    dst=new MultiSpectral<T>(type,src.getWidth(),src.getHeight(),3);
    if (type == ImageUInt8.class) {
      ConvertRaster.bufferedToMulti_U8(src,(MultiSpectral<ImageUInt8>)dst);
    }
 else     if (type == ImageFloat32.class) {
      ConvertRaster.bufferedToMulti_F32(src,(MultiSpectral<ImageFloat32>)dst);
    }
  }
  return dst;
}

Fixed version (ground truth):
/** 
 * Converts the buffered image into an   {@link boofcv.struct.image.MultiSpectral} image of the specifiedtype. 
 * @param src Input image.
 * @param dst Where the converted image is written to.  If null a new unsigned image is created.
 * @param type Which type of data structure is each band. (ImageUInt8 or ImageFloat32)
 * @return Converted image.
 */
public static <T extends ImageSingleBand>MultiSpectral<T> convertFromMulti(BufferedImage src,MultiSpectral<T> dst,Class<T> type){
  if (dst != null) {
    if (src.getWidth() != dst.getWidth() || src.getHeight() != dst.getHeight()) {
      throw new IllegalArgumentException("String_Node_Str");
    }
  }
  try {
    WritableRaster raster=src.getRaster();
    int numBands;
    if (src.getType() == BufferedImage.TYPE_BYTE_INDEXED)     numBands=3;
 else     numBands=raster.getNumBands();
    if (dst == null)     dst=new MultiSpectral<T>(type,src.getWidth(),src.getHeight(),numBands);
 else     if (dst.getNumBands() != numBands)     throw new IllegalArgumentException("String_Node_Str" + numBands + "String_Node_Str"+ dst.getNumBands());
    if (type == ImageUInt8.class) {
      if (src.getRaster() instanceof ByteInterleavedRaster && src.getType() != BufferedImage.TYPE_BYTE_INDEXED) {
        if (src.getType() == BufferedImage.TYPE_BYTE_GRAY) {
          for (int i=0; i < dst.getNumBands(); i++)           ConvertRaster.bufferedToGray(src,((MultiSpectral<ImageUInt8>)dst).getBand(i));
        }
 else {
          ConvertRaster.bufferedToMulti_U8((ByteInterleavedRaster)src.getRaster(),(MultiSpectral<ImageUInt8>)dst);
        }
      }
 else       if (src.getRaster() instanceof IntegerInterleavedRaster) {
        ConvertRaster.bufferedToMulti_U8((IntegerInterleavedRaster)src.getRaster(),(MultiSpectral<ImageUInt8>)dst);
      }
 else {
        ConvertRaster.bufferedToMulti_U8(src,(MultiSpectral<ImageUInt8>)dst);
      }
    }
 else     if (type == ImageFloat32.class) {
      if (src.getRaster() instanceof ByteInterleavedRaster && src.getType() != BufferedImage.TYPE_BYTE_INDEXED) {
        if (src.getType() == BufferedImage.TYPE_BYTE_GRAY) {
          for (int i=0; i < dst.getNumBands(); i++)           ConvertRaster.bufferedToGray(src,((MultiSpectral<ImageFloat32>)dst).getBand(i));
        }
 else {
          ConvertRaster.bufferedToMulti_F32((ByteInterleavedRaster)src.getRaster(),(MultiSpectral<ImageFloat32>)dst);
        }
      }
 else       if (src.getRaster() instanceof IntegerInterleavedRaster) {
        ConvertRaster.bufferedToMulti_F32((IntegerInterleavedRaster)src.getRaster(),(MultiSpectral<ImageFloat32>)dst);
      }
 else {
        ConvertRaster.bufferedToMulti_F32(src,(MultiSpectral<ImageFloat32>)dst);
      }
    }
 else {
      throw new IllegalArgumentException("String_Node_Str");
    }
  }
 catch (  java.security.AccessControlException e) {
    dst=new MultiSpectral<T>(type,src.getWidth(),src.getHeight(),3);
    if (type == ImageUInt8.class) {
      ConvertRaster.bufferedToMulti_U8(src,(MultiSpectral<ImageUInt8>)dst);
    }
 else     if (type == ImageFloat32.class) {
      ConvertRaster.bufferedToMulti_F32(src,(MultiSpectral<ImageFloat32>)dst);
    }
  }
  return dst;
}