nus-yam/ex-repair huggingface dataset:
Program: 170330
Project: 170330
Buggy source:
private void renderMagicCircle(float r,float g,float b,float partialTickTime,int offset){
  mc.mcProfiler.startSection("String_Node_Str");
  GL11.glPushMatrix();
  GL11.glColor4f(r,g,b,1F);
  GL11.glDisable(GL11.GL_LIGHTING);
  GL11.glDisable(GL11.GL_CULL_FACE);
  GL11.glTranslatef(0F,1.48F,0F);
  float circleScale=2.0F;
  GL11.glScalef(circleScale,circleScale,circleScale);
  float rotation=(float)((double)(mc.theWorld.getTotalWorldTime() + offset) / 0.8F % 360) + partialTickTime;
  GL11.glRotatef(rotation,0,1,0);
  ModRenderHelper.disableLighting();
  ModRenderHelper.enableAlphaBlend();
  bindTexture(circle);
  IRenderBuffer renderBuffer=RenderBridge.INSTANCE;
  renderBuffer.startDrawingQuads();
  renderBuffer.addVertexWithUV(-1,0,-1,1,0);
  renderBuffer.addVertexWithUV(1,0,-1,0,0);
  renderBuffer.addVertexWithUV(1,0,1,0,1);
  renderBuffer.addVertexWithUV(-1,0,1,1,1);
  renderBuffer.draw();
  GL11.glTranslatef(0F,-0.002F,0F);
  bindTexture(circleBlur);
  renderBuffer.startDrawingQuads();
  renderBuffer.addVertexWithUV(-1,0,-1,1,0);
  renderBuffer.addVertexWithUV(1,0,-1,0,0);
  renderBuffer.addVertexWithUV(1,0,1,0,1);
  renderBuffer.addVertexWithUV(-1,0,1,1,1);
  renderBuffer.draw();
  ModRenderHelper.disableAlphaBlend();
  ModRenderHelper.enableLighting();
  GL11.glEnable(GL11.GL_CULL_FACE);
  GL11.glEnable(GL11.GL_LIGHTING);
  GL11.glColor4f(1F,1F,1F,1F);
  GL11.glPopMatrix();
  mc.mcProfiler.endSection();
}

Fixed version (ground truth):
private void renderMagicCircle(float r,float g,float b,float partialTickTime,int offset,boolean isChild){
  mc.mcProfiler.startSection("String_Node_Str");
  GL11.glPushMatrix();
  if (isChild) {
    ModelHelper.enableChildModelScale(false,SCALE);
  }
  GL11.glColor4f(r,g,b,1F);
  GL11.glDisable(GL11.GL_LIGHTING);
  GL11.glDisable(GL11.GL_CULL_FACE);
  GL11.glTranslatef(0F,1.48F,0F);
  float circleScale=2.0F;
  GL11.glScalef(circleScale,circleScale,circleScale);
  float rotation=(float)((double)(mc.theWorld.getTotalWorldTime() + offset) / 0.8F % 360) + partialTickTime;
  GL11.glRotatef(rotation,0,1,0);
  ModRenderHelper.disableLighting();
  ModRenderHelper.enableAlphaBlend();
  bindTexture(circle);
  IRenderBuffer renderBuffer=RenderBridge.INSTANCE;
  renderBuffer.startDrawingQuads();
  renderBuffer.addVertexWithUV(-1,0,-1,1,0);
  renderBuffer.addVertexWithUV(1,0,-1,0,0);
  renderBuffer.addVertexWithUV(1,0,1,0,1);
  renderBuffer.addVertexWithUV(-1,0,1,1,1);
  renderBuffer.draw();
  GL11.glTranslatef(0F,-0.002F,0F);
  bindTexture(circleBlur);
  renderBuffer.startDrawingQuads();
  renderBuffer.addVertexWithUV(-1,0,-1,1,0);
  renderBuffer.addVertexWithUV(1,0,-1,0,0);
  renderBuffer.addVertexWithUV(1,0,1,0,1);
  renderBuffer.addVertexWithUV(-1,0,1,1,1);
  renderBuffer.draw();
  ModRenderHelper.disableAlphaBlend();
  ModRenderHelper.enableLighting();
  GL11.glEnable(GL11.GL_CULL_FACE);
  GL11.glEnable(GL11.GL_LIGHTING);
  GL11.glColor4f(1F,1F,1F,1F);
  if (isChild) {
    ModelHelper.disableChildModelScale();
  }
  GL11.glPopMatrix();
  mc.mcProfiler.endSection();
}
Program: 170331
Project: 170331
Buggy source:
private int renderModel(TileEntityMannequin te,ModelBiped targetBiped,MannequinFakePlayer fakePlayer){
  int displayList=0;
  if (hasRendered) {
    displayList=GLAllocation.generateDisplayLists(1);
    GL11.glNewList(displayList,GL11.GL_COMPILE);
  }
  if (!hasCustomHead(te)) {
    if (te.getBipedRotations().isChild) {
      ModelHelper.enableChildModelScale(true,SCALE);
    }
    targetBiped.bipedHead.render(SCALE);
    GL11.glDisable(GL11.GL_CULL_FACE);
    targetBiped.bipedHeadwear.render(SCALE);
    GL11.glEnable(GL11.GL_CULL_FACE);
    if (te.getBipedRotations().isChild) {
      ModelHelper.disableChildModelScale();
    }
  }
  if (te.getBipedRotations().isChild) {
    ModelHelper.enableChildModelScale(false,SCALE);
  }
  targetBiped.bipedBody.render(SCALE);
  targetBiped.bipedRightArm.render(SCALE);
  targetBiped.bipedLeftArm.render(SCALE);
  targetBiped.bipedRightLeg.render(SCALE);
  targetBiped.bipedLeftLeg.render(SCALE);
  if (te.getGameProfile() != null && te.getGameProfile().getName().equals("String_Node_Str")) {
    GL11.glPushMatrix();
    GL11.glRotated(Math.toDegrees(targetBiped.bipedHead.rotateAngleZ),0,0,1);
    GL11.glRotated(Math.toDegrees(targetBiped.bipedHead.rotateAngleY),0,1,0);
    GL11.glRotated(Math.toDegrees(targetBiped.bipedHead.rotateAngleX),1,0,0);
    GL11.glTranslated(-5.5F * SCALE,0,0);
    GL11.glTranslated(0,-6.5F * SCALE,0);
    targetBiped.bipedEars.render(SCALE);
    GL11.glTranslated(11F * SCALE,0,0);
    targetBiped.bipedEars.render(SCALE);
    GL11.glPopMatrix();
  }
  if (te.getBipedRotations().isChild) {
    ModelHelper.disableChildModelScale();
  }
  if (hasRendered) {
    GL11.glEndList();
  }
  hasRendered=true;
  return displayList;
}

Fixed version (ground truth):
private int renderModel(TileEntityMannequin te,ModelBiped targetBiped,MannequinFakePlayer fakePlayer){
  int displayList=0;
  if (hasRendered) {
    displayList=GLAllocation.generateDisplayLists(1);
    GL11.glNewList(displayList,GL11.GL_COMPILE);
  }
  if (!hasCustomHead(te)) {
    if (te.getBipedRotations().isChild) {
      ModelHelper.enableChildModelScale(true,SCALE);
    }
    targetBiped.bipedHead.render(SCALE);
    GL11.glDisable(GL11.GL_CULL_FACE);
    targetBiped.bipedHeadwear.render(SCALE);
    GL11.glEnable(GL11.GL_CULL_FACE);
    if (te.getBipedRotations().isChild) {
      ModelHelper.disableChildModelScale();
    }
    ;
  }
  if (te.getBipedRotations().isChild) {
    ModelHelper.enableChildModelScale(false,SCALE);
  }
  targetBiped.bipedBody.render(SCALE);
  targetBiped.bipedRightArm.render(SCALE);
  targetBiped.bipedLeftArm.render(SCALE);
  targetBiped.bipedRightLeg.render(SCALE);
  targetBiped.bipedLeftLeg.render(SCALE);
  if (te.getBipedRotations().isChild) {
    ModelHelper.disableChildModelScale();
  }
  if (hasRendered) {
    GL11.glEndList();
  }
  if (!hasRendered) {
    hasRendered=true;
  }
  return displayList;
}
Program: 170332
Project: 170332
Buggy source:
private static void saveArmourBlockToList(World world,int x,int y,int z,int ix,int iy,int iz,ArrayList<ICube> list,ArrayList<CubeMarkerData> markerBlocks,ForgeDirection direction) throws InvalidCubeTypeException {
  if (world.isAirBlock(x,y,z)) {
    return;
  }
  Block block=world.getBlock(x,y,z);
  if (block == ModBlocks.colourable | block == ModBlocks.colourableGlowing | block == ModBlocks.colourableGlass | block == ModBlocks.colourableGlassGlowing) {
    int meta=world.getBlockMetadata(x,y,z);
    ICubeColour colour=UtilBlocks.getColourFromTileEntity(world,x,y,z);
    byte blockType=0;
    if (block == ModBlocks.colourableGlowing) {
      blockType=1;
    }
    if (block == ModBlocks.colourableGlass) {
      blockType=2;
    }
    if (block == ModBlocks.colourableGlassGlowing) {
      blockType=3;
    }
    ICube blockData=CubeFactory.INSTANCE.getCubeInstanceFormId(blockType);
    blockData.setX((byte)ix);
    blockData.setY((byte)iy);
    blockData.setZ((byte)iz);
    blockData.setColour(colour);
    list.add(blockData);
    if (meta > 0) {
      markerBlocks.add(new CubeMarkerData((byte)ix,(byte)iy,(byte)iz,(byte)meta));
    }
  }
}

Fixed version (ground truth):
private static void saveArmourBlockToList(World world,int x,int y,int z,int ix,int iy,int iz,ArrayList<ICube> list,ArrayList<CubeMarkerData> markerBlocks,ForgeDirection direction) throws InvalidCubeTypeException {
  if (world.isAirBlock(x,y,z)) {
    return;
  }
  Block block=world.getBlock(x,y,z);
  if (block == ModBlocks.colourable | block == ModBlocks.colourableGlowing | block == ModBlocks.colourableGlass | block == ModBlocks.colourableGlassGlowing) {
    int meta=world.getBlockMetadata(x,y,z);
    ICubeColour colour=UtilBlocks.getColourFromTileEntity(world,x,y,z);
    byte blockType=0;
    if (block == ModBlocks.colourableGlowing) {
      blockType=1;
    }
    if (block == ModBlocks.colourableGlass) {
      blockType=2;
    }
    if (block == ModBlocks.colourableGlassGlowing) {
      blockType=3;
    }
    ICube blockData=CubeFactory.INSTANCE.getCubeInstanceFormId(blockType);
    blockData.setX((byte)ix);
    blockData.setY((byte)iy);
    blockData.setZ((byte)iz);
    blockData.setColour(new CubeColour(colour));
    list.add(blockData);
    if (meta > 0) {
      markerBlocks.add(new CubeMarkerData((byte)ix,(byte)iy,(byte)iz,(byte)meta));
    }
  }
}
Program: 170333
Project: 170333
Buggy source:
private static void loadSkinBlockIntoWorld(World world,int x,int y,int z,int xOrigin,int yOrigin,int zOrigin,ICube blockData,ForgeDirection direction,int meta){
  int shiftX=-blockData.getX() - 1;
  int shiftY=blockData.getY() + 1;
  int shiftZ=blockData.getZ();
  int targetX=x + shiftX + xOrigin;
  int targetY=y + yOrigin - shiftY;
  int targetZ=z + shiftZ + zOrigin;
  if (world.isAirBlock(targetX,targetY,targetZ)) {
    Block targetBlock=ModBlocks.colourable;
    if (blockData.getId() == 1) {
      targetBlock=ModBlocks.colourableGlowing;
    }
    if (blockData.getId() == 2) {
      targetBlock=ModBlocks.colourableGlass;
    }
    if (blockData.getId() == 3) {
      targetBlock=ModBlocks.colourableGlassGlowing;
    }
    world.setBlock(targetX,targetY,targetZ,targetBlock);
    world.setBlockMetadataWithNotify(targetX,targetY,targetZ,meta,2);
    TileEntity te=world.getTileEntity(targetX,targetY,targetZ);
    if (te != null && te instanceof TileEntityColourable) {
      ((TileEntityColourable)te).setColour(blockData.getCubeColour());
    }
  }
}

Fixed version (ground truth):
private static void loadSkinBlockIntoWorld(World world,int x,int y,int z,int xOrigin,int yOrigin,int zOrigin,ICube blockData,ForgeDirection direction,int meta){
  int shiftX=-blockData.getX() - 1;
  int shiftY=blockData.getY() + 1;
  int shiftZ=blockData.getZ();
  int targetX=x + shiftX + xOrigin;
  int targetY=y + yOrigin - shiftY;
  int targetZ=z + shiftZ + zOrigin;
  if (world.isAirBlock(targetX,targetY,targetZ)) {
    Block targetBlock=ModBlocks.colourable;
    if (blockData.getId() == 1) {
      targetBlock=ModBlocks.colourableGlowing;
    }
    if (blockData.getId() == 2) {
      targetBlock=ModBlocks.colourableGlass;
    }
    if (blockData.getId() == 3) {
      targetBlock=ModBlocks.colourableGlassGlowing;
    }
    world.setBlock(targetX,targetY,targetZ,targetBlock);
    world.setBlockMetadataWithNotify(targetX,targetY,targetZ,meta,2);
    TileEntity te=world.getTileEntity(targetX,targetY,targetZ);
    if (te != null && te instanceof TileEntityColourable) {
      ((TileEntityColourable)te).setColour(new CubeColour(blockData.getCubeColour()));
    }
  }
}
Program: 170334
Project: 170334
Buggy source:
private static int clearEquipmentCubesForSkinPart(World world,int x,int y,int z,ISkinPartType skinPart){
  IRectangle3D buildSpace=skinPart.getBuildingSpace();
  IPoint3D offset=skinPart.getOffset();
  int blockCount=0;
  for (int ix=0; ix < buildSpace.getWidth(); ix++) {
    for (int iy=0; iy < buildSpace.getHeight(); iy++) {
      for (int iz=0; iz < buildSpace.getDepth(); iz++) {
        int xTar=x + ix + -offset.getX()+ buildSpace.getX();
        int yTar=y + iy + -offset.getY();
        int zTar=z + iz + offset.getZ()+ buildSpace.getZ();
        if (world.blockExists(xTar,yTar,zTar)) {
          Block block=world.getBlock(xTar,yTar,zTar);
          if (block == ModBlocks.colourable | block == ModBlocks.colourableGlowing | block == ModBlocks.colourableGlass | block == ModBlocks.colourableGlassGlowing) {
            world.setBlockToAir(xTar,yTar,zTar);
            blockCount++;
          }
        }
      }
    }
  }
  return blockCount;
}

Fixed version (ground truth):
private static int clearEquipmentCubesForSkinPart(World world,int x,int y,int z,ISkinPartType skinPart){
  IRectangle3D buildSpace=skinPart.getBuildingSpace();
  IPoint3D offset=skinPart.getOffset();
  int blockCount=0;
  for (int ix=0; ix < buildSpace.getWidth(); ix++) {
    for (int iy=0; iy < buildSpace.getHeight(); iy++) {
      for (int iz=0; iz < buildSpace.getDepth(); iz++) {
        int xTar=x + ix + -offset.getX()+ buildSpace.getX();
        int yTar=y + iy + -offset.getY();
        int zTar=z + iz + offset.getZ()+ buildSpace.getZ();
        if (world.blockExists(xTar,yTar,zTar)) {
          Block block=world.getBlock(xTar,yTar,zTar);
          if (block == ModBlocks.colourable | block == ModBlocks.colourableGlowing | block == ModBlocks.colourableGlass | block == ModBlocks.colourableGlassGlowing) {
            world.setBlockToAir(xTar,yTar,zTar);
            world.removeTileEntity(xTar,yTar,zTar);
            blockCount++;
          }
        }
      }
    }
  }
  return blockCount;
}
Program: 170336
Project: 170336
Buggy source:
@Override public void init(){
  PlayerSkinHandler.init();
  ClientModelCache.init();
  FMLCommonHandler.instance().bus().register(new ModClientFMLEventHandler());
  MinecraftForge.EVENT_BUS.register(new DebugTextHandler());
  try {
    Class.forName("String_Node_Str");
    ModLogger.log("String_Node_Str");
    shadersModLoaded=true;
  }
 catch (  Exception e) {
  }
  if (Loader.isModLoaded("String_Node_Str")) {
    moreplayermodelsLoaded=true;
    ModLogger.log("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void init(){
  PlayerSkinHandler.init();
  ClientModelCache.init();
  FMLCommonHandler.instance().bus().register(new ModClientFMLEventHandler());
  MinecraftForge.EVENT_BUS.register(new DebugTextHandler());
  try {
    Class.forName("String_Node_Str");
    ModLogger.log("String_Node_Str");
    shadersModLoaded=true;
  }
 catch (  Exception e) {
  }
  if (Loader.isModLoaded("String_Node_Str")) {
    moreplayermodelsLoaded=true;
    ModLogger.log("String_Node_Str");
  }
  if (Loader.isModLoaded("String_Node_Str")) {
    coloredLightsLoaded=true;
    ModLogger.log("String_Node_Str");
  }
}
Program: 170337
Project: 170337
Buggy source:
public static boolean useSafeTextureRender(){
  if (shadersModLoaded) {
    return true;
  }
  if (ConfigHandler.skinTextureRenderOverride) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
public static boolean useSafeTextureRender(){
  if (shadersModLoaded) {
    return true;
  }
  if (ConfigHandler.skinTextureRenderOverride) {
    return true;
  }
  if (coloredLightsLoaded) {
    return true;
  }
  return false;
}
Program: 170338
Project: 170338
Buggy source:
@SubscribeEvent @SideOnly(Side.CLIENT) public void onDebugText(RenderGameOverlayEvent.Text event){
  if (event.left != null && event.left.size() > 0) {
    event.left.add("String_Node_Str");
    event.left.add("String_Node_Str" + EquipmentItemRenderCache.getCacheSize());
    event.left.add("String_Node_Str" + ArmourersWorkshop.proxy.getPlayerModelCacheSize());
  }
}

Fixed version (ground truth):
@SubscribeEvent @SideOnly(Side.CLIENT) public void onDebugText(RenderGameOverlayEvent.Text event){
  if (event.left != null && event.left.size() > 0) {
    event.left.add("String_Node_Str");
    String prefix=EnumChatFormatting.GOLD + "String_Node_Str" + LibModInfo.NAME+ "String_Node_Str"+ EnumChatFormatting.WHITE;
    event.left.add(prefix + "String_Node_Str" + EquipmentItemRenderCache.getCacheSize());
    event.left.add(prefix + "String_Node_Str" + ArmourersWorkshop.proxy.getPlayerModelCacheSize());
  }
}
Program: 170339
Project: 170339
Buggy source:
public TemplateModel get(int idx) throws TemplateModelException {
  final int size=elements.size();
  if (idx < 0 || idx >= size) {
    throw new TemplateModelException("String_Node_Str" + idx + "String_Node_Str"+ (size - 1));
  }
  JSONNode[] wrappedChildren=this.wrappedElements;
  if (wrappedChildren == null) {
    wrappedChildren=new JSONNode[size];
    this.wrappedElements=wrappedChildren;
  }
  JSONNode r=wrappedChildren[idx];
  if (r == null) {
    r=wrap(elements.get(idx));
    if (r == null) {
      r=JSON_NULL_MARK;
    }
    wrappedChildren[idx]=r;
  }
  return r != JSON_NULL_MARK ? r : null;
}

Fixed version (ground truth):
public TemplateModel get(int idx) throws TemplateModelException {
  final int size=elements.size();
  if (idx < 0 || idx >= size) {
    throw new TemplateModelException("String_Node_Str" + idx + "String_Node_Str"+ (size - 1));
  }
  JSONNode[] wrappedChildren=this.wrappedElements;
  if (wrappedChildren == null) {
    wrappedChildren=new JSONNode[size];
    this.wrappedElements=wrappedChildren;
  }
  JSONNode r=wrappedChildren[idx];
  if (r == null) {
    r=wrap(elements.get(idx),this,null);
    if (r == null) {
      r=JSON_NULL_MARK;
    }
    wrappedChildren[idx]=r;
  }
  return r != JSON_NULL_MARK ? r : null;
}
Program: 170340
Project: 170340
Buggy source:
@Override protected void processMessage(byte[] message,SpoutOutputCollector collector){
  final MetricEnvelope metricEnvelope;
  try {
    metricEnvelope=MetricEnvelopes.fromJson(message);
    logger.debug("String_Node_Str",metricEnvelope);
  }
 catch (  RuntimeException re) {
    logger.warn("String_Node_Str",re);
    return;
  }
  String tenantId=(String)metricEnvelope.meta.get("String_Node_Str");
  if (tenantId == null) {
    logger.error("String_Node_Str",DEFAULT_TENANT_ID,metricEnvelope.metric);
    tenantId=DEFAULT_TENANT_ID;
  }
  collector.emit(new Values(new TenantIdAndMetricName(tenantId,metricEnvelope.metric.definition().name),metricEnvelope.creationTime,metricEnvelope.metric));
}

Fixed version (ground truth):
@Override protected void processMessage(byte[] message,SpoutOutputCollector collector){
  final MetricEnvelope metricEnvelope;
  try {
    metricEnvelope=MetricEnvelopes.fromJson(message);
    logger.debug("String_Node_Str",metricEnvelope);
  }
 catch (  RuntimeException re) {
    logger.warn("String_Node_Str",re);
    return;
  }
  String tenantId=(String)metricEnvelope.meta.get("String_Node_Str");
  if (tenantId == null) {
    logger.error("String_Node_Str",DEFAULT_TENANT_ID,metricEnvelope.metric);
    tenantId=DEFAULT_TENANT_ID;
  }
  final Metric metric=metricEnvelope.metric;
  if (metric.dimensions == null) {
    metric.dimensions=EMPTY_DIMENSIONS;
  }
  collector.emit(new Values(new TenantIdAndMetricName(tenantId,metricEnvelope.metric.definition().name),metricEnvelope.creationTime,metric));
}
Program: 170342
Project: 170342
Buggy source:
@Override public List<MetricDefinition> findForAlarms(){
  Handle h=db.open();
  try {
    List<Map<String,Object>> rows=h.createQuery(METRIC_DEF_SQL).list();
    List<MetricDefinition> metricDefs=new ArrayList<MetricDefinition>(rows.size());
    for (    Map<String,Object> row : rows) {
      String name=(String)row.get("String_Node_Str");
      String dimensionSet=(String)row.get("String_Node_Str");
      Map<String,String> dimensions=null;
      if (dimensionSet != null) {
        for (        String kvStr : dimensionSet.split("String_Node_Str")) {
          String[] kv=kvStr.split("String_Node_Str");
          if (kv.length > 1) {
            if (dimensions == null)             dimensions=new HashMap<String,String>();
            dimensions.put(kv[0],kv[1]);
          }
        }
      }
      metricDefs.add(new MetricDefinition(name,dimensions));
    }
    return metricDefs;
  }
  finally {
    h.close();
  }
}

Fixed version (ground truth):
@Override public List<MetricDefinition> findForAlarms(){
  Handle h=db.open();
  try {
    List<Map<String,Object>> rows=h.createQuery(METRIC_DEF_SQL).list();
    List<MetricDefinition> metricDefs=new ArrayList<MetricDefinition>(rows.size());
    for (    Map<String,Object> row : rows) {
      String metric_name=(String)row.get("String_Node_Str");
      String dimensionSet=(String)row.get("String_Node_Str");
      Map<String,String> dimensions=null;
      if (dimensionSet != null) {
        for (        String kvStr : dimensionSet.split("String_Node_Str")) {
          String[] kv=kvStr.split("String_Node_Str");
          if (kv.length > 1) {
            if (dimensions == null)             dimensions=new HashMap<String,String>();
            dimensions.put(kv[0],kv[1]);
          }
        }
      }
      metricDefs.add(new MetricDefinition(metric_name,dimensions));
    }
    return metricDefs;
  }
  finally {
    h.close();
  }
}
Program: 170343
Project: 170343
Buggy source:
@Override public List<List<?>> deserialize(byte[] tuple){
  FlatMetric flatMetric=FlatMetrics.fromJson(tuple);
  Metric metric=flatMetric.toMetric();
  return Collections.<List<?>>singletonList(Arrays.asList(metric.definition,metric));
}

Fixed version (ground truth):
@Override public List<List<?>> deserialize(byte[] tuple){
  FlatMetric flatMetric=FlatMetrics.fromJson(tuple);
  Metric metric=flatMetric.toMetric();
  return Collections.<List<?>>singletonList(Arrays.asList(metric.definition(),metric));
}
Program: 170344
Project: 170344
Buggy source:
public void shouldDeserialize(){
  FlatMetric initial=new FlatMetric("String_Node_Str",null,123,5.0);
  List<List<?>> metrics=deserializer.deserialize(FlatMetrics.toJson(initial).getBytes());
  Metric expected=initial.toMetric();
  assertEquals(metrics,Collections.singletonList(Arrays.asList(expected.definition,expected)));
}

Fixed version (ground truth):
public void shouldDeserialize(){
  FlatMetric initial=new FlatMetric("String_Node_Str",null,123,5.0);
  List<List<?>> metrics=deserializer.deserialize(FlatMetrics.toJson(initial).getBytes());
  Metric expected=initial.toMetric();
  assertEquals(metrics,Collections.singletonList(Arrays.asList(expected.definition(),expected)));
}
Program: 170345
Project: 170345
Buggy source:
/** 
 * Return a paged list of computer
 * @param page Page to display
 * @param pageSize Number of computers per page
 * @param sortBy Computer property used for sorting
 * @param order Sort order (either or asc or desc)
 * @param filter Filter applied on the name column
 */
public static PagedList<Computer> page(int page,int pageSize,String sortBy,String order,String filter){
  return find.where().ilike("String_Node_Str","String_Node_Str" + filter + "String_Node_Str").orderBy(sortBy + "String_Node_Str" + order).fetch("String_Node_Str").setFirstRow(page).setMaxRows(pageSize).findPagedList();
}

Fixed version (ground truth):
/** 
 * Return a paged list of computer
 * @param page Page to display
 * @param pageSize Number of computers per page
 * @param sortBy Computer property used for sorting
 * @param order Sort order (either or asc or desc)
 * @param filter Filter applied on the name column
 */
public static PagedList<Computer> page(int page,int pageSize,String sortBy,String order,String filter){
  return find.where().ilike("String_Node_Str","String_Node_Str" + filter + "String_Node_Str").orderBy(sortBy + "String_Node_Str" + order).fetch("String_Node_Str").setFirstRow(page * pageSize).setMaxRows(pageSize).findPagedList();
}
Program: 170346
Project: 170346
Buggy source:
/** 
 * Initialize the rects with borders, taking shadows into account
 */
private void initRectsWithBorders(){
  mBorderRect.set(mRect);
  mBorderRect.left+=mBorderWidth;
  mBorderRect.top+=mBorderWidth;
  mBorderRect.right-=mBorderWidth;
  mBorderRect.bottom-=mBorderWidth;
  if (mShadowWidth > 0) {
    mBorderRect.right-=mShadowWidth;
    mBorderRect.bottom-=mShadowWidth;
  }
  mImageRect.set(mBorderRect.left + mBorderWidth,mBorderRect.top + mBorderWidth,mBorderRect.right - mBorderWidth,mBorderRect.bottom - mBorderWidth);
}

Fixed version (ground truth):
/** 
 * Initialize the rects with borders, taking shadows into account
 */
private void initRectsWithBorders(){
  mBorderRect.set(mRect);
  mBorderRect.inset(mBorderWidth / 1.3f,mBorderWidth / 1.3f);
  if (mShadowWidth > 0) {
    mBorderRect.right-=mShadowWidth;
    mBorderRect.bottom-=mShadowWidth;
  }
  mImageRect.set(mBorderRect);
  mImageRect.inset(mBorderWidth / 1.3f,mBorderWidth / 1.3f);
}
Program: 170347
Project: 170347
Buggy source:
private Map<String,String> prepDimensions(Map<String,String> dimMap){
  Map<String,String> newDimMap=new TreeMap<>();
  if (dimMap != null) {
    for (    String dimName : dimMap.keySet()) {
      if (dimName != null && !dimName.isEmpty()) {
        String dimValue=dimMap.get(dimName);
        if (dimValue != null && !dimValue.isEmpty()) {
          newDimMap.put(trunc(dimName,MAX_COLUMN_LENGTH),trunc(dimValue,MAX_COLUMN_LENGTH));
        }
      }
    }
  }
  return newDimMap;
}

Fixed version (ground truth):
private Map<String,String> prepDimensions(Map<String,String> dimMap){
  Map<String,String> newDimMap=new TreeMap<>();
  if (dimMap != null) {
    for (    String dimName : dimMap.keySet()) {
      if (dimName != null && !dimName.isEmpty()) {
        String dimValue=dimMap.get(dimName);
        if (dimValue != null && !dimValue.isEmpty()) {
          newDimMap.put(trunc(dimName,MAX_COLUMN_LENGTH),trunc(dimValue,MAX_COLUMN_LENGTH));
          dimensionCounter.inc();
        }
      }
    }
  }
  return newDimMap;
}
Program: 170349
Project: 170349
Buggy source:
@Override public void addDefinitionToBatch(final Sha1HashId defId,final String name,final String tenantId,final String region){
  final Def def=new Def(defId,name,tenantId,region);
  this.defMap.put(defId,def);
}

Fixed version (ground truth):
@Override public void addDefinitionToBatch(final Sha1HashId defId,final String name,final String tenantId,final String region){
  if (!this.defMap.containsKey(defId)) {
    final Def def=new Def(defId,name,tenantId,region);
    this.defMap.put(defId,def);
  }
}
Program: 170350
Project: 170350
Buggy source:
@Override public void addDefinitionDimensionToBatch(final Sha1HashId defDimsId,final Sha1HashId defId,Sha1HashId dimId){
  final DefDim defDim=new DefDim(defDimsId,defId,dimId);
  this.defDimMap.put(defDimsId,defDim);
}

Fixed version (ground truth):
@Override public void addDefinitionDimensionToBatch(final Sha1HashId defDimsId,final Sha1HashId defId,Sha1HashId dimId){
  if (!this.defDimMap.containsKey(defDimsId)) {
    final DefDim defDim=new DefDim(defDimsId,defId,dimId);
    this.defDimMap.put(defDimsId,defDim);
  }
}
Program: 170351
Project: 170351
Buggy source:
@Override public void addDefinitionToBatch(Sha1HashId defId,String name,String tenantId,String region){
  if (definitionsIdCache.getIfPresent(defId) == null) {
    logger.debug("String_Node_Str",defId.toHexString(),name,tenantId,region);
    stagedDefinitionsBatch.add().bind("String_Node_Str",defId.getSha1Hash()).bind("String_Node_Str",name).bind("String_Node_Str",tenantId).bind("String_Node_Str",region);
    definitionIdSet.add(defId);
    definitionCacheMissMeter.mark();
  }
 else {
    definitionCacheHitMeter.mark();
  }
}

Fixed version (ground truth):
@Override public void addDefinitionToBatch(Sha1HashId defId,String name,String tenantId,String region){
  if (definitionsIdCache.getIfPresent(defId) == null) {
    definitionCacheMissMeter.mark();
    if (!definitionIdSet.contains(defId)) {
      logger.debug("String_Node_Str",defId.toHexString(),name,tenantId,region);
      stagedDefinitionsBatch.add().bind("String_Node_Str",defId.getSha1Hash()).bind("String_Node_Str",name).bind("String_Node_Str",tenantId).bind("String_Node_Str",region);
      definitionIdSet.add(defId);
    }
  }
 else {
    definitionCacheHitMeter.mark();
  }
}
Program: 170352
Project: 170352
Buggy source:
@Override public void addDefinitionDimensionToBatch(Sha1HashId defDimsId,Sha1HashId defId,Sha1HashId dimId){
  if (definitionDimensionsIdCache.getIfPresent(defDimsId) == null) {
    logger.debug("String_Node_Str",defDimsId.toHexString(),defId,dimId);
    stagedDefinitionDimensionsBatch.add().bind("String_Node_Str",defDimsId.getSha1Hash()).bind("String_Node_Str",defId.getSha1Hash()).bind("String_Node_Str",dimId.getSha1Hash());
    definitionDimensionsIdSet.add(defDimsId);
    definitionDimensionCacheMissMeter.mark();
  }
 else {
    definitionDimensionCacheHitMeter.mark();
  }
}

Fixed version (ground truth):
@Override public void addDefinitionDimensionToBatch(Sha1HashId defDimsId,Sha1HashId defId,Sha1HashId dimId){
  if (definitionDimensionsIdCache.getIfPresent(defDimsId) == null) {
    definitionDimensionCacheMissMeter.mark();
    if (!definitionDimensionsIdSet.contains(defDimsId)) {
      logger.debug("String_Node_Str",defDimsId.toHexString(),defId,dimId);
      stagedDefinitionDimensionsBatch.add().bind("String_Node_Str",defDimsId.getSha1Hash()).bind("String_Node_Str",defId.getSha1Hash()).bind("String_Node_Str",dimId.getSha1Hash());
      definitionDimensionsIdSet.add(defDimsId);
    }
  }
 else {
    definitionDimensionCacheHitMeter.mark();
  }
}
Program: 170353
Project: 170353
Buggy source:
public void delete(long id){
  for (  RelationCheck rel : relations.values()) {
    rel.deleteFrom(id);
    rel.deleteTo(id);
  }
}

Fixed version (ground truth):
public void delete(long id){
synchronized (relations) {
    for (    RelationCheck rel : relations.values()) {
      rel.deleteFrom(id);
      rel.deleteTo(id);
    }
  }
}
Program: 170355
Project: 170355
Buggy source:
@Override public int getMaximumMosaicIndex(){
  int maxIndex=0;
  for (  String pviName : getAttributeValues(L3PSD13Constants.PATH_GRANULE_METADATA_PVI_FILENAME)) {
    try {
      int aux=Integer.parseInt(pviName.substring(pviName.lastIndexOf("String_Node_Str") + 1));
      if (aux > maxIndex)       maxIndex=aux;
    }
 catch (    Exception e) {
    }
  }
  String[] mosaicContentTileNumbers=getAttributeValues(L3PSD13Constants.PATH_GRANULE_METADATA_MOSAIC_CONTENT_TILE_NUMBER);
  if (mosaicContentTileNumbers != null) {
    for (    String tileNumber : mosaicContentTileNumbers) {
      try {
        int aux=Integer.parseInt(tileNumber);
        if (aux > maxIndex)         maxIndex=aux;
      }
 catch (      Exception e) {
      }
    }
  }
  return maxIndex;
}

Fixed version (ground truth):
@Override public int getMaximumMosaicIndex(){
  int maxIndex=1;
  String[] attributeValuesPVI=getAttributeValues(L3PSD13Constants.PATH_GRANULE_METADATA_PVI_FILENAME);
  if (attributeValuesPVI != null) {
    for (    String pviName : attributeValuesPVI) {
      try {
        int aux=Integer.parseInt(pviName.substring(pviName.lastIndexOf("String_Node_Str") + 1));
        if (aux > maxIndex)         maxIndex=aux;
      }
 catch (      Exception e) {
      }
    }
  }
  String[] mosaicContentTileNumbers=getAttributeValues(L3PSD13Constants.PATH_GRANULE_METADATA_MOSAIC_CONTENT_TILE_NUMBER);
  if (mosaicContentTileNumbers != null) {
    for (    String tileNumber : mosaicContentTileNumbers) {
      try {
        int aux=Integer.parseInt(tileNumber);
        if (aux > maxIndex)         maxIndex=aux;
      }
 catch (      Exception e) {
      }
    }
  }
  return maxIndex;
}
Program: 170356
Project: 170356
Buggy source:
@Override public VirtualPath resolve(String other){
  return new VirtualPath(path.resolve(other),this.dir);
}

Fixed version (ground truth):
@Override public VirtualPath resolve(String other){
  if (path.getFileName().toString().equals("String_Node_Str")) {
    return new VirtualPath(path.resolveSibling(other),this.dir);
  }
  return new VirtualPath(path.resolve(other),this.dir);
}
Program: 170357
Project: 170357
Buggy source:
@Override public VirtualPath resolveSibling(String other){
  return new VirtualPath(path.resolveSibling(other),this.dir);
}

Fixed version (ground truth):
@Override public VirtualPath resolveSibling(String other){
  if (path.getFileName().toString().equals("String_Node_Str")) {
    return new VirtualPath(path.normalize().resolveSibling(other),this.dir);
  }
  return new VirtualPath(path.resolveSibling(other),this.dir);
}
Program: 170358
Project: 170358
Buggy source:
@Override public Path getFileName(){
  Path name=path.getFileName();
  if (name != null) {
    return name;
  }
  return Paths.get(getVirtualDir().getBasePath()).getFileName();
}

Fixed version (ground truth):
@Override public Path getFileName(){
  Path name=path.getFileName();
  if (name != null && !name.toString().equals("String_Node_Str")) {
    return name;
  }
  if (name != null && name.equals("String_Node_Str")) {
    return this.getParent().getFileName();
  }
  return Paths.get(getVirtualDir().getBasePath()).getFileName();
}
Program: 170359
Project: 170359
Buggy source:
@Override public VirtualPath getParent(){
  if (path.getFileName() == null || path.getFileName().toString().equals("String_Node_Str") || path.getParent() == null) {
    Path dirPath=Paths.get(this.dir.getBasePath());
    VirtualPath parent=new VirtualPath(dirPath.getFileName(),VirtualDirEx.create(dirPath.getParent().toFile()));
    return parent;
  }
  VirtualPath parent=new VirtualPath(path.getParent(),this.dir);
  return parent;
}

Fixed version (ground truth):
@Override public VirtualPath getParent(){
  Path normalizedPath=path.normalize();
  if (normalizedPath.getParent() != null) {
    return new VirtualPath(normalizedPath.getParent(),this.dir);
  }
  if (normalizedPath.getNameCount() == 1) {
    return new VirtualPath("String_Node_Str",this.dir);
  }
  if (normalizedPath.getNameCount() == 0) {
    if (VirtualDirEx.isPackedFile(new File(dir.getBasePath())) || dir.isCompressed()) {
      return null;
    }
 else {
      Path dirPath=Paths.get(this.dir.getBasePath());
      VirtualPath parent=new VirtualPath(dirPath.getFileName(),VirtualDirEx.create(dirPath.getParent().toFile()));
      return parent;
    }
  }
  return null;
}
Program: 170360
Project: 170360
Buggy source:
public boolean exists(){
  if (dir == null) {
    return Files.exists(path);
  }
  return dir.exists(path.toString().replace(FileSystems.getDefault().getSeparator(),separator));
}

Fixed version (ground truth):
public boolean exists(){
  if (dir == null) {
    return Files.exists(path);
  }
  if (path == null || path.getNameCount() == 0 || path.getNameCount() == 1 && path.toString().equals("String_Node_Str")) {
    return Files.exists(Paths.get(dir.getBasePath().toString()));
  }
  return dir.exists(path.toString().replace(FileSystems.getDefault().getSeparator(),separator));
}
Program: 170361
Project: 170361
Buggy source:
public VirtualPath(String stringPath,VirtualDirEx dir){
  this(Paths.get(stringPath),dir);
}

Fixed version (ground truth):
public VirtualPath(String stringPath){
  this(stringPath,null);
}
Program: 170362
Project: 170362
Buggy source:
private File getQuicklookFile(final File metadataFile){
  File[] files=metadataFile.getParentFile().listFiles(new FilenameFilter(){
    public boolean accept(    File dir,    String name){
      return name.endsWith("String_Node_Str") && (name.startsWith("String_Node_Str") || name.startsWith("String_Node_Str"));
    }
  }
);
  if (files != null && files.length > 0) {
    return files[0];
  }
  return null;
}

Fixed version (ground truth):
private File getQuicklookFile(final VirtualPath metadataPath){
  String[] files=null;
  try {
    files=metadataPath.getParent().list();
  }
 catch (  IOException e) {
    return null;
  }
  if (files == null || files.length == 0) {
    return null;
  }
  for (  String file : files) {
    if (file.endsWith("String_Node_Str") && (file.startsWith("String_Node_Str") || file.startsWith("String_Node_Str"))) {
      return metadataPath.resolveSibling(file).toFile();
    }
  }
  return null;
}
Program: 170363
Project: 170363
Buggy source:
@Override protected Product readProductNodesImpl() throws IOException {
  SystemUtils.LOG.fine("String_Node_Str" + getInput().toString());
  if (getInput() instanceof File) {
    final File inputFile;
    File file;
    String longInput=GetLongPathNameW(getInput().toString());
    if (longInput.length() != 0) {
      file=new File(longInput);
    }
 else {
      file=new File(getInput().toString());
    }
    namingConvention=NamingConventionFactory.createNamingConvention(S2NamingConventionUtils.transformToSentinel2VirtualPath(file.toPath()));
  }
 else   if (getInput() instanceof VirtualPath) {
    namingConvention=NamingConventionFactory.createNamingConvention((VirtualPath)getInput());
  }
  if (namingConvention == null) {
    throw new IOException("String_Node_Str");
  }
  VirtualPath inputPath=namingConvention.getInputXml();
  if (!inputPath.exists()) {
    throw new FileNotFoundException(inputPath.getFullPathString());
  }
  if (namingConvention.hasValidStructure()) {
    product=getMosaicProduct(inputPath);
    if (product != null) {
      product.setModified(false);
    }
  }
 else {
    throw new IOException("String_Node_Str");
  }
  return product;
}

Fixed version (ground truth):
@Override protected Product readProductNodesImpl() throws IOException {
  SystemUtils.LOG.fine("String_Node_Str" + getInput().toString());
  if (getInput() instanceof File) {
    final File inputFile;
    File file;
    String longInput=GetLongPathNameW(getInput().toString());
    if (longInput.length() != 0) {
      file=new File(longInput);
    }
 else {
      file=new File(getInput().toString());
    }
    namingConvention=NamingConventionFactory.createNamingConvention(S2NamingConventionUtils.transformToSentinel2VirtualPath(file.toPath()));
  }
 else   if (getInput() instanceof VirtualPath) {
    namingConvention=NamingConventionFactory.createNamingConvention((VirtualPath)getInput());
  }
  if (namingConvention == null) {
    throw new IOException("String_Node_Str");
  }
  inputPath=namingConvention.getInputXml();
  if (!inputPath.exists()) {
    throw new FileNotFoundException(inputPath.getFullPathString());
  }
  if (namingConvention.hasValidStructure()) {
    product=getMosaicProduct(inputPath);
    addQuicklook(product,getQuicklookFile(inputPath));
    if (product != null) {
      product.setModified(false);
    }
  }
 else {
    throw new IOException("String_Node_Str");
  }
  return product;
}
Program: 170364
Project: 170364
Buggy source:
@Override public void close() throws IOException {
  if (product != null) {
    for (    Band band : product.getBands()) {
      MultiLevelImage sourceImage=band.getSourceImage();
      if (sourceImage != null) {
        sourceImage.reset();
        sourceImage.dispose();
        sourceImage=null;
      }
    }
  }
  super.close();
}

Fixed version (ground truth):
@Override public void close() throws IOException {
  if (product != null) {
    for (    Band band : product.getBands()) {
      MultiLevelImage sourceImage=band.getSourceImage();
      if (sourceImage != null) {
        sourceImage.reset();
        sourceImage.dispose();
        sourceImage=null;
      }
    }
  }
  if (inputPath != null) {
    inputPath.getVirtualDir().close();
  }
  super.close();
}
Program: 170365
Project: 170365
Buggy source:
/** 
 * From a product path, search a jpeg file for the given resolution, extract tile layout information and update
 * @param productMetadataFilePath the complete path to the product metadata file
 * @param resolution              the resolution for which we wan to find the tile layout
 * @return the tile layout for the resolution, or {@code null} if none was found
 */
public TileLayout retrieveTileLayoutFromProduct(VirtualPath productMetadataFilePath,S2SpatialResolution resolution){
  TileLayout tileLayoutForResolution=null;
  if (productMetadataFilePath.exists() && productMetadataFilePath.getFileName().toString().endsWith("String_Node_Str")) {
    VirtualPath productFolder=productMetadataFilePath.getParent();
    VirtualPath granulesFolder=productFolder.resolve("String_Node_Str");
    try {
      VirtualPath[] granulesFolderList=granulesFolder.listPaths();
      if (granulesFolderList != null && granulesFolderList.length > 0) {
        for (        VirtualPath granulePath : granulesFolderList) {
          tileLayoutForResolution=retrieveTileLayoutFromGranuleDirectory(granulePath,resolution);
          if (tileLayoutForResolution != null) {
            break;
          }
        }
      }
    }
 catch (    IOException e) {
      SystemUtils.LOG.warning("String_Node_Str" + productMetadataFilePath.toAbsolutePath().toString() + "String_Node_Str"+ e.getMessage());
    }
  }
  return tileLayoutForResolution;
}

Fixed version (ground truth):
/** 
 * From a product path, search a jpeg file for the given resolution, extract tile layout information and update
 * @param productMetadataFilePath the complete path to the product metadata file
 * @param resolution              the resolution for which we wan to find the tile layout
 * @return the tile layout for the resolution, or {@code null} if none was found
 */
public TileLayout retrieveTileLayoutFromProduct(VirtualPath productMetadataFilePath,S2SpatialResolution resolution){
  TileLayout tileLayoutForResolution=null;
  if (productMetadataFilePath.exists() && productMetadataFilePath.getFileName().toString().endsWith("String_Node_Str")) {
    VirtualPath granulesFolder=productMetadataFilePath.resolveSibling("String_Node_Str");
    try {
      VirtualPath[] granulesFolderList=granulesFolder.listPaths();
      if (granulesFolderList != null && granulesFolderList.length > 0) {
        for (        VirtualPath granulePath : granulesFolderList) {
          tileLayoutForResolution=retrieveTileLayoutFromGranuleDirectory(granulePath,resolution);
          if (tileLayoutForResolution != null) {
            break;
          }
        }
      }
    }
 catch (    IOException e) {
      SystemUtils.LOG.warning("String_Node_Str" + productMetadataFilePath.toAbsolutePath().toString() + "String_Node_Str"+ e.getMessage());
    }
  }
  return tileLayoutForResolution;
}
Program: 170366
Project: 170366
Buggy source:
public static VirtualPath transformToSentinel2VirtualPath(Path path){
  VirtualPath virtualPath;
  if (VirtualDirEx.isPackedFile(path.toFile())) {
    VirtualDirEx virtualDirEx=VirtualDirEx.create(path.toFile());
    String folderName=PathUtils.getFileNameWithoutExtension(path);
    if (!folderName.endsWith("String_Node_Str")) {
      folderName=folderName + "String_Node_Str";
    }
    if (virtualDirEx.exists(folderName)) {
      virtualPath=new VirtualPath(folderName,virtualDirEx);
    }
 else {
      virtualPath=new VirtualPath("String_Node_Str",virtualDirEx);
    }
  }
 else {
    virtualPath=new VirtualPath(path,null);
  }
  return virtualPath;
}

Fixed version (ground truth):
public static VirtualPath transformToSentinel2VirtualPath(Path path){
  VirtualPath virtualPath;
  if (VirtualDirEx.isPackedFile(path.toFile())) {
    VirtualDirEx virtualDirEx=VirtualDirEx.create(path.toFile());
    String folderName=PathUtils.getFileNameWithoutExtension(path);
    if (!folderName.endsWith("String_Node_Str")) {
      folderName=folderName + "String_Node_Str";
    }
    if (virtualDirEx.exists(folderName)) {
      virtualPath=new VirtualPath(folderName,virtualDirEx);
    }
 else {
      virtualPath=new VirtualPath("String_Node_Str",virtualDirEx);
    }
  }
 else {
    virtualPath=new VirtualPath(path);
  }
  return virtualPath;
}
Program: 170367
Project: 170367
Buggy source:
/** 
 * Extract the source band index from the xml file.
 * @param metadataRoot the tree root element of the xml file
 * @param sourceBandName the band name
 * @return the band index
 */
private int extractSourceBandIndex(MetadataElement metadataRoot,String sourceBandName){
  String[] bandListPath={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  MetadataElement bandListElement=findTreeElement(metadataRoot,bandListPath);
  if (bandListElement != null) {
    for (int i=0; i < bandListElement.getNumAttributes(); i++) {
      MetadataAttribute metadataAttribute=bandListElement.getAttributeAt(i);
      ProductData data=metadataAttribute.getData();
      String bandName=data.getElemString();
      if (sourceBandName.equals(bandName)) {
        return i;
      }
    }
  }
  return -1;
}

Fixed version (ground truth):
/** 
 * Extract the source band index from the xml file.
 * @param metadataRoot the tree root element of the xml file
 * @param sourceBandName the band name
 * @return the band index
 */
private static int extractSourceBandIndex(MetadataElement metadataRoot,String sourceBandName){
  String[] bandListPath={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  MetadataElement bandListElement=findTreeElement(metadataRoot,bandListPath);
  if (bandListElement != null) {
    for (int i=0; i < bandListElement.getNumElements(); i++) {
      MetadataElement metadataElement=bandListElement.getElementAt(i);
      MetadataAttribute metadataAttribute=metadataElement.getAttribute("String_Node_Str");
      ProductData data=metadataAttribute.getData();
      String bandName=data.getElemString();
      if (sourceBandName.equals(bandName)) {
        MetadataAttribute bandIdAttribute=metadataElement.getAttribute("String_Node_Str");
        ProductData bandIdData=bandIdAttribute.getData();
        String bandIdAsString=bandIdData.getElemString();
        return Integer.parseInt(bandIdAsString);
      }
    }
  }
  return -1;
}
Program: 170368
Project: 170368
Buggy source:
String getCompressor(){
  return String.format("String_Node_Str",directory,File.separator,decompressor);
}

Fixed version (ground truth):
String getCompressor(){
  return Paths.get(directory,compressor).toString();
}
Program: 170369
Project: 170369
Buggy source:
String getDecompressor(){
  return String.format("String_Node_Str",directory,File.separator,decompressor);
}

Fixed version (ground truth):
String getDecompressor(){
  return Paths.get(directory,decompressor).toString();
}
Program: 170370
Project: 170370
Buggy source:
String getDump(){
  return String.format("String_Node_Str",directory,File.separator,dump);
}

Fixed version (ground truth):
String getDump(){
  return Paths.get(directory,dump).toString();
}
Program: 170371
Project: 170371
Buggy source:
public static Path getOpenJPEGAuxDataPath(){
  Path versionFile=ResourceInstaller.findModuleCodeBasePath(OpenJpegExecRetriever.class).resolve("String_Node_Str");
  Properties versionProp=new Properties();
  try (InputStream inputStream=Files.newInputStream(versionFile)){
    versionProp.load(inputStream);
  }
 catch (  IOException e) {
    SystemUtils.LOG.severe("String_Node_Str" + versionFile.toString());
    return null;
  }
  String version=versionProp.getProperty("String_Node_Str");
  if (version == null) {
    SystemUtils.LOG.severe("String_Node_Str" + versionFile.toString());
    return null;
  }
  return SystemUtils.getAuxDataPath().resolve("String_Node_Str").resolve(version);
}

Fixed version (ground truth):
public static Path getOpenJPEGAuxDataPath(){
  Path versionFile=ResourceInstaller.findModuleCodeBasePath(OpenJpegExecRetriever.class).resolve("String_Node_Str").resolve("String_Node_Str");
  Properties versionProp=new Properties();
  try (InputStream inputStream=Files.newInputStream(versionFile)){
    versionProp.load(inputStream);
  }
 catch (  IOException e) {
    SystemUtils.LOG.severe("String_Node_Str" + versionFile.toString());
    return null;
  }
  String version=versionProp.getProperty("String_Node_Str");
  if (version == null) {
    SystemUtils.LOG.severe("String_Node_Str" + versionFile.toString());
    return null;
  }
  return SystemUtils.getAuxDataPath().resolve("String_Node_Str").resolve(version);
}