nus-yam/ex-repair huggingface dataset:
Program: 25545
Project: 25545
Buggy source:
private RenderParameters generateLevelZeroBox(final int x,final int y,final Double z,final ImageProcessorCache imageProcessorCache,final BoxMipmapGenerator boxMipmapGenerator,final IGridPaths iGridPaths,final File levelZeroFile,final int row,final int column) throws IOException {
  final String parametersUrl=getRenderDataClient().getRenderParametersUrlString(stack,x,y,z,boxWidth,boxHeight,1.0);
  LOG.info("String_Node_Str",parametersUrl);
  final RenderParameters renderParameters=RenderParameters.loadFromUrl(parametersUrl);
  renderParameters.setSkipInterpolation(parameters.skipInterpolation);
  renderParameters.setBinaryMask(parameters.binaryMask);
  renderParameters.setBackgroundRGBColor(backgroundRGBColor);
  if (renderParameters.hasTileSpecs()) {
    final BufferedImage levelZeroImage=renderParameters.openTargetImage();
    Render.render(renderParameters,levelZeroImage,imageProcessorCache);
    BoxMipmapGenerator.saveImage(levelZeroImage,levelZeroFile,parameters.label,format);
    boxMipmapGenerator.addSource(row,column,levelZeroFile);
    if (iGridPaths != null) {
      iGridPaths.addImage(levelZeroFile,row,column);
    }
  }
 else {
    LOG.info("String_Node_Str",z,row,column);
  }
  return renderParameters;
}

Fixed version (ground truth):
private RenderParameters generateLevelZeroBox(final int x,final int y,final Double z,final ImageProcessorCache imageProcessorCache,final BoxMipmapGenerator boxMipmapGenerator,final IGridPaths iGridPaths,final File levelZeroFile,final int row,final int column) throws IOException {
  final String parametersUrl=getRenderDataClient().getRenderParametersUrlString(stack,x,y,z,boxWidth,boxHeight,1.0);
  LOG.info("String_Node_Str",parametersUrl);
  final RenderParameters renderParameters=RenderParameters.loadFromUrl(parametersUrl);
  renderParameters.setSkipInterpolation(parameters.skipInterpolation);
  renderParameters.setBinaryMask(parameters.binaryMask);
  renderParameters.setBackgroundRGBColor(backgroundRGBColor);
  if (renderParameters.hasTileSpecs()) {
    final BufferedImage levelZeroImage=renderParameters.openTargetImage();
    Render.render(renderParameters,levelZeroImage,imageProcessorCache);
    BoxMipmapGenerator.saveImage(levelZeroImage,levelZeroFile,parameters.label,format);
    boxMipmapGenerator.addSource(row,column,levelZeroFile);
    if (iGridPaths != null) {
      iGridPaths.addImage(levelZeroFile,row,column);
    }
  }
 else {
    LOG.info("String_Node_Str",row,column);
  }
  return renderParameters;
}
Program: 25546
Project: 25546
Buggy source:
public int size(){
  return (matches == null) ? 0 : matches.getWs().length;
}

Fixed version (ground truth):
public int size(){
  int size=0;
  if (matches != null) {
    final double[] w=matches.getWs();
    if (w != null) {
      size=w.length;
    }
  }
  return size;
}
Program: 25548
Project: 25548
Buggy source:
public String getBaseOwner(){
  if (baseOwner == null) {
    baseOwner=owner;
  }
  return baseProject;
}

Fixed version (ground truth):
public String getBaseOwner(){
  if (baseOwner == null) {
    baseOwner=owner;
  }
  return baseOwner;
}
Program: 25549
Project: 25549
Buggy source:
@Override public Iterator<CanvasMatches> call(final Integer partitionIndex,final Iterator<OrderedCanvasIdPair> pairIterator) throws Exception {
  LogUtilities.setupExecutorLog4j("String_Node_Str" + partitionIndex);
  final Logger log=LoggerFactory.getLogger(SIFTPointMatchClient.class);
  final CanvasDataCache dataCache=CanvasDataCache.getSharedCache(broadcastCacheMaxKilobytes.getValue(),broadcastFeatureLoader.getValue());
  final CanvasFeatureMatcher featureMatcher=broadcastFeatureMatcher.getValue();
  final List<CanvasMatches> matchList=new ArrayList<>();
  int pairCount=0;
  OrderedCanvasIdPair pair;
  CanvasId p;
  CanvasId q;
  List<Feature> pFeatures;
  List<Feature> qFeatures;
  CanvasFeatureMatchResult matchResult;
  Matches inlierMatches;
  while (pairIterator.hasNext()) {
    pair=pairIterator.next();
    pairCount++;
    p=pair.getP();
    q=pair.getQ();
    pFeatures=dataCache.getFeatureList(p);
    qFeatures=dataCache.getFeatureList(q);
    log.info("String_Node_Str",p,q);
    matchResult=featureMatcher.deriveMatchResult(pFeatures,qFeatures);
    inlierMatches=matchResult.getInlierMatches();
    if (inlierMatches.getWs().length > 0) {
      matchList.add(new CanvasMatches(p.getGroupId(),p.getId(),q.getGroupId(),q.getId(),matchResult.getInlierMatches()));
    }
  }
  log.info("String_Node_Str",matchList.size(),pairCount,dataCache.stats());
  return matchList.iterator();
}

Fixed version (ground truth):
@Override public Iterator<CanvasMatches> call(final Integer partitionIndex,final Iterator<OrderedCanvasIdPair> pairIterator) throws Exception {
  LogUtilities.setupExecutorLog4j("String_Node_Str" + partitionIndex);
  final Logger log=LoggerFactory.getLogger(SIFTPointMatchClient.class);
  final CanvasDataCache dataCache=CanvasDataCache.getSharedCache(broadcastCacheMaxKilobytes.getValue(),broadcastFeatureLoader.getValue());
  final CanvasFeatureMatcher featureMatcher=broadcastFeatureMatcher.getValue();
  final List<CanvasMatches> matchList=new ArrayList<>();
  int pairCount=0;
  OrderedCanvasIdPair pair;
  CanvasId p;
  CanvasId q;
  List<Feature> pFeatures;
  List<Feature> qFeatures;
  CanvasFeatureMatchResult matchResult;
  Matches inlierMatches;
  while (pairIterator.hasNext()) {
    pair=pairIterator.next();
    pairCount++;
    p=pair.getP();
    q=pair.getQ();
    pFeatures=dataCache.getFeatureList(p);
    qFeatures=dataCache.getFeatureList(q);
    log.info("String_Node_Str",p,q);
    matchResult=featureMatcher.deriveMatchResult(pFeatures,qFeatures);
    inlierMatches=matchResult.getInlierMatches();
    if (inlierMatches.getWs().length > 0) {
      if (renderScale != 1.0) {
        scalePoints(inlierMatches.getPs(),renderScale);
        scalePoints(inlierMatches.getQs(),renderScale);
      }
      matchList.add(new CanvasMatches(p.getGroupId(),p.getId(),q.getGroupId(),q.getId(),inlierMatches));
    }
  }
  log.info("String_Node_Str",matchList.size(),pairCount,dataCache.stats());
  return matchList.iterator();
}
Program: 25552
Project: 25552
Buggy source:
/** 
 * Constructs an ordered pair.
 * @param oneId      one canvas identifier.
 * @param anotherId  another canvas identifier.
 * @throws IllegalArgumentException if both identifiers are the same.
 */
public OrderedCanvasIdPair(final CanvasId oneId,final CanvasId anotherId) throws IllegalArgumentException {
  final int comparisonResult=oneId.compareTo(anotherId);
  if (comparisonResult < 0) {
    this.p=oneId;
    this.q=anotherId;
  }
 else   if (comparisonResult > 0) {
    this.p=anotherId;
    this.q=oneId;
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + oneId + "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Constructs an ordered pair.
 * @param oneId      one canvas identifier.
 * @param anotherId  another canvas identifier.
 * @throws IllegalArgumentException if both identifiers are the same.
 */
public OrderedCanvasIdPair(@Nonnull final CanvasId oneId,@Nonnull final CanvasId anotherId) throws IllegalArgumentException {
  final int comparisonResult=oneId.compareTo(anotherId);
  if (comparisonResult < 0) {
    this.p=oneId;
    this.q=anotherId;
  }
 else   if (comparisonResult > 0) {
    this.p=anotherId;
    this.q=oneId;
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + oneId + "String_Node_Str");
  }
}
Program: 25553
Project: 25553
Buggy source:
@Path("String_Node_Str") @GET @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value="String_Node_Str",notes="String_Node_Str") @ApiResponses(value={@ApiResponse(code=404,message="String_Node_Str")}) public RenderParameters getRenderParameters(@PathParam("String_Node_Str") final String owner,@PathParam("String_Node_Str") final String project,@PathParam("String_Node_Str") final String stack,@PathParam("String_Node_Str") final String tileId,@QueryParam("String_Node_Str") final Double scale,@QueryParam("String_Node_Str") final Boolean filter,@QueryParam("String_Node_Str") final Boolean binaryMask){
  LOG.info("String_Node_Str",owner,project,stack,tileId,scale,filter,binaryMask);
  RenderParameters parameters=null;
  try {
    final TileSpec tileSpec=getTileSpec(owner,project,stack,tileId,true);
    tileSpec.flattenTransforms();
    final StackId stackId=new StackId(owner,project,stack);
    final StackMetaData stackMetaData=getStackMetaData(stackId);
    parameters=new RenderParameters(null,tileSpec.getMinX(),tileSpec.getMinY(),tileSpec.getWidth(),tileSpec.getHeight(),scale);
    parameters.setDoFilter(filter);
    parameters.setBinaryMask(binaryMask);
    parameters.addTileSpec(tileSpec);
    parameters.setMipmapPathBuilder(stackMetaData.getCurrentMipmapPathBuilder());
  }
 catch (  final Throwable t) {
    RenderServiceUtil.throwServiceException(t);
  }
  return parameters;
}

Fixed version (ground truth):
@Path("String_Node_Str") @GET @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value="String_Node_Str",notes="String_Node_Str") @ApiResponses(value={@ApiResponse(code=404,message="String_Node_Str")}) public RenderParameters getRenderParameters(@PathParam("String_Node_Str") final String owner,@PathParam("String_Node_Str") final String project,@PathParam("String_Node_Str") final String stack,@PathParam("String_Node_Str") final String tileId,@QueryParam("String_Node_Str") final Double scale,@QueryParam("String_Node_Str") final Boolean filter,@QueryParam("String_Node_Str") final Boolean binaryMask){
  LOG.info("String_Node_Str",owner,project,stack,tileId,scale,filter,binaryMask);
  RenderParameters parameters=null;
  try {
    final TileSpec tileSpec=getTileSpec(owner,project,stack,tileId,true);
    tileSpec.flattenTransforms();
    final StackId stackId=new StackId(owner,project,stack);
    final StackMetaData stackMetaData=getStackMetaData(stackId);
    parameters=new RenderParameters(null,tileSpec.getMinX(),tileSpec.getMinY(),(int)(tileSpec.getMaxX() - tileSpec.getMinX()),(int)(tileSpec.getMaxY() - tileSpec.getMinY()),scale);
    parameters.setDoFilter(filter);
    parameters.setBinaryMask(binaryMask);
    parameters.addTileSpec(tileSpec);
    parameters.setMipmapPathBuilder(stackMetaData.getCurrentMipmapPathBuilder());
  }
 catch (  final Throwable t) {
    RenderServiceUtil.throwServiceException(t);
  }
  return parameters;
}
Program: 25554
Project: 25554
Buggy source:
private List<TileSpec> getTileSpecsForCoordinates(final List<TileCoordinates> coordinatesList,final ResolvedTileSpecCollection tiles){
  if ((coordinatesList == null) || (coordinatesList.size() == 0)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  String tileId;
  TileSpec tileSpec;
  final List<TileSpec> tileSpecList=new ArrayList<>();
  for (  final TileCoordinates coordinates : coordinatesList) {
    tileId=coordinates.getTileId();
    if (tileId != null) {
      tileSpec=tiles.getTileSpec(tileId);
      if (tileSpec != null) {
        tileSpecList.add(tileSpec);
      }
    }
  }
  if (tileSpecList.size() == 0) {
    throw new IllegalArgumentException("String_Node_Str" + z + "String_Node_Str"+ stack+ "String_Node_Str"+ coordinatesList.get(0));
  }
  return tileSpecList;
}

Fixed version (ground truth):
private List<TileSpec> getTileSpecsForCoordinates(final List<TileCoordinates> coordinatesList,final ResolvedTileSpecCollection tiles){
  if ((coordinatesList == null) || (coordinatesList.size() == 0)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  String tileId;
  TileSpec tileSpec;
  final List<TileSpec> tileSpecList=new ArrayList<>();
  for (  final TileCoordinates coordinates : coordinatesList) {
    tileId=coordinates.getTileId();
    if (tileId != null) {
      tileSpec=tiles.getTileSpec(tileId);
      if (tileSpec != null) {
        tileSpecList.add(tileSpec);
      }
    }
  }
  if (tileSpecList.size() == 0) {
    throw new IllegalArgumentException("String_Node_Str" + z + "String_Node_Str"+ stack+ "String_Node_Str"+ Arrays.toString(coordinatesList.get(0).getWorld()));
  }
  return tileSpecList;
}
Program: 25555
Project: 25555
Buggy source:
/** 
 * @param pointMatchList  list of point matches to convert.
 * @return the specified point match list in {@link Matches} form.
 */
public static Matches convertPointMatchListToMatches(final List<PointMatch> pointMatchList){
  final Matches matches;
  final int pointMatchCount=pointMatchList.size();
  if (pointMatchCount > 0) {
    PointMatch pointMatch=pointMatchList.get(0);
    Point p1=pointMatch.getP1();
    double[] local1=p1.getL();
    final int dimensionCount=local1.length;
    final double p[][]=new double[dimensionCount][pointMatchCount];
    final double q[][]=new double[dimensionCount][pointMatchCount];
    final double w[]=new double[pointMatchCount];
    Point p2;
    double[] local2;
    for (int i=0; i < pointMatchCount; i++) {
      pointMatch=pointMatchList.get(i);
      p1=pointMatch.getP1();
      local1=p1.getL();
      p2=pointMatch.getP2();
      local2=p2.getL();
      for (int j=0; j < dimensionCount; j++) {
        p[j][i]=local1[j];
        q[j][i]=local2[j];
      }
      w[i]=pointMatch.getWeight();
    }
    matches=new Matches(p,q,w);
  }
 else {
    matches=new Matches(new double[0][0],new double[0][0],new double[0]);
  }
  return matches;
}

Fixed version (ground truth):
/** 
 * @param pointMatchList  list of point matches to convert.
 * @return the specified point match list in {@link Matches} form.
 */
public static Matches convertPointMatchListToMatches(final List<PointMatch> pointMatchList){
  final Matches matches;
  final int pointMatchCount=pointMatchList.size();
  if (pointMatchCount > 0) {
    PointMatch pointMatch=pointMatchList.get(0);
    Point p1=pointMatch.getP1();
    double[] local1=p1.getL();
    final int dimensionCount=local1.length;
    final double p[][]=new double[dimensionCount][pointMatchCount];
    final double q[][]=new double[dimensionCount][pointMatchCount];
    final double w[]=new double[pointMatchCount];
    Point p2;
    double[] local2;
    for (int i=0; i < pointMatchCount; i++) {
      pointMatch=pointMatchList.get(i);
      p1=pointMatch.getP1();
      local1=p1.getL();
      p2=pointMatch.getP2();
      local2=p2.getL();
      for (int j=0; j < dimensionCount; j++) {
        p[j][i]=local1[j];
        q[j][i]=local2[j];
      }
      w[i]=pointMatch.getWeight();
    }
    matches=new Matches(p,q,w);
  }
 else {
    matches=new Matches(new double[1][0],new double[1][0],new double[0]);
  }
  return matches;
}
Program: 25556
Project: 25556
Buggy source:
private void setDbCollectionName() throws IllegalArgumentException {
  dbCollectionName=owner + FIELD_SEPARATOR + name;
  if (dbCollectionName.length() > MAX_COLLECTION_NAME_LENGTH) {
    throw new IllegalArgumentException("String_Node_Str" + this.dbCollectionName + "String_Node_Str"+ MAX_COLLECTION_NAME_LENGTH+ "String_Node_Str"+ "String_Node_Str");
  }
}

Fixed version (ground truth):
private void setDbCollectionName() throws IllegalArgumentException {
  dbCollectionName=COLLECTION_NAME_UTIL.getName(owner,name);
}
Program: 25557
Project: 25557
Buggy source:
public MatchCollectionId(final String owner,final String name) throws IllegalArgumentException {
  validateValue("String_Node_Str",VALID_NAME,owner);
  validateValue("String_Node_Str",VALID_NAME,name);
  this.owner=owner;
  this.name=name;
  setDbCollectionName();
}

Fixed version (ground truth):
public MatchCollectionId(final String owner,final String name) throws IllegalArgumentException {
  COLLECTION_NAME_UTIL.validateValue("String_Node_Str",owner);
  COLLECTION_NAME_UTIL.validateValue("String_Node_Str",name);
  this.owner=owner;
  this.name=name;
  setDbCollectionName();
}
Program: 25558
Project: 25558
Buggy source:
public static MatchCollectionId fromDbCollectionName(final String dbCollectionName) throws IllegalArgumentException {
  final int separatorIndex=dbCollectionName.indexOf(FIELD_SEPARATOR);
  final int nameIndex=separatorIndex + FIELD_SEPARATOR.length();
  if ((separatorIndex < 1) || (dbCollectionName.length() <= nameIndex)) {
    throw new IllegalArgumentException("String_Node_Str" + dbCollectionName + "String_Node_Str");
  }
  final String owner=dbCollectionName.substring(0,separatorIndex);
  final String name=dbCollectionName.substring(nameIndex);
  return new MatchCollectionId(owner,name);
}

Fixed version (ground truth):
public static MatchCollectionId fromDbCollectionName(final String dbCollectionName) throws IllegalArgumentException {
  final String[] fields=COLLECTION_NAME_UTIL.getFields(dbCollectionName);
  if (fields.length != 2) {
    throw new IllegalArgumentException("String_Node_Str" + dbCollectionName + "String_Node_Str");
  }
  return new MatchCollectionId(fields[0],fields[1]);
}
Program: 25559
Project: 25559
Buggy source:
private String getCollectionName(final String suffix){
  return getScopePrefix() + suffix;
}

Fixed version (ground truth):
private String getCollectionName(final String suffix){
  return COLLECTION_NAME_UTIL.getName(owner,project,stack,suffix);
}
Program: 25560
Project: 25560
Buggy source:
public StackId(final String owner,final String project,final String stack) throws IllegalArgumentException {
  validateValue("String_Node_Str",VALID_NAME,owner);
  validateValue("String_Node_Str",VALID_NAME,project);
  validateValue("String_Node_Str",VALID_NAME,stack);
  setScopePrefix(owner,project,stack);
  this.owner=owner;
  this.project=project;
  this.stack=stack;
}

Fixed version (ground truth):
public StackId(final String owner,final String project,final String stack) throws IllegalArgumentException {
  COLLECTION_NAME_UTIL.validateValue("String_Node_Str",owner);
  COLLECTION_NAME_UTIL.validateValue("String_Node_Str",project);
  COLLECTION_NAME_UTIL.validateValue("String_Node_Str",stack);
  this.owner=owner;
  this.project=project;
  this.stack=stack;
  getTransformCollectionName();
}
Program: 25561
Project: 25561
Buggy source:
public static List<Color> buildColorList(final int maxLabels){
  if (maxLabels == 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final double squareRoot=Math.sqrt(maxLabels);
  final int maxValue=255;
  if (squareRoot > maxValue) {
    throw new IllegalArgumentException("String_Node_Str" + maxLabels + "String_Node_Str");
  }
  int step=(int)(maxValue / squareRoot);
  if (step > 1) {
    step=step - 1;
  }
  final List<Color> colorList=new ArrayList<>(maxLabels);
  for (int green=0; ((green < maxValue) && (colorList.size() < maxLabels)); green+=step) {
    for (int blue=0; ((blue < maxValue) && (colorList.size() < maxLabels)); blue+=step) {
      if (green != blue) {
        colorList.add(new Color(0,green,blue));
      }
    }
  }
  if (colorList.size() < maxLabels) {
    throw new IllegalStateException("String_Node_Str" + maxLabels + "String_Node_Str");
  }
  Collections.shuffle(colorList);
  return colorList;
}

Fixed version (ground truth):
public static List<Color> buildColorList(final int maxLabels){
  if (maxLabels == 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final double squareRoot=Math.sqrt(maxLabels);
  final int maxValue=255;
  if (squareRoot > maxValue) {
    throw new IllegalArgumentException("String_Node_Str" + maxLabels + "String_Node_Str");
  }
  int step=(int)(maxValue / squareRoot);
  if (step > 30) {
    step=30;
  }
 else   if (step > 1) {
    step=step - 1;
  }
  final List<Color> colorList=new ArrayList<>(maxLabels);
  for (int green=0; ((green < maxValue) && (colorList.size() < maxLabels)); green+=step) {
    for (int blue=0; ((blue < maxValue) && (colorList.size() < maxLabels)); blue+=step) {
      if (green != blue) {
        colorList.add(new Color(0,green,blue));
      }
    }
  }
  if (colorList.size() < maxLabels) {
    throw new IllegalStateException("String_Node_Str" + colorList.size() + "String_Node_Str"+ maxLabels+ "String_Node_Str"+ step);
  }
  Collections.shuffle(colorList);
  return colorList;
}
Program: 25562
Project: 25562
Buggy source:
/** 
 * Constructs a cache instance using the specified parameters.
 * @param maximumNumberOfCachedPixels         the maximum number of pixels to maintain in the cache.This should roughly correlate to the maximum amount of memory for the cache.
 * @param recordStats                         if true, useful tuning stats like cache hits and loads will bemaintained (presumably at some nominal overhead cost); otherwise stats are not maintained.
 * @param cacheOriginalsForDownSampledImages  if true, when down sampled images are requested their sourceimages will also be cached (presumably improving the speed of future down sampling to a different level); otherwise only the down sampled result images are cached.
 * @param width                                standard width for all loaded tiles.
 * @param height                               standard height for all loaded tiles.
 * @param maxLabels                            maximum number of distinct label colors (tiles) needed.
 */
public LabelImageProcessorCache(long maximumNumberOfCachedPixels,boolean recordStats,boolean cacheOriginalsForDownSampledImages,int width,int height,int maxLabels){
  super(maximumNumberOfCachedPixels,recordStats,cacheOriginalsForDownSampledImages);
  this.width=width;
  this.height=height;
  this.labelIndex=-1;
  this.colors=buildColorList(maxLabels);
  this.urlToColor=new HashMap<>((int)(maxLabels * 1.4));
}

Fixed version (ground truth):
/** 
 * Constructs a cache instance using the specified parameters.
 * @param maximumNumberOfCachedPixels         the maximum number of pixels to maintain in the cache.This should roughly correlate to the maximum amount of memory for the cache.
 * @param recordStats                         if true, useful tuning stats like cache hits and loads will bemaintained (presumably at some nominal overhead cost); otherwise stats are not maintained.
 * @param cacheOriginalsForDownSampledImages  if true, when down sampled images are requested their sourceimages will also be cached (presumably improving the speed of future down sampling to a different level); otherwise only the down sampled result images are cached.
 * @param width                                standard width for all loaded tiles.
 * @param height                               standard height for all loaded tiles.
 * @param maxLabels                            maximum number of distinct label colors (tiles) needed.
 */
public LabelImageProcessorCache(final long maximumNumberOfCachedPixels,final boolean recordStats,final boolean cacheOriginalsForDownSampledImages,final int width,final int height,final int maxLabels){
  super(maximumNumberOfCachedPixels,recordStats,cacheOriginalsForDownSampledImages);
  this.width=width;
  this.height=height;
  this.labelIndex=-1;
  this.colors=buildColorList(maxLabels);
  this.urlToColor=new HashMap<>((int)(maxLabels * 1.4));
}
Program: 25564
Project: 25564
Buggy source:
@Test public void testMipmapGenerator() throws Exception {
  BoxMipmapGenerator boxMipmapGenerator=new BoxMipmapGenerator(z,false,Utils.PNG_FORMAT,boxWidth,boxHeight,boxDirectory,0,0,lastRow,0,lastColumn,false);
  for (int row=1; row < 3; row++) {
    for (int column=2; column < 4; column++) {
      boxMipmapGenerator.addSource(row,column,new File(boxDirectory,"String_Node_Str" + z + "String_Node_Str"+ row+ "String_Node_Str"+ column+ "String_Node_Str"));
    }
  }
  boxMipmapGenerator=validateNextLevel(boxMipmapGenerator,new int[][]{{0,1},{1,1}});
  boxMipmapGenerator=validateNextLevel(boxMipmapGenerator,new int[][]{{0,0}});
  final Path overviewDirPath=Paths.get(boxDirectory.getAbsolutePath(),"String_Node_Str");
  final File overviewFile=new File(overviewDirPath.toFile(),z + "String_Node_Str").getAbsoluteFile();
  final boolean isOverviewGenerated=boxMipmapGenerator.generateOverview(overviewWidth,layerBounds,overviewFile);
  filesAndDirectoriesToDelete.add(overviewFile);
  Assert.assertTrue("String_Node_Str",isOverviewGenerated);
  Assert.assertNotNull("String_Node_Str" + overviewFile + "String_Node_Str"+ boxMipmapGenerator.getSourceLevel(),overviewFile);
  Assert.assertTrue("String_Node_Str" + overviewFile + "String_Node_Str"+ boxMipmapGenerator.getSourceLevel()+ "String_Node_Str",overviewFile.exists());
  filesAndDirectoriesToDelete.add(overviewFile.getParentFile());
}

Fixed version (ground truth):
@Test public void testMipmapGenerator() throws Exception {
  BoxMipmapGenerator boxMipmapGenerator=new BoxMipmapGenerator(z,false,Utils.PNG_FORMAT,boxWidth,boxHeight,boxDirectory,0,0,lastRow,0,lastColumn,false);
  for (int row=1; row < 3; row++) {
    for (int column=2; column < 4; column++) {
      boxMipmapGenerator.addSource(row,column,new File(boxDirectory,"String_Node_Str" + z + "String_Node_Str"+ row+ "String_Node_Str"+ column+ "String_Node_Str"));
    }
  }
  boxMipmapGenerator=validateNextLevel(boxMipmapGenerator,new int[][]{{0,1},{1,1}});
  boxMipmapGenerator=validateNextLevel(boxMipmapGenerator,new int[][]{{0,0}});
  final Path overviewDirPath=Paths.get(boxDirectory.getAbsolutePath(),"String_Node_Str");
  final File overviewFile=new File(overviewDirPath.toFile(),z + "String_Node_Str").getAbsoluteFile();
  final boolean isOverviewGenerated=boxMipmapGenerator.generateOverview(overviewWidth,stackBounds,overviewFile);
  filesAndDirectoriesToDelete.add(overviewFile);
  Assert.assertTrue("String_Node_Str",isOverviewGenerated);
  Assert.assertNotNull("String_Node_Str" + overviewFile + "String_Node_Str"+ boxMipmapGenerator.getSourceLevel(),overviewFile);
  Assert.assertTrue("String_Node_Str" + overviewFile + "String_Node_Str"+ boxMipmapGenerator.getSourceLevel()+ "String_Node_Str",overviewFile.exists());
  filesAndDirectoriesToDelete.add(overviewFile.getParentFile());
}
Program: 25565
Project: 25565
Buggy source:
@Before public void setup() throws Exception {
  this.boxDirectory=new File("String_Node_Str");
  this.z=11;
  this.boxWidth=148;
  this.boxHeight=148;
  this.lastRow=3;
  this.lastColumn=3;
  this.overviewWidth=80;
  final double layerMaxX=((lastColumn + 1) * boxWidth) - 1;
  final double layerMaxY=((lastRow + 1) * boxHeight) - 1;
  this.layerBounds=new Bounds(0.0,0.0,layerMaxX,layerMaxY);
  filesAndDirectoriesToDelete=new ArrayList<>();
}

Fixed version (ground truth):
@Before public void setup() throws Exception {
  this.boxDirectory=new File("String_Node_Str");
  this.z=11;
  this.boxWidth=148;
  this.boxHeight=148;
  this.lastRow=3;
  this.lastColumn=3;
  this.overviewWidth=80;
  final double layerMaxX=((lastColumn + 1) * boxWidth) - 1;
  final double layerMaxY=((lastRow + 1) * boxHeight) - 1;
  this.stackBounds=new Bounds(0.0,0.0,layerMaxX,layerMaxY);
  filesAndDirectoriesToDelete=new ArrayList<>();
}
Program: 25568
Project: 25568
Buggy source:
private void validateValue(final String context,final Pattern pattern,final String value) throws IllegalArgumentException {
  final Matcher m=pattern.matcher(value);
  if (!m.matches()) {
    throw new IllegalArgumentException("String_Node_Str" + context + "String_Node_Str"+ value+ "String_Node_Str");
  }
}

Fixed version (ground truth):
private void validateValue(final String context,final Pattern pattern,final String value) throws IllegalArgumentException {
  final Matcher m=pattern.matcher(value);
  if (!m.matches()) {
    throw new IllegalArgumentException("String_Node_Str" + context + "String_Node_Str"+ value+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
  }
}
Program: 25569
Project: 25569
Buggy source:
@Test public void testSaveToFile() throws Exception {
  final int numberOfRows=5;
  final int numberOfColumns=6;
  final IGridPaths iGridPaths=new IGridPaths(numberOfRows,numberOfColumns);
  for (int row=2; row < 4; row++) {
    for (int column=1; column < 4; column++) {
      iGridPaths.addImage(new File("String_Node_Str" + row + "String_Node_Str"+ column+ "String_Node_Str"),row,column);
    }
  }
  final File parentDirectory=new File("String_Node_Str").getAbsoluteFile();
  final Double z=(double)new Date().getTime();
  final File emptyFile=new File("String_Node_Str");
  file=iGridPaths.saveToFile(parentDirectory,z,emptyFile);
  final List<String> iGridLines=Files.readAllLines(file.toPath(),Charset.defaultCharset());
  final int expectedLineCount=numberOfRows * numberOfColumns + 2;
  Assert.assertEquals("String_Node_Str",expectedLineCount,iGridLines.size());
}

Fixed version (ground truth):
@Test public void testSaveToFile() throws Exception {
  final int numberOfRows=5;
  final int numberOfColumns=6;
  final IGridPaths iGridPaths=new IGridPaths(numberOfRows,numberOfColumns);
  for (int row=2; row < 4; row++) {
    for (int column=1; column < 4; column++) {
      iGridPaths.addImage(new File("String_Node_Str" + row + "String_Node_Str"+ column+ "String_Node_Str"),row,column);
    }
  }
  validateSave(iGridPaths,numberOfRows,numberOfColumns);
}
Program: 25570
Project: 25570
Buggy source:
/** 
 * Checks if a location is inside a given polygon at the target side or not.
 * @param pm
 * @param t
 * @return
 */
static public boolean isInTargetTriangle(final double[][] pq,final double[] t){
}

Fixed version (ground truth):
/** 
 * Checks whether a location is inside a given triangle at the target side or not.
 * @param pq triangle vertices
 * @param t reference coordinate
 * @return
 */
final static public boolean isInTargetTriangle(final double[][] pq,final double[] t){
}
Program: 25571
Project: 25571
Buggy source:
/** 
 * Update all affine transformations that would have been affected by a given   {@link PointMatch Vertex}.
 * @param p
 */
public void updateAffines(){
  for (  final Pair<AffineModel2D,double[][]> apq : av) {
    final double[][] p=new double[][]{apq.b[0],apq.b[1]};
    final double[][] q=new double[][]{apq.b[2],apq.b[3]};
    try {
      apq.a.fit(p,q,unitWeights);
    }
 catch (    final NotEnoughDataPointsException e) {
      e.printStackTrace();
    }
catch (    final IllDefinedDataPointsException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
/** 
 * Update all affine transformations.
 */
public void updateAffines(){
  for (  final Pair<AffineModel2D,double[][]> apq : av) {
    final double[][] p=new double[][]{apq.b[0],apq.b[1]};
    final double[][] q=new double[][]{apq.b[2],apq.b[3]};
    try {
      apq.a.fit(p,q,unitWeights);
    }
 catch (    final NotEnoughDataPointsException e) {
      e.printStackTrace();
    }
catch (    final IllDefinedDataPointsException e) {
      e.printStackTrace();
    }
  }
}
Program: 25572
Project: 25572
Buggy source:
/** 
 * @param pq PointMatches [{p<sub>x</sub>, p<sub>y</sub>, q<sub>x</sub>, q<sub>y</sub><literal>}]
 * @param min x = min[0], y = min[1]
 * @param max x = max[0], y = max[1]
 */
final static public void calculateTargetBoundingBox(final double[][] pq,final double[] min,final double[] max){
  min[0]=pq[2][0];
  min[1]=pq[3][0];
  max[0]=pq[2][0];
  max[1]=pq[3][0];
  for (int i=1; i < pq[0].length; ++i) {
    if (pq[2][i] < min[0])     min[0]=pq[2][i];
 else     if (pq[2][i] > max[0])     max[0]=pq[2][i];
    if (pq[3][i] < min[1])     min[1]=pq[3][i];
 else     if (pq[3][i] > max[1])     max[1]=pq[3][i];
  }
}

Fixed version (ground truth):
/** 
 * @param pq PointMatches [{p<sub>x</sub>, p<sub>y</sub>, q<sub>x</sub>, q<sub>y</sub><literal>}]
 * @param min x = min[0], y = min[1]
 * @param max x = max[0], y = max[1]
 */
final static public void calculateTargetBoundingBox(final double[][] pq,final double[] min,final double[] max){
  calculateBoundingBox(pq[2],pq[3],min,max);
}
Program: 25573
Project: 25573
Buggy source:
/** 
 * Checks if a location is inside a given polygon at the source side or not.
 * @param pm
 * @param t
 * @return
 */
final static public boolean isInSourceTriangle(final double[][] pq,final double[] t){
}

Fixed version (ground truth):
/** 
 * Checks whether a location is inside a given triangle at the target side or not.
 * @param pq triangle vertices
 * @param t reference coordinate
 * @return
 */
final static public boolean isInSourceTriangle(final double[][] pq,final double[] t){
}
Program: 25574
Project: 25574
Buggy source:
final static protected void mapTriangle(final Pair<AffineModel2D,double[][]> ai,final ImageProcessor source,final ImageProcessor sourceMask,final ImageProcessor target,final ImageProcessor targetMask,final ByteProcessor targetOutside){
  final int w=target.getWidth() - 1;
  final int h=target.getHeight() - 1;
  final double[][] pq=ai.b;
  final double[] min=new double[2];
  final double[] max=new double[2];
  RenderTransformMesh.calculateTargetBoundingBox(pq,min,max);
  final int minX=Math.max(0,Util.roundPos(min[0]));
  final int minY=Math.max(0,Util.roundPos(min[1]));
  final int maxX=Math.min(w,Util.roundPos(max[0]));
  final int maxY=Math.min(h,Util.roundPos(max[1]));
  final double[] t=new double[2];
  for (int y=minY; y <= maxY; ++y) {
    for (int x=minX; x <= maxX; ++x) {
      if (RenderTransformMesh.isInTargetTriangle(pq,t)) {
        t[0]=x;
        t[1]=y;
        try {
          ai.a.applyInverseInPlace(t);
        }
 catch (        final Exception e) {
          continue;
        }
        target.set(x,y,source.getPixel((int)(t[0] + 0.5f),(int)(t[1] + 0.5f)));
        targetOutside.set(x,y,0xff);
        targetMask.set(x,y,sourceMask.getPixel((int)(t[0] + 0.5f),(int)(t[1] + 0.5f)));
      }
    }
  }
}

Fixed version (ground truth):
final static protected void mapTriangle(final Pair<AffineModel2D,double[][]> ai,final ImageProcessor source,final ImageProcessor sourceMask,final ImageProcessor target,final ImageProcessor targetMask,final ByteProcessor targetOutside){
  final int w=target.getWidth() - 1;
  final int h=target.getHeight() - 1;
  final double[][] pq=ai.b;
  final double[] min=new double[2];
  final double[] max=new double[2];
  RenderTransformMesh.calculateTargetBoundingBox(pq,min,max);
  final int minX=Math.max(0,Util.roundPos(min[0]));
  final int minY=Math.max(0,Util.roundPos(min[1]));
  final int maxX=Math.min(w,Util.roundPos(max[0]));
  final int maxY=Math.min(h,Util.roundPos(max[1]));
  final double[] t=new double[2];
  for (int y=minY; y <= maxY; ++y) {
    for (int x=minX; x <= maxX; ++x) {
      if (RenderTransformMesh.isInTargetTriangle(pq,x,y)) {
        t[0]=x;
        t[1]=y;
        try {
          ai.a.applyInverseInPlace(t);
        }
 catch (        final Exception e) {
          continue;
        }
        target.set(x,y,source.getPixel((int)(t[0] + 0.5f),(int)(t[1] + 0.5f)));
        targetOutside.set(x,y,0xff);
        targetMask.set(x,y,sourceMask.getPixel((int)(t[0] + 0.5f),(int)(t[1] + 0.5f)));
      }
    }
  }
}
Program: 25575
Project: 25575
Buggy source:
final static protected void mapTriangleInterpolated(final Pair<AffineModel2D,double[][]> ai,final ImageProcessor source,final ImageProcessor sourceMask,final ImageProcessor target,final ImageProcessor targetMask,final ByteProcessor targetOutside){
  final int w=target.getWidth() - 1;
  final int h=target.getHeight() - 1;
  final double[][] pq=ai.b;
  final double[] min=new double[2];
  final double[] max=new double[2];
  RenderTransformMesh.calculateTargetBoundingBox(pq,min,max);
  final int minX=Math.max(0,Util.roundPos(min[0]));
  final int minY=Math.max(0,Util.roundPos(min[1]));
  final int maxX=Math.min(w,Util.roundPos(max[0]));
  final int maxY=Math.min(h,Util.roundPos(max[1]));
  final double[] t=new double[2];
  for (int y=minY; y <= maxY; ++y) {
    for (int x=minX; x <= maxX; ++x) {
      if (RenderTransformMesh.isInTargetTriangle(pq,t)) {
        t[0]=x;
        t[1]=y;
        try {
          ai.a.applyInverseInPlace(t);
        }
 catch (        final Exception e) {
          continue;
        }
        target.set(x,y,source.getPixelInterpolated(t[0],t[1]));
        targetOutside.set(x,y,0xff);
        targetMask.set(x,y,sourceMask.getPixelInterpolated(t[0],t[1]));
      }
    }
  }
}

Fixed version (ground truth):
final static protected void mapTriangleInterpolated(final Pair<AffineModel2D,double[][]> ai,final ImageProcessor source,final ImageProcessor sourceMask,final ImageProcessor target,final ImageProcessor targetMask,final ByteProcessor targetOutside){
  final int w=target.getWidth() - 1;
  final int h=target.getHeight() - 1;
  final double[][] pq=ai.b;
  final double[] min=new double[2];
  final double[] max=new double[2];
  RenderTransformMesh.calculateTargetBoundingBox(pq,min,max);
  final int minX=Math.max(0,Util.roundPos(min[0]));
  final int minY=Math.max(0,Util.roundPos(min[1]));
  final int maxX=Math.min(w,Util.roundPos(max[0]));
  final int maxY=Math.min(h,Util.roundPos(max[1]));
  final double[] t=new double[2];
  for (int y=minY; y <= maxY; ++y) {
    for (int x=minX; x <= maxX; ++x) {
      if (RenderTransformMesh.isInTargetTriangle(pq,x,y)) {
        t[0]=x;
        t[1]=y;
        try {
          ai.a.applyInverseInPlace(t);
        }
 catch (        final Exception e) {
          continue;
        }
        target.set(x,y,source.getPixelInterpolated(t[0],t[1]));
        targetOutside.set(x,y,0xff);
        targetMask.set(x,y,sourceMask.getPixelInterpolated(t[0],t[1]));
      }
    }
  }
}
Program: 25576
Project: 25576
Buggy source:
final static protected void mapShortAlphaTriangle(final Pair<AffineModel2D,double[][]> ai,final ShortProcessor source,final ByteProcessor alpha,final ShortProcessor target){
  final int w=target.getWidth() - 1;
  final int h=target.getHeight() - 1;
  final double[][] pq=ai.b;
  final double[] min=new double[2];
  final double[] max=new double[2];
  RenderTransformMesh.calculateTargetBoundingBox(pq,min,max);
  final int minX=Math.max(0,Util.roundPos(min[0]));
  final int minY=Math.max(0,Util.roundPos(min[1]));
  final int maxX=Math.min(w,Util.roundPos(max[0]));
  final int maxY=Math.min(h,Util.roundPos(max[1]));
  final double[] t=new double[2];
  for (int y=minY; y <= maxY; ++y) {
    for (int x=minX; x <= maxX; ++x) {
      if (RenderTransformMesh.isInTargetTriangle(pq,t)) {
        t[0]=x;
        t[1]=y;
        try {
          ai.a.applyInverseInPlace(t);
        }
 catch (        final Exception e) {
          continue;
        }
        final int is=source.getPixelInterpolated(t[0],t[1]);
        final int it=target.get(x,y);
        final double f=alpha.getPixelInterpolated(t[0],t[1]) / 255.0;
        final double v=it + f * (is - it);
        target.set(x,y,(int)Math.max(0,Math.min(65535,Math.round(v))));
      }
    }
  }
}

Fixed version (ground truth):
final static protected void mapShortAlphaTriangle(final Pair<AffineModel2D,double[][]> ai,final ShortProcessor source,final ByteProcessor alpha,final ShortProcessor target){
  final int w=target.getWidth() - 1;
  final int h=target.getHeight() - 1;
  final double[][] pq=ai.b;
  final double[] min=new double[2];
  final double[] max=new double[2];
  RenderTransformMesh.calculateTargetBoundingBox(pq,min,max);
  final int minX=Math.max(0,Util.roundPos(min[0]));
  final int minY=Math.max(0,Util.roundPos(min[1]));
  final int maxX=Math.min(w,Util.roundPos(max[0]));
  final int maxY=Math.min(h,Util.roundPos(max[1]));
  final double[] t=new double[2];
  for (int y=minY; y <= maxY; ++y) {
    for (int x=minX; x <= maxX; ++x) {
      if (RenderTransformMesh.isInTargetTriangle(pq,x,y)) {
        t[0]=x;
        t[1]=y;
        try {
          ai.a.applyInverseInPlace(t);
        }
 catch (        final Exception e) {
          continue;
        }
        final int is=source.getPixelInterpolated(t[0],t[1]);
        final int it=target.get(x,y);
        final double f=alpha.getPixelInterpolated(t[0],t[1]) / 255.0;
        final double v=it + f * (is - it);
        target.set(x,y,(int)Math.max(0,Math.min(65535,Math.round(v))));
      }
    }
  }
}
Program: 25577
Project: 25577
Buggy source:
@BeforeClass public static void before() throws Exception {
  stackId=new StackId("String_Node_Str","String_Node_Str","String_Node_Str");
  embeddedMongoDb=new EmbeddedMongoDb(RenderDao.RENDER_DB_NAME);
  dao=new RenderDao(embeddedMongoDb.getMongoClient());
  embeddedMongoDb.importCollection(RenderDao.STACK_META_DATA_COLLECTION_NAME,new File("String_Node_Str"),true,false,true);
  embeddedMongoDb.importCollection(stackId.getTileCollectionName(),new File("String_Node_Str"),true,false,true);
  embeddedMongoDb.importCollection(stackId.getTransformCollectionName(),new File("String_Node_Str"),true,false,true);
}

Fixed version (ground truth):
@BeforeClass public static void before() throws Exception {
  stackId=new StackId("String_Node_Str","String_Node_Str","String_Node_Str");
  embeddedMongoDb=new EmbeddedMongoDb(RenderDao.RENDER_DB_NAME);
  dao=new RenderDao(embeddedMongoDb.getMongoClient());
}
Program: 25579
Project: 25579
Buggy source:
public void cloneStack(final StackId fromStackId,final StackId toStackId) throws IllegalArgumentException {
  validateRequiredParameter("String_Node_Str",fromStackId);
  validateRequiredParameter("String_Node_Str",toStackId);
  final DBCollection fromTransformCollection=getTransformCollection(fromStackId);
  final DBCollection toTransformCollection=getTransformCollection(toStackId);
  cloneCollection(fromTransformCollection,toTransformCollection);
  final DBCollection fromTileCollection=getTileCollection(fromStackId);
  final DBCollection toTileCollection=getTileCollection(toStackId);
  cloneCollection(fromTileCollection,toTileCollection);
}

Fixed version (ground truth):
public void cloneStack(final StackId fromStackId,final StackId toStackId) throws IllegalArgumentException, IllegalStateException {
  validateRequiredParameter("String_Node_Str",fromStackId);
  validateRequiredParameter("String_Node_Str",toStackId);
  final DBCollection fromTransformCollection=getTransformCollection(fromStackId);
  final DBCollection toTransformCollection=getTransformCollection(toStackId);
  cloneCollection(fromTransformCollection,toTransformCollection);
  final DBCollection fromTileCollection=getTileCollection(fromStackId);
  final DBCollection toTileCollection=getTileCollection(toStackId);
  cloneCollection(fromTileCollection,toTileCollection);
}
Program: 25580
Project: 25580
Buggy source:
private void resolveTileSpecs() throws IllegalStateException {
  for (  TileSpec tileSpec : tileIdToSpecMap.values()) {
    resolveTileSpec(tileSpec);
  }
}

Fixed version (ground truth):
public void resolveTileSpecs() throws IllegalStateException {
  for (  TileSpec tileSpec : tileIdToSpecMap.values()) {
    resolveTileSpec(tileSpec);
  }
}
Program: 25586
Project: 25586
Buggy source:
public void markProcessedTilesForRow(final int rowY,final RenderParameters renderParameters){
  final int rowMaxY=rowY + boxHeight;
  if (rowY > currentRowY) {
    currentRowY=rowY;
    currentRowPartialTileSum=0;
  }
  for (  TileSpec tileSpec : renderParameters.getTileSpecs()) {
    if (tileSpec.getMaxY() <= rowMaxY) {
      processedTileIds.add(tileSpec.getTileId());
    }
 else {
      currentRowPartialTileSum+=(rowMaxY - tileSpec.getMinY()) / (double)tileSpec.getHeight();
    }
  }
}

Fixed version (ground truth):
public void markProcessedTilesForRow(final int rowY,final RenderParameters renderParameters){
  final int rowMaxY=rowY + boxHeight;
  if (rowY > currentRowY) {
    currentRowY=rowY;
    currentRowPartialTileSum=0;
  }
  if (renderParameters != null) {
    for (    TileSpec tileSpec : renderParameters.getTileSpecs()) {
      if (tileSpec.getMaxY() <= rowMaxY) {
        processedTileIds.add(tileSpec.getTileId());
      }
 else {
        currentRowPartialTileSum+=(rowMaxY - tileSpec.getMinY()) / (double)tileSpec.getHeight();
      }
    }
  }
}
Program: 25588
Project: 25588
Buggy source:
/** 
 * The core method used to load image processor instances that is called when cache misses occur.
 * @param url               url for the image.
 * @param downSampleLevels  number of levels to further down sample the image.
 * @param isMask            indicates whether this image is a mask.
 * @return a newly loaded image processor to be cached.
 * @throws IllegalArgumentException if the image cannot be loaded.
 */
protected ImageProcessor loadImageProcessor(final String url,final int downSampleLevels,final boolean isMask) throws IllegalArgumentException {
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str",url,downSampleLevels);
  }
  ImageProcessor imageProcessor=null;
  if (downSampleLevels > 0) {
    imageProcessor=cache.getIfPresent(new CacheKey(url,0,isMask));
  }
  if (imageProcessor == null) {
    final ImagePlus imagePlus=opener.openURL(url);
    if (imagePlus == null) {
      throw new IllegalArgumentException("String_Node_Str" + url + "String_Node_Str");
    }
    imageProcessor=imagePlus.getProcessor();
    if (cacheOriginalsForDownSampledImages && (downSampleLevels > 0)) {
      if (LOG.isDebugEnabled()) {
        LOG.debug("String_Node_Str",url);
      }
      cache.put(new CacheKey(url,0,isMask),imageProcessor);
    }
  }
  if (downSampleLevels > 0) {
    imageProcessor=Downsampler.downsampleImageProcessor(imageProcessor,downSampleLevels);
  }
  return imageProcessor;
}

Fixed version (ground truth):
/** 
 * The core method used to load image processor instances that is called when cache misses occur.
 * @param url               url for the image.
 * @param downSampleLevels  number of levels to further down sample the image.
 * @param isMask            indicates whether this image is a mask.
 * @return a newly loaded image processor to be cached.
 * @throws IllegalArgumentException if the image cannot be loaded.
 */
protected ImageProcessor loadImageProcessor(final String url,final int downSampleLevels,final boolean isMask) throws IllegalArgumentException {
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str",url,downSampleLevels);
  }
  ImageProcessor imageProcessor=null;
  if (downSampleLevels > 0) {
    imageProcessor=cache.getIfPresent(new CacheKey(url,0,isMask));
  }
  if (imageProcessor == null) {
    final Opener opener=new Opener();
    opener.setSilentMode(true);
    final ImagePlus imagePlus=opener.openURL(url);
    if (imagePlus == null) {
      throw new IllegalArgumentException("String_Node_Str" + url + "String_Node_Str");
    }
    imageProcessor=imagePlus.getProcessor();
    if (cacheOriginalsForDownSampledImages && (downSampleLevels > 0)) {
      if (LOG.isDebugEnabled()) {
        LOG.debug("String_Node_Str",url);
      }
      cache.put(new CacheKey(url,0,isMask),imageProcessor);
    }
  }
  if (downSampleLevels > 0) {
    imageProcessor=Downsampler.downsampleImageProcessor(imageProcessor,downSampleLevels);
  }
  return imageProcessor;
}
Program: 25589
Project: 25589
Buggy source:
private static float[] centerToWorld(final TileSpec tileSpec){
  final float[] center=new float[]{(float)tileSpec.getWidth() / 2.0f,(float)tileSpec.getHeight() / 2.0f};
  final CoordinateTransformList<CoordinateTransform> ctl=tileSpec.createTransformList();
  ctl.applyInPlace(center);
  return center;
}

Fixed version (ground truth):
private static float[] centerToWorld(final TileSpec tileSpec){
  final float[] center=new float[]{(float)tileSpec.getWidth() / 2.0f,(float)tileSpec.getHeight() / 2.0f};
  final CoordinateTransformList<CoordinateTransform> ctl=tileSpec.getTransformList();
  ctl.applyInPlace(center);
  return center;
}
Program: 25591
Project: 25591
Buggy source:
/** 
 * @return a coordinate transform mesh built from this spec's list of transforms.
 * @throws IllegalStateException if width or height have not been defined for this tile.
 */
public CoordinateTransformMesh getCoordinateTransformMesh() throws IllegalStateException {
  if (!hasWidthAndHeightDefined()) {
    throw new IllegalStateException("String_Node_Str");
  }
  final CoordinateTransformList<CoordinateTransform> ctList=createTransformList();
  return new CoordinateTransformMesh(ctList,getNumberOfTrianglesCoveringWidth(),width.floatValue(),height.floatValue());
}

Fixed version (ground truth):
/** 
 * @return a coordinate transform mesh built from this spec's list of transforms.
 * @throws IllegalStateException if width or height have not been defined for this tile.
 */
public CoordinateTransformMesh getCoordinateTransformMesh() throws IllegalStateException {
  if (!hasWidthAndHeightDefined()) {
    throw new IllegalStateException("String_Node_Str");
  }
  final CoordinateTransformList<CoordinateTransform> ctList=getTransformList();
  return new CoordinateTransformMesh(ctList,getNumberOfTrianglesCoveringWidth(),width.floatValue(),height.floatValue());
}