Program: 25522
Project: 25522
Buggy source:
/** 
 * Maps pixels from a source to a target.
 * @param source                  source pixel data.
 * @param mipmapLevel             source mipmap level.
 * @param renderTransformList     list of transforms for the render context.
 * @param meshCellSize            desired size of a mesh cell (triangle) in pixels.
 * @param binaryMask              render only 100% opaque pixels.
 * @param numberOfMappingThreads  number of threads to use for pixel mapping.
 * @param skipInterpolation       enable sloppy but fast rendering by skipping interpolation.
 * @param targetChannels          target channels for mapped results.
 */
public static void mapPixels(final MipmapSource source,final int mipmapLevel,final CoordinateTransformList<CoordinateTransform> renderTransformList,final double meshCellSize,final boolean binaryMask,final int numberOfMappingThreads,final boolean skipInterpolation,final ChannelMap targetChannels){
  final ChannelMap sourceChannels=source.getChannels(mipmapLevel);
  if (sourceChannels.size() > 0) {
    final long mapStart=System.currentTimeMillis();
    final ImageProcessorWithMasks firstChannel=sourceChannels.getFirstChannel();
    final boolean hasMask=(firstChannel.mask != null);
    final int mipmapWidth=firstChannel.ip.getWidth();
    final int mipmapHeight=firstChannel.ip.getHeight();
    if (hasMask) {
      for (      final ImageProcessorWithMasks targetChannel : targetChannels.values()) {
        if (targetChannel.mask == null) {
          targetChannel.mask=new ByteProcessor(targetChannel.ip.getWidth(),targetChannel.ip.getHeight());
        }
      }
    }
    final PixelMapper tilePixelMapper=getPixelMapper(sourceChannels,hasMask,binaryMask,skipInterpolation,targetChannels);
    if (tilePixelMapper != null) {
      final RenderTransformMesh mesh=createRenderMesh(mipmapLevel,renderTransformList,source.getFullScaleWidth(),meshCellSize,mipmapWidth,mipmapHeight);
      final long meshCreationStop=System.currentTimeMillis();
      final RenderTransformMeshMappingWithMasks mapping=new RenderTransformMeshMappingWithMasks(mesh);
      final String mapType=skipInterpolation ? "String_Node_Str" : "String_Node_Str";
      mapping.map(tilePixelMapper,numberOfMappingThreads);
      for (      final String channelName : targetChannels.names()) {
        final ImageProcessorWithMasks sourceChannel=sourceChannels.get(channelName);
        final ImageProcessorWithMasks targetChannel=targetChannels.get(channelName);
        targetChannel.ip.setMinAndMax(sourceChannel.ip.getMin(),sourceChannel.ip.getMax());
      }
      final long mapStop=System.currentTimeMillis();
      LOG.debug("String_Node_Str",source.getSourceName(),mapStop - mapStart,meshCreationStop - mapStart,mapType,mapStop - meshCreationStop);
    }
  }
 else {
    LOG.warn("String_Node_Str",source.getSourceName());
  }
}

Fixed version (ground truth):
/** 
 * Maps pixels from a source to a target.
 * @param source                  source pixel data.
 * @param mipmapLevel             source mipmap level.
 * @param renderTransformList     list of transforms for the render context.
 * @param meshCellSize            desired size of a mesh cell (triangle) in pixels.
 * @param canvasHasMasks          true if at least one source in the larger canvas being rendered has a mask(even if this source does not have a mask).
 * @param binaryMask              render only 100% opaque pixels.
 * @param numberOfMappingThreads  number of threads to use for pixel mapping.
 * @param skipInterpolation       enable sloppy but fast rendering by skipping interpolation.
 * @param targetChannels          target channels for mapped results.
 */
public static void mapPixels(final MipmapSource source,final int mipmapLevel,final CoordinateTransformList<CoordinateTransform> renderTransformList,final double meshCellSize,final boolean canvasHasMasks,final boolean binaryMask,final int numberOfMappingThreads,final boolean skipInterpolation,final ChannelMap targetChannels){
  final ChannelMap sourceChannels=source.getChannels(mipmapLevel);
  if (sourceChannels.size() > 0) {
    final long mapStart=System.currentTimeMillis();
    final ImageProcessorWithMasks firstChannel=sourceChannels.getFirstChannel();
    final int mipmapWidth=firstChannel.ip.getWidth();
    final int mipmapHeight=firstChannel.ip.getHeight();
    if (canvasHasMasks) {
      for (      final ImageProcessorWithMasks targetChannel : targetChannels.values()) {
        if (targetChannel.mask == null) {
          targetChannel.mask=new ByteProcessor(targetChannel.ip.getWidth(),targetChannel.ip.getHeight());
        }
      }
      for (      final ImageProcessorWithMasks sourceChannel : sourceChannels.values()) {
        if (sourceChannel.mask == null) {
          sourceChannel.mask=new ByteProcessor(sourceChannel.ip.getWidth(),sourceChannel.ip.getHeight());
          sourceChannel.mask.invert();
        }
      }
    }
    final PixelMapper tilePixelMapper=getPixelMapper(sourceChannels,canvasHasMasks,binaryMask,skipInterpolation,targetChannels);
    if (tilePixelMapper != null) {
      final RenderTransformMesh mesh=createRenderMesh(mipmapLevel,renderTransformList,source.getFullScaleWidth(),meshCellSize,mipmapWidth,mipmapHeight);
      final long meshCreationStop=System.currentTimeMillis();
      final RenderTransformMeshMappingWithMasks mapping=new RenderTransformMeshMappingWithMasks(mesh);
      final String mapType=skipInterpolation ? "String_Node_Str" : "String_Node_Str";
      mapping.map(tilePixelMapper,numberOfMappingThreads);
      for (      final String channelName : targetChannels.names()) {
        final ImageProcessorWithMasks sourceChannel=sourceChannels.get(channelName);
        final ImageProcessorWithMasks targetChannel=targetChannels.get(channelName);
        targetChannel.ip.setMinAndMax(sourceChannel.ip.getMin(),sourceChannel.ip.getMax());
      }
      final long mapStop=System.currentTimeMillis();
      LOG.debug("String_Node_Str",source.getSourceName(),mapStop - mapStart,meshCreationStop - mapStart,mapType,mapStop - meshCreationStop);
    }
  }
 else {
    LOG.warn("String_Node_Str",source.getSourceName());
  }
}