nus-yam/ex-repair huggingface dataset:
Program: 13364
Project: 13364
Buggy source:
@Override protected void onDraw(Canvas canvas){
  if (mapTiles == null) {
    return;
  }
  for (  MapTileDrawable mapTile : mapTiles) {
    final int hash=mapTile.tileHashCode();
    if (mapTileBitmaps.containsKey(hash)) {
      final Bitmap bitmap=mapTileBitmaps.get(hash);
      if (bitmap != null) {
        final float x=(float)mapTile.getScreenX();
        final float y=(float)mapTile.getScreenY();
        canvas.drawBitmap(bitmap,x,y,paint);
        canvas.drawRect(x,y,x + bitmap.getWidth() - 1,y + bitmap.getHeight() - 1,rectPaint);
      }
 else {
        Log.d(TAG,"String_Node_Str" + mapTile);
      }
    }
 else {
      Log.d(TAG,"String_Node_Str" + mapTile);
    }
  }
}

Fixed version (ground truth):
@Override protected void onDraw(final Canvas canvas){
  if (mapTiles == null) {
    return;
  }
  for (  MapTileDrawable mapTile : mapTiles) {
    final int hash=mapTile.tileHashCode();
    final float x=(float)mapTile.getScreenX();
    final float y=(float)mapTile.getScreenY();
    final Bitmap bitmap=mapTileBitmaps.get(hash);
    if (bitmap != null) {
      canvas.drawBitmap(bitmap,x,y,paint);
    }
 else {
      Log.d(TAG,"String_Node_Str" + mapTile);
    }
    canvas.drawRect(x,y,x + (float)mapTile.getSize() - 1,y + (float)mapTile.getSize() - 1,rectPaint);
    canvas.drawText(mapTile.getX() + "String_Node_Str" + mapTile.getY(),x + 3,y + 20,textPaint);
  }
}
Program: 13366
Project: 13366
Buggy source:
private void maskBitmap(Bitmap bitmap,float xRatio,float yRatio,float widthRatio,float heightRatio){
  Canvas canvas=new Canvas(bitmap);
  Paint blackFill=new Paint();
  blackFill.setColor(Color.BLACK);
  blackFill.setStyle(Paint.Style.FILL);
  float left=bitmap.getWidth() * xRatio;
  float top=bitmap.getHeight() * xRatio;
  float right=bitmap.getWidth() * (xRatio + widthRatio);
  float bottom=bitmap.getWidth() * (yRatio + heightRatio);
  canvas.drawRect(left,top,right,bottom,blackFill);
}

Fixed version (ground truth):
private void maskBitmap(Bitmap bitmap,float xRatio,float yRatio,float widthRatio,float heightRatio){
  Canvas canvas=new Canvas(bitmap);
  Paint blackFill=new Paint();
  blackFill.setColor(Color.BLACK);
  blackFill.setStyle(Paint.Style.FILL);
  float left=bitmap.getWidth() * xRatio;
  float top=bitmap.getHeight() * yRatio;
  float right=bitmap.getWidth() * (xRatio + widthRatio);
  float bottom=bitmap.getHeight() * (yRatio + heightRatio);
  canvas.drawRect(left,top,right,bottom,blackFill);
}
Program: 13367
Project: 13367
Buggy source:
public void onMaskButtonClick(View view){
  Log.d(DEBUG_TAG,"String_Node_Str");
  FastBitmapDrawable drawable=(FastBitmapDrawable)destinationImageView.getDrawable();
  Bitmap bitmap=drawable.getBitmap();
  maskBitmap(bitmap,0.1f,0.1f,0.8f,0.2f);
  destinationImageView.setImageBitmap(bitmap);
}

Fixed version (ground truth):
public void onMaskButtonClick(View view){
  Log.d(DEBUG_TAG,"String_Node_Str");
  FastBitmapDrawable drawable=(FastBitmapDrawable)destinationImageView.getDrawable();
  Bitmap bitmap=drawable.getBitmap();
  maskBitmap(bitmap,0.03f,0.02f,0.45f,0.32f);
  destinationImageView.setImageBitmap(bitmap);
}
Program: 13368
Project: 13368
Buggy source:
public Mat transform(Mat src,MatOfPoint2f corners){
  Size size=getRectangleSize(corners);
  Mat result=Mat.zeros(size,src.type());
  MatOfPoint2f sortedCorners=sortCorners(corners);
  MatOfPoint2f imageOutline=getOutline(result);
  Mat transformation=Imgproc.getPerspectiveTransform(sortedCorners,imageOutline);
  Imgproc.warpPerspective(src,result,transformation,size);
  return result;
}

Fixed version (ground truth):
public Mat transform(Mat src,MatOfPoint2f corners){
  MatOfPoint2f sortedCorners=sortCorners(corners);
  Size size=getRectangleSize(sortedCorners);
  Log.d(DEBUG_TAG,String.format("String_Node_Str",size.width,size.height));
  Mat result=Mat.zeros(size,src.type());
  MatOfPoint2f imageOutline=getOutline(result);
  Mat transformation=Imgproc.getPerspectiveTransform(sortedCorners,imageOutline);
  Imgproc.warpPerspective(src,result,transformation,size);
  return result;
}
Program: 13369
Project: 13369
Buggy source:
private MatOfPoint2f sortCorners(MatOfPoint2f corners){
  Point center=getMassCenter(corners);
  List<Point> points=corners.toList();
  List<Point> topPoints=new ArrayList<Point>();
  List<Point> bottomPoints=new ArrayList<Point>();
  for (  Point point : points) {
    if (point.y < center.y) {
      topPoints.add(point);
    }
 else {
      bottomPoints.add(point);
    }
  }
  Point topLeft=topPoints.get(0).x > topPoints.get(1).x ? topPoints.get(1) : topPoints.get(0);
  Point topRight=topPoints.get(0).x > topPoints.get(1).x ? topPoints.get(0) : topPoints.get(1);
  Point bottomLeft=bottomPoints.get(0).x > bottomPoints.get(1).x ? bottomPoints.get(1) : bottomPoints.get(0);
  Point bottomRight=bottomPoints.get(0).x > bottomPoints.get(1).x ? bottomPoints.get(0) : bottomPoints.get(1);
  MatOfPoint2f result=new MatOfPoint2f();
  Point[] sortedPoints={topLeft,topRight,bottomRight,bottomLeft};
  result.fromArray(sortedPoints);
  return result;
}

Fixed version (ground truth):
private MatOfPoint2f sortCorners(MatOfPoint2f corners){
  Point center=getMassCenter(corners);
  List<Point> points=corners.toList();
  List<Point> topPoints=new ArrayList<Point>();
  List<Point> bottomPoints=new ArrayList<Point>();
  for (  Point point : points) {
    if (point.y < center.y) {
      topPoints.add(point);
    }
 else {
      bottomPoints.add(point);
    }
  }
  Point topLeft=topPoints.get(0).x > topPoints.get(1).x ? topPoints.get(1) : topPoints.get(0);
  Point topRight=topPoints.get(0).x > topPoints.get(1).x ? topPoints.get(0) : topPoints.get(1);
  Point bottomLeft=bottomPoints.get(0).x > bottomPoints.get(1).x ? bottomPoints.get(1) : bottomPoints.get(0);
  Point bottomRight=bottomPoints.get(0).x > bottomPoints.get(1).x ? bottomPoints.get(0) : bottomPoints.get(1);
  Log.d(DEBUG_TAG,String.format("String_Node_Str"));
  Log.d(DEBUG_TAG,String.format("String_Node_Str",topLeft.x,topLeft.y));
  Log.d(DEBUG_TAG,String.format("String_Node_Str",topRight.x,topRight.y));
  Log.d(DEBUG_TAG,String.format("String_Node_Str",bottomLeft.x,bottomLeft.y));
  Log.d(DEBUG_TAG,String.format("String_Node_Str",bottomRight.x,bottomRight.y));
  MatOfPoint2f result=new MatOfPoint2f();
  Point[] sortedPoints={topLeft,topRight,bottomRight,bottomLeft};
  result.fromArray(sortedPoints);
  return result;
}
Program: 13370
Project: 13370
Buggy source:
/** 
 * Execute request. Exception will be automatically catched and translated into an instance of {HttpClientException}.
 * @return Http response.
 * @throws Exception If an error occurred.
 */
protected abstract HttpResponse doExecute() throws Exception ;

Fixed version (ground truth):
/** 
 * Execute request. Exception will be automatically translated into an instance of   {@link HttpClientException}.
 * @return Http response.
 * @throws Exception If an error occurred.
 */
protected abstract HttpResponse doExecute() throws Exception ;
Program: 13371
Project: 13371
Buggy source:
/** 
 * Add request body: <ul> <li>Set request body if   {@link #body} is defined.</li><li>Add form parmeters ( {@link #formParams}) otherwise if it is not empty.</li> </ul>
 * @param builder The pending HTTP request.
 * @see RequestBuilder#addFormParam(String,String)
 * @see RequestBuilder#setBody(String)
 */
private void handleBody(RequestBuilder builder){
  if (!hasBody()) {
    return;
  }
  if (body != null) {
    handleRequestBody(builder);
  }
 else {
    handleFormParameters(builder);
  }
}

Fixed version (ground truth):
/** 
 * Add request body: <ul> <li>Set request body if   {@link #body} is defined.</li><li>Add form parameters ( {@link #formParams}) otherwise if it is not empty.</li> </ul>
 * @param builder The pending HTTP request.
 * @see RequestBuilder#addFormParam(String,String)
 * @see RequestBuilder#setBody(String)
 */
private void handleBody(RequestBuilder builder){
  if (!hasBody()) {
    return;
  }
  if (body != null) {
    handleRequestBody(builder);
  }
 else {
    handleFormParameters(builder);
  }
}
Program: 13372
Project: 13372
Buggy source:
/** 
 * Translates a string into   {@code application/x-www-form-urlencoded}format using UTF-8 encoding.
 * @param value The string value.
 * @return The encoded vallue.
 * @throws Utf8EncodingException If, for some weird reason, UTF-8 encoding is not supported.
 */
public static String urlEncode(String value){
  try {
    return URLEncoder.encode(value,StandardCharsets.UTF_8.displayName());
  }
 catch (  UnsupportedEncodingException ex) {
    throw new Utf8EncodingException(ex);
  }
}

Fixed version (ground truth):
/** 
 * Translates a string into   {@code application/x-www-form-urlencoded}format using UTF-8 encoding.
 * @param value The string value.
 * @return The encoded value.
 * @throws Utf8EncodingException If, for some weird reason, UTF-8 encoding is not supported.
 */
public static String urlEncode(String value){
  try {
    return URLEncoder.encode(value,StandardCharsets.UTF_8.displayName());
  }
 catch (  UnsupportedEncodingException ex) {
    throw new Utf8EncodingException(ex);
  }
}
Program: 13373
Project: 13373
Buggy source:
/** 
 * Get servlet context used within container. If container is not a servlet container, this method should return null.
 * @return Servlet Cntext from container.
 */
ServletContext getServletContext();

Fixed version (ground truth):
/** 
 * Get servlet context used within container. If container is not a servlet container, this method should return null.
 * @return Servlet Context from container.
 */
ServletContext getServletContext();
Program: 13374
Project: 13374
Buggy source:
private void HttpScheme(String protocol,int defaultPort){
  this.protocol=protocol;
  this.defaultPort=defaultPort;
}

Fixed version (ground truth):
void HttpScheme(String protocol,int defaultPort){
  this.protocol=protocol;
  this.defaultPort=defaultPort;
}
Program: 13375
Project: 13375
Buggy source:
/** 
 * Create exception with error message.
 * @param message Error message.
 */
HttpClientException(String message){
  super(message);
}

Fixed version (ground truth):
/** 
 * Create exception.
 * @param throwable Original exception.
 */
public HttpClientException(Throwable throwable){
  super(throwable);
}
Program: 13376
Project: 13376
Buggy source:
/** 
 * Create rule.
 * @param configuration Jetty Configuration.
 */
public JettyServerRule(EmbeddedJettyConfiguration configuration){
  super(new EmbeddedJetty(configuration));
}

Fixed version (ground truth):
/** 
 * Create rule.
 * @param configuration Jetty Configuration.
 */
public JettyServerRule(EmbeddedJettyConfiguration configuration){
  this(new EmbeddedJetty(configuration));
}
Program: 13377
Project: 13377
Buggy source:
/** 
 * Create rule.
 * @param configuration Tomcat Configuration.
 */
public TomcatServerRule(EmbeddedTomcatConfiguration configuration){
  super(new EmbeddedTomcat(configuration));
}

Fixed version (ground truth):
/** 
 * Create rule.
 * @param configuration Tomcat Configuration.
 */
public TomcatServerRule(EmbeddedTomcatConfiguration configuration){
  this(new EmbeddedTomcat(configuration));
}
Program: 13378
Project: 13378
Buggy source:
/** 
 * Map input values to output values.
 * @param inputs Input values.
 * @param < T > Type of input values.
 * @param < U > Type of output values.
 * @return Output values.
 */
public static <T,U>List<U> map(Collection<T> inputs,Mapper<T,U> mapper){
  if (inputs == null) {
    return null;
  }
  List<U> outputs=new ArrayList<>(inputs.size());
  for (  T input : inputs) {
    outputs.add(mapper.apply(input));
  }
  return outputs;
}

Fixed version (ground truth):
/** 
 * Map input values to output values.
 * @param inputs Input values.
 * @param mapper Mapper function.
 * @param < T > Type of input values.
 * @param < U > Type of output values.
 * @return Output values.
 */
public static <T,U>List<U> map(Collection<T> inputs,Mapper<T,U> mapper){
  if (inputs == null) {
    return null;
  }
  List<U> outputs=new ArrayList<>(inputs.size());
  for (  T input : inputs) {
    outputs.add(mapper.apply(input));
  }
  return outputs;
}
Program: 13379
Project: 13379
Buggy source:
/** 
 * Create the exception.
 * @param cause Original cause.
 */
public UrlException(String scheme,String host,int port,String path,Throwable cause){
  super(cause);
  this.scheme=scheme;
  this.host=host;
  this.port=port;
  this.path=path;
}

Fixed version (ground truth):
/** 
 * Create the exception.
 * @param scheme HTTP Url scheme.
 * @param host HTTP Url host.
 * @param port HTTP Url port.
 * @param path HTTP Url path.
 * @param cause Original cause.
 */
public UrlException(String scheme,String host,int port,String path,Throwable cause){
  super(cause);
  this.scheme=scheme;
  this.host=host;
  this.port=port;
  this.path=path;
}
Program: 13380
Project: 13380
Buggy source:
/** 
 * Create the exception with a default error message.
 */
public Utf8EncodingException(Throwable ex){
  super("String_Node_Str",ex);
}

Fixed version (ground truth):
/** 
 * Create the exception with original cause and a default error message.
 * @param ex Original cause.
 */
public Utf8EncodingException(Throwable ex){
  super("String_Node_Str",ex);
}
Program: 13381
Project: 13381
Buggy source:
/** 
 * Create new handler.
 * @param configuration Server configuration.
 * @return Handler.
 * @throws NullPointerException if configuration is null.
 */
public static <T extends AbstractConfiguration>ConfigurationAnnotationHandler newConfigurationAnnotationHandler(T configuration){
  return new ConfigurationAnnotationHandler(notNull(configuration,"String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Create new handler.
 * @param configuration Server configuration.
 * @param < T > Type of configuration instance.
 * @return Handler.
 * @throws NullPointerException if configuration is null.
 */
public static <T extends AbstractConfiguration>ConfigurationAnnotationHandler newConfigurationAnnotationHandler(T configuration){
  return new ConfigurationAnnotationHandler(notNull(configuration,"String_Node_Str"));
}
Program: 13382
Project: 13382
Buggy source:
/** 
 * Execute request. Exception will be automatically catched and translated into an instance of {HttpClientException}.
 * @return Http response.
 * @throws Exception
 */
protected abstract HttpResponse doExecute() throws Exception ;

Fixed version (ground truth):
/** 
 * Execute request. Exception will be automatically catched and translated into an instance of {HttpClientException}.
 * @return Http response.
 * @throws Exception If an error occurred.
 */
protected abstract HttpResponse doExecute() throws Exception ;
Program: 13383
Project: 13383
Buggy source:
/** 
 * Append new boolean value.
 * @param name The name of the field.
 * @param values The collection of values.
 * @return The current builder (for chaining).
 */
public <T>ToStringBuilder append(String name,Iterable<T> values){
  StringBuilder pending=new StringBuilder().append(OPEN_ARRAY);
  boolean firstItem=true;
  for (  T value : values) {
    if (!firstItem) {
      pending.append(SEPARATOR);
    }
    pending.append(formatValue(value));
    firstItem=false;
  }
  return appendFormattedValue(name,pending.append(CLOSE_ARRAY).toString());
}

Fixed version (ground truth):
/** 
 * Append new boolean value.
 * @param name The name of the field.
 * @param values The collection of values.
 * @param < T > Type of elements in collection.
 * @return The current builder (for chaining).
 */
public <T>ToStringBuilder append(String name,Iterable<T> values){
  StringBuilder pending=new StringBuilder().append(OPEN_ARRAY);
  boolean firstItem=true;
  for (  T value : values) {
    if (!firstItem) {
      pending.append(SEPARATOR);
    }
    pending.append(formatValue(value));
    firstItem=false;
  }
  return appendFormattedValue(name,pending.append(CLOSE_ARRAY).toString());
}
Program: 13384
Project: 13384
Buggy source:
/** 
 * Create new rules.
 * @param target Target class (i.e tested class).
 * @param handlers List of handlers.
 */
public HandlersRule(Object target,AnnotationHandler handler,AnnotationHandler... handlers){
  super(target);
  this.handlers=new LinkedList<>();
  this.handlers.add(notNull(handler,"String_Node_Str"));
  for (  AnnotationHandler h : handlers) {
    this.handlers.add(notNull(h,"String_Node_Str"));
  }
}

Fixed version (ground truth):
/** 
 * Create new rules.
 * @param target Target class (i.e tested class).
 * @param handler First handler (required).
 * @param handlers List of other (optional) handlers.
 */
public HandlersRule(Object target,AnnotationHandler handler,AnnotationHandler... handlers){
  super(target);
  this.handlers=new LinkedList<>();
  this.handlers.add(notNull(handler,"String_Node_Str"));
  for (  AnnotationHandler h : handlers) {
    this.handlers.add(notNull(h,"String_Node_Str"));
  }
}
Program: 13385
Project: 13385
Buggy source:
/** 
 * Create runner.
 * @param klass Running class.
 * @throws InitializationError
 */
public JunitServerRunner(Class<?> klass) throws InitializationError {
  super(klass);
  this.server=instantiate(klass);
  this.configuration=this.server.getConfiguration();
}

Fixed version (ground truth):
/** 
 * Create runner.
 * @param klass Running class.
 * @throws InitializationError If an error occurred while starting embedded server.
 */
public JunitServerRunner(Class<?> klass) throws InitializationError {
  super(klass);
  this.server=instantiate(klass);
  this.configuration=this.server.getConfiguration();
}
Program: 13386
Project: 13386
Buggy source:
/** 
 * Change parent classpath value.
 * @param classpath New webapp value.
 * @return this
 */
public T withParentClasspath(URL classpath,URL... others){
  Set<URL> classpathUrls=new HashSet<>();
  classpathUrls.add(classpath);
  Collections.addAll(classpathUrls,others);
  return withParentClasspath(classpathUrls);
}

Fixed version (ground truth):
/** 
 * Change parent classpath value.
 * @param classpath New webapp value.
 * @param others Other (optional) urls.
 * @return this
 */
public T withParentClasspath(URL classpath,URL... others){
  Set<URL> classpathUrls=new HashSet<>();
  classpathUrls.add(classpath);
  Collections.addAll(classpathUrls,others);
  return withParentClasspath(classpathUrls);
}
Program: 13387
Project: 13387
Buggy source:
@SubscribeEvent @SideOnly(Side.CLIENT) public void registerModels(ModelRegistryEvent event){
  ZettaIndustries.proxy.registermodel(wire,0);
}

Fixed version (ground truth):
@SubscribeEvent @SideOnly(Side.CLIENT) public void registerModels(ModelRegistryEvent event){
  ZettaIndustries.proxy.registermodel(wire,0);
  ZettaIndustries.proxy.registermodel(connectorItem,0);
}
Program: 13388
Project: 13388
Buggy source:
@SideOnly(Side.CLIENT) @Override public void clientSide(){
  ConnLoader.baseModels.put("String_Node_Str",new ResourceLocation("String_Node_Str"));
  ConnLoader.textureReplacements.put("String_Node_Str",ImmutableMap.of("String_Node_Str",ZettaIndustries.MODID + "String_Node_Str"));
  ZettaIndustries.proxy.registermodel(connectorItem,0);
}

Fixed version (ground truth):
@SideOnly(Side.CLIENT) @Override public void clientSide(){
  ConnLoader.baseModels.put("String_Node_Str",new ResourceLocation("String_Node_Str"));
  ConnLoader.textureReplacements.put("String_Node_Str",ImmutableMap.of("String_Node_Str",ZettaIndustries.MODID + "String_Node_Str"));
}
Program: 13389
Project: 13389
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack,World world,List list,ITooltipFlag flag){
  list.add(I18n.translateToLocal("String_Node_Str"));
  list.add(I18n.translateToLocal("String_Node_Str"));
  if (stack.getTagCompound() != null && stack.getTagCompound().hasKey("String_Node_Str")) {
    int[] link=stack.getTagCompound().getIntArray("String_Node_Str");
    if (link != null && link.length > 3)     list.add(I18n.translateToLocalFormatted("String_Node_Str",link[1],link[2],link[3],link[0]));
  }
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack,World world,List list,ITooltipFlag flag){
  list.add(I18n.translateToLocal("String_Node_Str"));
  list.add(I18n.translateToLocal("String_Node_Str"));
  if (stack.getTagCompound() != null && stack.getTagCompound().hasKey("String_Node_Str")) {
    int[] link=stack.getTagCompound().getIntArray("String_Node_Str");
    if (link != null && link.length > 3) {
      list.add(I18n.translateToLocalFormatted("String_Node_Str",link[1],link[2],link[3],link[0]));
    }
  }
}
Program: 13391
Project: 13391
Buggy source:
private void addRecipe(Item backpackT1,Item backpackT2,ItemStack crafting){
  RecipeManagers.carpenterManager.addRecipe(200,Fluids.WATER.getFluid(1000),null,new ItemStack(backpackT2),"String_Node_Str","String_Node_Str","String_Node_Str",'X',Items.DIAMOND,'W',PluginCore.items.craftingMaterial.getSilkWisp(),'T',backpackT1);
  GameRegistry.addShapedRecipe(new ItemStack(backpackT1),"String_Node_Str","String_Node_Str","String_Node_Str",'#',Blocks.WOOL,'X',Items.STRING,'V',crafting,'Y',Blocks.CHEST);
}

Fixed version (ground truth):
private void addRecipe(Item backpackT1,Item backpackT2,ItemStack crafting){
  RecipeManagers.carpenterManager.addRecipe(200,FluidRegistry.getFluidStack("String_Node_Str",1000),null,new ItemStack(backpackT2),"String_Node_Str","String_Node_Str","String_Node_Str",'X',Items.DIAMOND,'W',PluginCore.items.craftingMaterial.getSilkWisp(),'T',backpackT1);
  GameRegistry.addShapedRecipe(new ItemStack(backpackT1),"String_Node_Str","String_Node_Str","String_Node_Str",'#',Blocks.WOOL,'X',Items.STRING,'V',crafting,'Y',Blocks.CHEST);
}
Program: 13392
Project: 13392
Buggy source:
private Item addBackpack(BasicBackpack backpack,EnumBackpackType type){
  Item backpakItem=BackpackManager.backpackInterface.createBackpack(backpack,type);
  backpakItem.setCreativeTab(ZettaIndustries.instance.tabZettaIndustries);
  backpakItem.setRegistryName(backpack.getKey());
  ZettaIndustries.proxy.registermodel(GameRegistry.register(backpakItem),0);
  return backpakItem;
}

Fixed version (ground truth):
private Item addBackpack(BasicBackpack backpack,EnumBackpackType type){
  Item backpakItem=BackpackManager.backpackInterface.createBackpack(backpack.getUniqueName(),type);
  backpakItem.setCreativeTab(ZettaIndustries.instance.tabZettaIndustries);
  backpakItem.setRegistryName(backpack.getKey());
  ZettaIndustries.proxy.registermodel(GameRegistry.register(backpakItem),0);
  return backpakItem;
}
Program: 13393
Project: 13393
Buggy source:
@Override public boolean test(ItemStack itemstack){
  if (itemstack != null && itemstack.getItem() != null) {
    ResourceLocation rl=itemstack.getItem().getRegistryName();
    String name=null;
    System.out.println(rl.getResourceDomain());
    System.out.println(rl.getResourcePath());
    if (rl != null) {
      name=rl.getResourcePath();
    }
    if (name == null || name.isEmpty())     return false;
    for (    String names : this.names) {
      if (name.startsWith(names)) {
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean test(ItemStack itemstack){
  if (itemstack != null && itemstack.getItem() != null) {
    ResourceLocation rl=itemstack.getItem().getRegistryName();
    String name=null;
    System.out.println(rl.getResourceDomain());
    System.out.println(rl.getResourcePath());
    if (rl != null) {
      name=rl.getResourcePath();
    }
    if (name == null || name.isEmpty())     return false;
    for (    String names : getNames()) {
      if (name.startsWith(names)) {
        return true;
      }
    }
  }
  return false;
}
Program: 13394
Project: 13394
Buggy source:
@Override public boolean test(ItemStack itemstack){
  return true;
}

Fixed version (ground truth):
@Override public boolean test(ItemStack itemStack){
  return true;
}
Program: 13395
Project: 13395
Buggy source:
@Override protected void onImpact(MovingObjectPosition mop){
  if (!this.worldObj.isRemote && this.shootingEntity != null && this.shootingEntity instanceof EntityPlayer) {
    if (alredyHit) {
      return;
    }
 else {
      alredyHit=true;
    }
    EntityPlayer ep=(EntityPlayer)this.shootingEntity;
    int next=(ep.inventory.currentItem + 1) % 10;
    ItemStack toUse=ep.inventory.getStackInSlot(next);
    if (toUse != null && toUse.getItem() instanceof IWireCoil) {
      if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
        if (toUse.getItem().onItemUseFirst(toUse,ep,this.worldObj,mop.blockX,mop.blockY,mop.blockZ,mop.sideHit,(float)mop.hitVec.xCoord % 1,(float)mop.hitVec.yCoord % 1,(float)mop.hitVec.zCoord % 1)) {
          this.worldObj.playSoundAtEntity(ep,"String_Node_Str",.8F,1.2F / (this.rand.nextFloat() * .2F + .9F));
        }
      }
    }
    if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY) {
      mop.entityHit.attackEntityFrom(IEDamageSources.causeCasullDamage(this,shootingEntity),.5F);
    }
  }
}

Fixed version (ground truth):
@Override protected void onImpact(RayTraceResult mop){
  if (!this.worldObj.isRemote && this.shootingEntity != null && this.shootingEntity instanceof EntityPlayer) {
    if (alredyHit) {
      return;
    }
 else {
      alredyHit=true;
    }
    EntityPlayer ep=(EntityPlayer)this.shootingEntity;
    int next=(ep.inventory.currentItem + 1) % 10;
    ItemStack toUse=ep.inventory.getStackInSlot(next);
    if (toUse != null && toUse.getItem() instanceof IWireCoil) {
      if (mop.typeOfHit == RayTraceResult.Type.BLOCK) {
        if (toUse.getItem().onItemUseFirst(toUse,ep,this.worldObj,mop.getBlockPos(),mop.sideHit,(float)mop.hitVec.xCoord % 1,(float)mop.hitVec.yCoord % 1,(float)mop.hitVec.zCoord % 1)) {
          this.worldObj.playSoundAtEntity(ep,"String_Node_Str",.8F,1.2F / (this.rand.nextFloat() * .2F + .9F));
        }
      }
    }
    if (mop.typeOfHit == RayTraceResult.Type.ENTITY) {
      mop.entityHit.attackEntityFrom(IEDamageSources.causeCasullDamage(this,shootingEntity),.5F);
    }
  }
}
Program: 13397
Project: 13397
Buggy source:
@Override public void preInit(){
  blockNFCProgrammer=new BlockNFCProgrammer();
  blockNFCReader=new BlockNFCReader();
  itemCardNFC=new ItemCardNFC();
  itemPrivateCardNFC=new ItemPrivateCardNFC();
  GameRegistry.register(blockNFCReader);
  ZettaIndustries.proxy.registermodel(GameRegistry.register(new ItemBlock(blockNFCReader).setRegistryName(blockNFCReader.getRegistryName())),0);
  GameRegistry.register(blockNFCProgrammer);
  ZettaIndustries.proxy.registermodel(GameRegistry.register(new ItemBlock(blockNFCProgrammer).setRegistryName(blockNFCProgrammer.getRegistryName())),0);
  GameRegistry.registerTileEntity(TileEntityNFCReader.class,"String_Node_Str");
  GameRegistry.registerTileEntity(TileEntityNFCProgrammer.class,"String_Node_Str");
  ZettaIndustries.proxy.registermodel(GameRegistry.register(itemPrivateCardNFC),0);
  ZettaIndustries.proxy.registermodel(GameRegistry.register(itemCardNFC),0);
  ZIRegistry.registerProxy(this);
}

Fixed version (ground truth):
@Override public void preInit(){
  blockNFCProgrammer=new BlockNFCProgrammer();
  blockNFCReader=new BlockNFCReader();
  itemCardNFC=new ItemCardNFC();
  itemPrivateCardNFC=new ItemPrivateCardNFC();
  GameRegistry.register(blockNFCReader);
  ZettaIndustries.proxy.registermodel(GameRegistry.register(new ItemBlock(blockNFCReader).setRegistryName(blockNFCReader.getRegistryName())),0);
  GameRegistry.register(blockNFCProgrammer);
  ZettaIndustries.proxy.registermodel(GameRegistry.register(new ItemBlock(blockNFCProgrammer).setRegistryName(blockNFCProgrammer.getRegistryName())),0);
  GameRegistry.registerTileEntity(TileEntityNFCReader.class,"String_Node_Str");
  GameRegistry.registerTileEntity(TileEntityNFCProgrammer.class,"String_Node_Str");
  Item tempItem=GameRegistry.register(itemPrivateCardNFC);
  ZettaIndustries.proxy.registermodel(tempItem,0);
  ZettaIndustries.proxy.registermodel(tempItem,1,new ModelResourceLocation(ZettaIndustries.MODID + "String_Node_Str","String_Node_Str"));
  ZettaIndustries.proxy.registermodel(GameRegistry.register(itemCardNFC),0);
  smartCardItem=new SmartCardItem();
  smartCardTerminalItem=new SmartCardTerminalItem();
  smartCardTerminalBlock=new SmartCardTerminalBlock();
  ZettaIndustries.proxy.registermodel(GameRegistry.register(smartCardTerminalItem),0);
  ZettaIndustries.proxy.registermodel(GameRegistry.register(smartCardItem),0);
  Block temp=GameRegistry.register(smartCardTerminalBlock);
  ZettaIndustries.proxy.registermodel(GameRegistry.register(new ItemBlock(temp).setRegistryName(temp.getRegistryName())),0);
  GameRegistry.registerTileEntity(SmartCardTerminalTileEntity.class,"String_Node_Str");
  Driver.add((li.cil.oc.api.driver.Item)smartCardItem);
  Driver.add((li.cil.oc.api.driver.Item)smartCardTerminalItem);
  ZIRegistry.registerProxy(this);
}
Program: 13398
Project: 13398
Buggy source:
@SideOnly(Side.CLIENT) @Override public void clientSide(){
}

Fixed version (ground truth):
@SideOnly(Side.CLIENT) @Override public void clientSide(){
  ClientRegistry.bindTileEntitySpecialRenderer(SmartCardTerminalTileEntity.class,new SmartCardBlockTerminalRenderer());
  MinecraftForge.EVENT_BUS.register(new SmartCardRackRenderer());
}
Program: 13399
Project: 13399
Buggy source:
@Override public ActionResult<ItemStack> onItemRightClick(ItemStack itemStack,World world,EntityPlayer player,EnumHand hand){
  if (itemStack.getItem() instanceof ItemPrivateCardNFC && player.isSneaking() && getOwner(itemStack) == null) {
    setOwner(player.getName(),itemStack);
  }
  return ActionResult.newResult(EnumActionResult.SUCCESS,itemStack);
}

Fixed version (ground truth):
@Override public ActionResult<ItemStack> onItemRightClick(ItemStack itemStack,World world,EntityPlayer player,EnumHand hand){
  if (itemStack.getItem() instanceof ItemPrivateCardNFC && player.isSneaking() && getOwner(itemStack) == null) {
    setOwner(player.getName(),itemStack);
    itemStack.setItemDamage(1);
  }
  return ActionResult.newResult(EnumActionResult.SUCCESS,itemStack);
}
Program: 13401
Project: 13401
Buggy source:
@Override public Object getServerGuiElement(int id,TileEntity blockEntity,EntityPlayer player,World world,int x,int y,int z){
  if (blockEntity instanceof TileEntitySimpleDHD) {
    return new ContainerSimpleDHD((TileEntitySimpleDHD)blockEntity);
  }
  return null;
}

Fixed version (ground truth):
@Override public Object getServerGuiElement(int id,TileEntity blockEntity,EntityPlayer player,World world,int x,int y,int z){
  return null;
}
Program: 13402
Project: 13402
Buggy source:
@Override public void updateScreen(){
  address.updateCursorCounter();
}

Fixed version (ground truth):
@Override public void updateScreen(){
  super.updateScreen();
  address.updateCursorCounter();
}
Program: 13403
Project: 13403
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void initGui(){
  int centerh=width / 2;
  int centerv=height / 2;
  Keyboard.enableRepeatEvents(true);
  address=new GuiTextField(this.fontRendererObj,centerh - 75,centerv - 7,150,14);
  connect=new GuiButton(1,centerh - 75,centerv + 10,70,20,"String_Node_Str");
  disconnect=new GuiButton(2,centerh + 5,centerv + 10,70,20,"String_Node_Str");
  buttonList.add(connect);
  buttonList.add(disconnect);
  if (te != null && !te.getAddress().isEmpty()) {
    address.setText(te.getAddress());
  }
  super.initGui();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void initGui(){
  int centerh=width / 2;
  int centerv=height / 2;
  Keyboard.enableRepeatEvents(true);
  address=new GuiTextField(this.fontRendererObj,centerh - 75,centerv - 7,150,14);
  connect=new GuiButton(1,centerh - 75,centerv + 10,70,20,"String_Node_Str");
  disconnect=new GuiButton(2,centerh + 5,centerv + 10,70,20,"String_Node_Str");
  buttonList.add(connect);
  buttonList.add(disconnect);
  super.initGui();
}
Program: 13404
Project: 13404
Buggy source:
@Override public void drawScreen(int p_73863_1_,int p_73863_2_,float p_73863_3_){
  if (addressFocus != address.isFocused()) {
    updateText();
  }
  addressFocus=address.isFocused();
  address.drawTextBox();
  super.drawScreen(p_73863_1_,p_73863_2_,p_73863_3_);
}

Fixed version (ground truth):
@Override public void drawScreen(int p_73863_1_,int p_73863_2_,float p_73863_3_){
  address.drawTextBox();
  super.drawScreen(p_73863_1_,p_73863_2_,p_73863_3_);
}
Program: 13405
Project: 13405
Buggy source:
@Override protected void keyTyped(char eventCharacter,int eventKey){
  if (this.address.isFocused()) {
    if (eventKey == Keyboard.KEY_RETURN) {
      this.address.setFocused(false);
    }
 else {
      this.address.textboxKeyTyped(eventCharacter,eventKey);
    }
    return;
  }
  super.keyTyped(eventCharacter,eventKey);
}

Fixed version (ground truth):
@Override protected void keyTyped(char eventCharacter,int eventKey){
  if (!address.textboxKeyTyped(eventCharacter,eventKey)) {
    super.keyTyped(eventCharacter,eventKey);
  }
}
Program: 13406
Project: 13406
Buggy source:
@Override public void readFromNBT(NBTTagCompound nbt){
  super.readFromNBT(nbt);
  if (nbt.hasKey("String_Node_Str"))   address=nbt.getString("String_Node_Str");
}

Fixed version (ground truth):
@Override public void readFromNBT(NBTTagCompound nbt){
  super.readFromNBT(nbt);
  if (nbt.hasKey("String_Node_Str"))   address=nbt.getString("String_Node_Str");
  businterface.readFromNBT(nbt,"String_Node_Str");
}
Program: 13407
Project: 13407
Buggy source:
@Override public short getInterfaceAddress(){
  return 0x0000;
}

Fixed version (ground truth):
@Override public short getInterfaceAddress(){
  return 0x00;
}
Program: 13408
Project: 13408
Buggy source:
public void disconnect(){
  BusPacketLIP packet=new BusPacketLIP((short)0,(short)255);
  packet.set("String_Node_Str","String_Node_Str");
  packet.setMetadata(new BusPacketLIP.LIPMetadata(ZettaIndustries.MODID,network.getShortName(),null));
  packet.finish();
  network.handlePacket(packet);
  businterface.sendAllPackets();
}

Fixed version (ground truth):
public void disconnect(){
  BusPacketLIP packet=new BusPacketLIP((short)0,(short)255);
  packet.set("String_Node_Str","String_Node_Str");
  packet.setMetadata(new BusPacketLIP.LIPMetadata(ZettaIndustries.MODID,getShortName(),null));
  packet.finish();
  handlePacket(packet);
  businterface.sendAllPackets();
}
Program: 13409
Project: 13409
Buggy source:
@Override public void writeToNBT(NBTTagCompound nbt){
  super.writeToNBT(nbt);
  nbt.setString("String_Node_Str",address);
}

Fixed version (ground truth):
@Override public void writeToNBT(NBTTagCompound nbt){
  super.writeToNBT(nbt);
  nbt.setString("String_Node_Str",address);
  businterface.writeToNBT(nbt,"String_Node_Str");
}
Program: 13410
Project: 13410
Buggy source:
public void dial(){
  BusPacketLIP packet=new BusPacketLIP((short)0,(short)255);
  packet.set("String_Node_Str","String_Node_Str");
  packet.set("String_Node_Str",getAddress());
  packet.setMetadata(new BusPacketLIP.LIPMetadata(ZettaIndustries.MODID,network.getShortName(),null));
  packet.finish();
  network.handlePacket(packet);
  businterface.sendAllPackets();
}

Fixed version (ground truth):
public void dial(){
  BusPacketLIP packet=new BusPacketLIP((short)0,(short)255);
  packet.set("String_Node_Str","String_Node_Str");
  packet.set("String_Node_Str",getAddress());
  packet.setMetadata(new BusPacketLIP.LIPMetadata(ZettaIndustries.MODID,getShortName(),null));
  packet.finish();
  handlePacket(packet);
  businterface.sendAllPackets();
}
Program: 13411
Project: 13411
Buggy source:
@Callback public Object[] writeNFCData(Context contex,Arguments args){
  if (args.count() == 1 && args.checkString(0).length() <= 1024) {
    NFCData=args.checkString(0);
    worldObj.setBlockMetadataWithNotify(this.xCoord,this.yCoord,this.zCoord,1,2);
  }
 else {
    new Exception("String_Node_Str");
  }
  return null;
}

Fixed version (ground truth):
@Callback public Object[] writeNFCData(Context contex,Arguments args){
  if (args.count() == 1 && args.checkString(0).length() <= 2048) {
    NFCData=args.checkString(0);
    worldObj.setBlockMetadataWithNotify(this.xCoord,this.yCoord,this.zCoord,1,2);
  }
 else {
    return new Object[]{false,"String_Node_Str"};
  }
  return new Object[]{true};
}
Program: 13412
Project: 13412
Buggy source:
@Override protected void onImpact(MovingObjectPosition mop){
  if (!this.worldObj.isRemote && this.shootingEntity != null && this.shootingEntity instanceof EntityPlayer) {
    EntityPlayer ep=(EntityPlayer)this.shootingEntity;
    int next=(ep.inventory.currentItem + 1) % 10;
    ItemStack toUse=ep.inventory.getStackInSlot(next);
    if (toUse.getItem() instanceof ItemWireCoil) {
      if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
        if (toUse.getItem().onItemUseFirst(toUse,ep,this.worldObj,mop.blockX,mop.blockY,mop.blockZ,mop.sideHit,(float)mop.hitVec.xCoord % 1,(float)mop.hitVec.yCoord % 1,(float)mop.hitVec.zCoord % 1)) {
          this.worldObj.playSoundAtEntity(ep,"String_Node_Str",.8F,1.2F / (this.rand.nextFloat() * .2F + .9F));
        }
      }
    }
    if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY) {
      mop.entityHit.attackEntityFrom(IEDamageSources.causeCasullDamage(this,shootingEntity),.5F);
    }
  }
}

Fixed version (ground truth):
@Override protected void onImpact(MovingObjectPosition mop){
  if (!this.worldObj.isRemote && this.shootingEntity != null && this.shootingEntity instanceof EntityPlayer) {
    if (alredyHit) {
      return;
    }
 else {
      alredyHit=true;
    }
    EntityPlayer ep=(EntityPlayer)this.shootingEntity;
    int next=(ep.inventory.currentItem + 1) % 10;
    ItemStack toUse=ep.inventory.getStackInSlot(next);
    if (toUse != null && toUse.getItem() instanceof ItemWireCoil) {
      if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
        if (toUse.getItem().onItemUseFirst(toUse,ep,this.worldObj,mop.blockX,mop.blockY,mop.blockZ,mop.sideHit,(float)mop.hitVec.xCoord % 1,(float)mop.hitVec.yCoord % 1,(float)mop.hitVec.zCoord % 1)) {
          this.worldObj.playSoundAtEntity(ep,"String_Node_Str",.8F,1.2F / (this.rand.nextFloat() * .2F + .9F));
        }
      }
    }
    if (mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY) {
      mop.entityHit.attackEntityFrom(IEDamageSources.causeCasullDamage(this,shootingEntity),.5F);
    }
  }
}
Program: 13414
Project: 13414
Buggy source:
@Override public boolean process(String filename,String timestamp,Date dateTs,String headLine,String entry){
  if (dateTs == null) {
    dateTs=new Date(0);
  }
  if (headLine.contains(text) || entry.contains(text)) {
    Text text=new Text();
    text.text=headLine + (entry != null && entry.length() > 0 ? "String_Node_Str" + entry : "String_Node_Str");
    text.date=dateTs;
    text.filename=filename;
    texts.add(text);
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean process(String filename,String timestamp,Date dateTs,String headLine,String entry){
  if (dateTs == null) {
    dateTs=new Date(0);
  }
  if (headLine.contains(text) || entry.contains(text)) {
    Text text=new Text();
    text.text=headLine + (entry != null && entry.length() > 0 ? "String_Node_Str" + entry : "String_Node_Str");
    text.date=dateTs;
    text.timestamp=timestamp;
    text.filename=filename;
    texts.add(text);
  }
  return false;
}
Program: 13415
Project: 13415
Buggy source:
@Override public void printReport(PrintStream out){
synchronized (texts) {
    Collections.sort(texts);
    out.println("String_Node_Str" + text);
    out.println("String_Node_Str");
    for (    Text t : texts) {
      out.println("String_Node_Str" + t.filename + "String_Node_Str");
      out.println("String_Node_Str" + t.text);
    }
  }
}

Fixed version (ground truth):
@Override public void printReport(PrintStream out){
synchronized (texts) {
    Collections.sort(texts);
    out.println("String_Node_Str" + text);
    out.println("String_Node_Str");
    for (    Text t : texts) {
      out.println("String_Node_Str" + t.timestamp + "String_Node_Str"+ t.filename+ "String_Node_Str");
      out.println("String_Node_Str" + t.text + "String_Node_Str");
    }
  }
}
Program: 13416
Project: 13416
Buggy source:
public void fileReport(String outputDir){
  String filename=text.replaceAll("String_Node_Str","String_Node_Str");
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str" + text);
  sb.append("String_Node_Str");
  try {
    Files.write(Paths.get(outputDir,filename),sb.toString().getBytes("String_Node_Str"),StandardOpenOption.APPEND);
  }
 catch (  UnsupportedEncodingException e) {
  }
catch (  IOException e) {
    throw new RuntimeException(e);
  }
synchronized (texts) {
    for (    Text t : texts) {
      sb=new StringBuilder();
      sb.append("String_Node_Str" + t.filename + "String_Node_Str");
      sb.append("String_Node_Str" + t.text);
      try {
        Files.write(Paths.get(outputDir,filename),sb.toString().getBytes("String_Node_Str"),StandardOpenOption.APPEND);
      }
 catch (      UnsupportedEncodingException e) {
      }
catch (      IOException e) {
        throw new RuntimeException(e);
      }
    }
  }
}

Fixed version (ground truth):
public void fileReport(String outputDir){
  String filename=text.replaceAll("String_Node_Str","String_Node_Str") + "String_Node_Str";
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str" + text + "String_Node_Str");
  sb.append("String_Node_Str");
  try {
    Files.write(Paths.get(outputDir,filename),sb.toString().getBytes("String_Node_Str"),StandardOpenOption.CREATE);
  }
 catch (  UnsupportedEncodingException e) {
  }
catch (  IOException e) {
    throw new RuntimeException(e);
  }
synchronized (texts) {
    for (    Text t : texts) {
      sb=new StringBuilder();
      sb.append("String_Node_Str" + t.timestamp + "String_Node_Str"+ t.filename+ "String_Node_Str");
      sb.append("String_Node_Str" + t.text + "String_Node_Str");
      try {
        Files.write(Paths.get(outputDir,filename),sb.toString().getBytes("String_Node_Str"),StandardOpenOption.APPEND);
      }
 catch (      UnsupportedEncodingException e) {
      }
catch (      IOException e) {
        throw new RuntimeException(e);
      }
    }
  }
}
Program: 13417
Project: 13417
Buggy source:
/** 
 * @param masterSpreadName
 * @return
 * @throws Exception 
 */
public Spread addSpread(String masterSpreadName) throws Exception {
  Spread spread=new Spread();
  assignIdAndRegister(spread);
  spread.setParent(this);
  MasterSpread masterSpread=this.getMasterSpread(masterSpreadName);
  spread.setTransformationMatrix(this.spreads.size());
  this.spreads.add(spread);
  spread.setMasterSpread(masterSpread);
  this.addChild(spread);
  return spread;
}

Fixed version (ground truth):
/** 
 * @param masterSpreadName
 * @return
 * @throws Exception 
 */
public Spread addSpread(String masterSpreadName) throws Exception {
  Spread spread=newSpread(masterSpreadName);
  assignIdAndRegister(spread);
  spread.setParent(this);
  MasterSpread masterSpread=this.getMasterSpread(masterSpreadName);
  spread.setTransformationMatrix(this.spreads.size());
  this.spreads.add(spread);
  spread.setMasterSpread(masterSpread);
  this.addChild(spread);
  return spread;
}
Program: 13418
Project: 13418
Buggy source:
/** 
 * @param masterSpreadName
 * @return
 * @throws Exception 
 */
public Spread newSpread(String masterSpreadName) throws Exception {
  Spread newSpread=new Spread();
  assignIdAndRegister(newSpread);
  newSpread.setParent(this);
  this.spreads.add(newSpread);
  MasterSpread masterSpread=this.getMasterSpread(masterSpreadName);
  if (masterSpread == null) {
    logger.info("String_Node_Str" + masterSpreadName + "String_Node_Str");
    for (    String key : this.masterSpreads.keySet()) {
      logger.info("String_Node_Str" + key + "String_Node_Str");
    }
    throw new Exception("String_Node_Str" + masterSpreadName + "String_Node_Str");
  }
  newSpread.setMasterSpread(masterSpread);
  newSpread.setTransformationMatrix(this.spreads.size());
  this.addChild(newSpread);
  return newSpread;
}

Fixed version (ground truth):
/** 
 * @param masterSpreadName
 * @return
 * @throws Exception 
 */
public Spread newSpread(String masterSpreadName) throws Exception {
  Spread newSpread=new Spread();
  assignIdAndRegister(newSpread);
  newSpread.setParent(this);
  newSpread.setSpreadIndex(this.spreads.size());
  this.spreads.add(newSpread);
  MasterSpread masterSpread=this.getMasterSpread(masterSpreadName);
  if (masterSpread == null) {
    logger.info("String_Node_Str" + masterSpreadName + "String_Node_Str");
    for (    String key : this.masterSpreads.keySet()) {
      logger.info("String_Node_Str" + key + "String_Node_Str");
    }
    throw new Exception("String_Node_Str" + masterSpreadName + "String_Node_Str");
  }
  newSpread.setMasterSpread(masterSpread);
  newSpread.setTransformationMatrix(this.spreads.size());
  this.addChild(newSpread);
  return newSpread;
}
Program: 13419
Project: 13419
Buggy source:
@Override public void updatePropertyMap() throws Exception {
  super.updatePropertyMap();
  setProperty(InDesignDocument.PROP_PAGC,new InxLong32(pages.size()));
  if (pages.size() == 1) {
    setProperty("String_Node_Str",new InxLong32(0));
  }
 else {
    setProperty("String_Node_Str",new InxLong32(1));
  }
}

Fixed version (ground truth):
@Override public void updatePropertyMap() throws Exception {
  super.updatePropertyMap();
  setProperty(InDesignDocument.PROP_PAGC,new InxLong32(pages.size()));
  if (pages.size() == 1) {
    setProperty("String_Node_Str",new InxLong32(0));
  }
 else {
    setProperty("String_Node_Str",new InxLong32(1));
  }
  if (pages.size() > 0) {
    setProperty("String_Node_Str",new InxInteger(pages.size()));
  }
  if (!hasProperty("String_Node_Str")) {
    setProperty("String_Node_Str",new InxBoolean(true));
  }
}
Program: 13420
Project: 13420
Buggy source:
/** 
 * Set the spread index (the sequence number of the spread within the list of spreads for a document. Must be called after initial object load or on object creation.
 * @param spreadIndex
 * @throws Exception
 */
public void setSpreadIndex(int spreadIndex) throws Exception {
  setTransformationMatrix(spreadIndex);
  logger.debug("String_Node_Str");
  assignRectanglesToPages();
}

Fixed version (ground truth):
/** 
 * Set the spread index (the sequence number of the spread within the list of spreads for a document. Must be called after initial object load or on object creation.
 * @param spreadIndex
 * @throws Exception
 */
public void setSpreadIndex(int spreadIndex) throws Exception {
  setTransformationMatrix(spreadIndex);
  this.spreadIndex=spreadIndex;
  logger.debug("String_Node_Str");
  assignRectanglesToPages();
}
Program: 13421
Project: 13421
Buggy source:
/** 
 * Set the next frame in the thread. Automatically sets this frame as the previous frame on  the specified text frame.
 * @param nextTextFrame The frame to which this frameis to be threaded.
 */
public void setNextInThread(TextFrame nextTextFrame){
  this.nextInThread=nextTextFrame;
  if (nextTextFrame != null) {
    nextTextFrame.setPreviousInThread(this);
  }
}

Fixed version (ground truth):
/** 
 * Set the next frame in the thread. Automatically sets this frame as the previous frame on  the specified text frame.
 * @param nextTextFrame The frame to which this frameis to be threaded.
 */
public void setNextInThread(TextFrame nextTextFrame){
  if (nextTextFrame == null) {
    if (this.nextInThread != null) {
      this.nextInThread.setPreviousInThread(null);
    }
  }
 else {
    nextTextFrame.setPreviousInThread(this);
  }
  this.nextInThread=nextTextFrame;
}