nus-yam/ex-repair huggingface dataset:
Program: 26395
Project: 26395
Buggy source:
public TernCompletionProposal(String name,String type,String origin,Object doc,int pos,int startOffset){
  super(name,type,origin);
  String text=super.getText();
  this.fReplacementString=text;
  this.fReplacementOffset=startOffset - pos;
  this.fReplacementLength=pos;
  this.fCursorPosition=text.length();
  this.fImage=null;
  this.fDisplayString=text;
  this.fContextInformation=null;
  this.fAdditionalProposalInfo=doc != null ? doc.toString() : null;
}

Fixed version (ground truth):
public TernCompletionProposal(String name,String type,String origin,Object doc,int pos,int startOffset){
  super(name,type,origin);
  String text=super.getSignature();
  this.fReplacementString=text;
  this.fReplacementOffset=startOffset - pos;
  this.fReplacementLength=pos;
  this.fCursorPosition=text.length();
  this.fImage=null;
  this.fDisplayString=super.getText();
  this.fContextInformation=null;
  this.fAdditionalProposalInfo=doc != null ? doc.toString() : null;
}
Program: 26396
Project: 26396
Buggy source:
private Section getFreeSection(int requiredLength){
  int start=0;
  int length=0;
  int closestStart=0;
  int closestLength=Integer.MAX_VALUE;
  int i;
  for (i=2; i < this.filledSectorArray.size(); i++) {
    if (this.filledSectorArray.get(i)) {
      if (length >= requiredLength) {
        if (length < closestLength) {
          closestLength=length;
          closestStart=start;
          if (closestLength == requiredLength) {
            break;
          }
        }
        length=0;
      }
    }
 else {
      if (length == 0) {
        start=i;
      }
      length++;
    }
  }
  if (closestStart <= 0) {
    closestStart=i;
  }
  return (closestStart != 0) ? new Section(closestStart,requiredLength) : null;
}

Fixed version (ground truth):
private Section getFreeSection(int requiredLength){
  int start=0;
  int length=0;
  int closestStart=0;
  int closestLength=Integer.MAX_VALUE;
  int i;
  for (i=2; i < this.filledSectorArray.size(); i++) {
    if (this.filledSectorArray.get(i)) {
      if ((length >= requiredLength) && (length < closestLength)) {
        closestLength=length;
        closestStart=start;
        if (closestLength == requiredLength) {
          break;
        }
      }
      length=0;
    }
 else {
      if (length == 0) {
        start=i;
      }
      length++;
    }
  }
  if (closestStart <= 0) {
    closestStart=i;
  }
  return new Section(closestStart,requiredLength);
}
Program: 26397
Project: 26397
Buggy source:
public void loadConfig(){
  this.config.load();
  this.teleportEnabled=this.config.getOrSetBoolean(catOptions,"String_Node_Str",this.teleportEnabled);
  this.chunksPerTick=this.config.getOrSetInt(catOptions,"String_Node_Str",this.chunksPerTick,1,64);
  this.teleportCommand=this.config.get(catOptions,"String_Node_Str",this.teleportCommand).getString();
  this.coordsEnabled=this.config.getOrSetBoolean(catOptions,"String_Node_Str",this.coordsEnabled);
  maxZoom=this.config.getOrSetInt(catOptions,"String_Node_Str",maxZoom,1,256);
  minZoom=-this.config.getOrSetInt(catOptions,"String_Node_Str",-minZoom,1,256);
  this.configTextureSize=this.config.getOrSetInt(catOptions,"String_Node_Str",this.configTextureSize,1024,8192);
  this.setTextureSize();
  File worldConfigFile=new File(this.worldDir,worldDirConfigName);
  this.worldConfig=new MwConfig(worldConfigFile);
  this.worldConfig.load();
  this.dimensionList.clear();
  this.worldConfig.getIntList(catWorld,"String_Node_Str",this.dimensionList);
  this.addDimension(0);
  this.cleanDimensionList();
}

Fixed version (ground truth):
public void loadConfig(){
  this.config.load();
  this.linearTextureScalingEnabled=this.config.getOrSetBoolean(catOptions,"String_Node_Str",true);
  this.teleportEnabled=this.config.getOrSetBoolean(catOptions,"String_Node_Str",this.teleportEnabled);
  this.chunksPerTick=this.config.getOrSetInt(catOptions,"String_Node_Str",this.chunksPerTick,1,64);
  this.teleportCommand=this.config.get(catOptions,"String_Node_Str",this.teleportCommand).getString();
  this.coordsEnabled=this.config.getOrSetBoolean(catOptions,"String_Node_Str",this.coordsEnabled);
  this.overlayModeIndex=this.config.getOrSetInt(catOptions,"String_Node_Str",this.overlayModeIndex,0,1000);
  maxZoom=this.config.getOrSetInt(catOptions,"String_Node_Str",maxZoom,1,256);
  minZoom=-this.config.getOrSetInt(catOptions,"String_Node_Str",-minZoom,1,256);
  this.configTextureSize=this.config.getOrSetInt(catOptions,"String_Node_Str",this.configTextureSize,1024,8192);
  this.setTextureSize();
  File worldConfigFile=new File(this.worldDir,worldDirConfigName);
  this.worldConfig=new MwConfig(worldConfigFile);
  this.worldConfig.load();
  this.dimensionList.clear();
  this.worldConfig.getIntList(catWorld,"String_Node_Str",this.dimensionList);
  this.addDimension(0);
  this.cleanDimensionList();
}
Program: 26398
Project: 26398
Buggy source:
public void reloadMapTexture(){
  this.regionManager.close();
  this.executor.close();
  MapTexture oldMapTexture=this.mapTexture;
  this.mapTexture=new MapTexture(this.textureSize);
  if (oldMapTexture != null) {
    oldMapTexture.close();
  }
  this.executor=new BackgroundExecutor();
  this.regionManager=new RegionManager(this,this.multiplayer);
}

Fixed version (ground truth):
public void reloadMapTexture(){
  this.regionManager.close();
  this.executor.close();
  MapTexture oldMapTexture=this.mapTexture;
  this.mapTexture=new MapTexture(this.textureSize,this.linearTextureScalingEnabled);
  if (oldMapTexture != null) {
    oldMapTexture.close();
  }
  this.executor=new BackgroundExecutor();
  this.regionManager=new RegionManager(this,this.multiplayer);
}
Program: 26399
Project: 26399
Buggy source:
public void saveConfig(){
  this.worldConfig.setIntList(catWorld,"String_Node_Str",this.dimensionList);
  this.config.setBoolean(catOptions,"String_Node_Str",this.linearTextureScalingEnabled);
  this.config.setInt(catOptions,"String_Node_Str",this.configTextureSize);
  this.config.setBoolean(catOptions,"String_Node_Str",this.coordsEnabled);
  this.config.save();
  this.worldConfig.save();
}

Fixed version (ground truth):
public void saveConfig(){
  this.worldConfig.setIntList(catWorld,"String_Node_Str",this.dimensionList);
  this.config.setBoolean(catOptions,"String_Node_Str",this.linearTextureScalingEnabled);
  this.config.setInt(catOptions,"String_Node_Str",this.configTextureSize);
  this.config.setBoolean(catOptions,"String_Node_Str",this.coordsEnabled);
  this.config.setInt(catOptions,"String_Node_Str",this.overlayModeIndex);
  this.config.save();
  this.worldConfig.save();
}
Program: 26400
Project: 26400
Buggy source:
public void onClientLoggedIn(Packet1Login login){
  MwUtil.log("String_Node_Str",login.dimension);
  this.worldName=this.getWorldName();
  if (this.multiplayer) {
    this.worldDir=new File(new File(this.saveDir,"String_Node_Str"),this.worldName);
  }
 else {
    this.worldDir=new File(this.saveDir,this.worldName);
  }
  this.imageDir=new File(this.worldDir,"String_Node_Str");
  if (!this.imageDir.exists()) {
    this.imageDir.mkdirs();
  }
  if (!this.imageDir.isDirectory()) {
    MwUtil.log("String_Node_Str",this.imageDir.getPath());
  }
  for (int i=1; i <= this.maxZoom; i++) {
    File zDir=new File(imageDir,"String_Node_Str" + i);
    zDir.mkdirs();
  }
  this.tickCounter=0;
  this.loadConfig();
  this.markerManager=new MarkerManager(this);
  this.markerManager.load(this.worldConfig,this.catMarkers);
  this.playerTrail=new Trail(this,"String_Node_Str");
  this.executor=new BackgroundExecutor();
  this.mapTexture=new MapTexture(this.textureSize);
  this.blockColours=BlockColourGen.genBlockColours(this,this.config);
  this.regionManager=new RegionManager(this,this.multiplayer);
  this.overlayManager=new OverlayManager(this,this.mapTexture);
  this.overlayManager.overlayView.setDimension(login.dimension);
  this.ready=true;
}

Fixed version (ground truth):
public void onClientLoggedIn(Packet1Login login){
  MwUtil.log("String_Node_Str",login.dimension);
  this.worldName=this.getWorldName();
  if (this.multiplayer) {
    this.worldDir=new File(new File(this.saveDir,"String_Node_Str"),this.worldName);
  }
 else {
    this.worldDir=new File(this.saveDir,this.worldName);
  }
  this.imageDir=new File(this.worldDir,"String_Node_Str");
  if (!this.imageDir.exists()) {
    this.imageDir.mkdirs();
  }
  if (!this.imageDir.isDirectory()) {
    MwUtil.log("String_Node_Str",this.imageDir.getPath());
  }
  for (int i=1; i <= this.maxZoom; i++) {
    File zDir=new File(imageDir,"String_Node_Str" + i);
    zDir.mkdirs();
  }
  this.tickCounter=0;
  this.loadConfig();
  this.markerManager=new MarkerManager(this);
  this.markerManager.load(this.worldConfig,this.catMarkers);
  this.playerTrail=new Trail(this,"String_Node_Str");
  this.executor=new BackgroundExecutor();
  this.mapTexture=new MapTexture(this.textureSize,this.linearTextureScalingEnabled);
  this.blockColours=BlockColourGen.genBlockColours(this,this.config);
  this.regionManager=new RegionManager(this,this.multiplayer);
  this.overlayManager=new OverlayManager(this,this.mapTexture);
  this.overlayManager.overlayView.setDimension(login.dimension);
  this.ready=true;
}
Program: 26402
Project: 26402
Buggy source:
public MapTexture(int textureSize){
  super(textureSize,textureSize,0xff000000,GL11.GL_LINEAR,GL11.GL_LINEAR,GL11.GL_REPEAT);
  this.textureRegions=textureSize >> Mw.REGION_SHIFT;
  this.textureSize=textureSize;
  this.regionArray=new Region[this.textureRegions * this.textureRegions];
}

Fixed version (ground truth):
public MapTexture(int textureSize,boolean linearScaling){
  super(textureSize,textureSize,0xff000000,GL11.GL_LINEAR,GL11.GL_LINEAR,GL11.GL_REPEAT);
  this.setLinearScaling(linearScaling);
  this.textureRegions=textureSize >> Mw.REGION_SHIFT;
  this.textureSize=textureSize;
  this.regionArray=new Region[this.textureRegions * this.textureRegions];
}
Program: 26403
Project: 26403
Buggy source:
public OverlayManager(Mw mw,MapTexture mapTexture){
  this.mw=mw;
  this.mapTexture=mapTexture;
  this.smallMapMode=new SmallMapMode(this.mw.config);
  this.overlayView=new MapView();
  this.overlayView.setZoomLevel(-1);
  this.smallMap=new StandardMapRenderer(mw,this.mapTexture,this.mw.markerManager,this.smallMapMode,this.overlayView);
  this.largeMapMode=new LargeMapMode(this.mw.config);
  this.largeMap=new StandardMapRenderer(mw,this.mapTexture,this.mw.markerManager,this.largeMapMode,this.overlayView);
  this.undergroundMapMode=new UndergroundMapMode(this.mw.config);
  this.undergroundMap=new UndergroundMapRenderer(mw,this.undergroundMapMode);
  this.mapList=new ArrayList<MapRenderer>();
  this.mapList.add(null);
  this.mapList.add(this.smallMap);
  this.mapList.add(this.largeMap);
  this.mapList.add(this.undergroundMap);
  this.mapListIndex=0;
  this.nextOverlayMode(1);
}

Fixed version (ground truth):
public OverlayManager(Mw mw,MapTexture mapTexture){
  this.mw=mw;
  this.mapTexture=mapTexture;
  this.smallMapMode=new SmallMapMode(this.mw.config);
  this.overlayView=new MapView();
  this.overlayView.setZoomLevel(-1);
  this.smallMap=new StandardMapRenderer(mw,this.mapTexture,this.mw.markerManager,this.smallMapMode,this.overlayView);
  this.largeMapMode=new LargeMapMode(this.mw.config);
  this.largeMap=new StandardMapRenderer(mw,this.mapTexture,this.mw.markerManager,this.largeMapMode,this.overlayView);
  this.undergroundMapMode=new UndergroundMapMode(this.mw.config);
  this.undergroundMap=new UndergroundMapRenderer(mw,this.undergroundMapMode);
  this.mapList=new ArrayList<MapRenderer>();
  if (this.smallMapMode.enabled) {
    this.mapList.add(this.smallMap);
  }
  if (this.largeMapMode.enabled) {
    this.mapList.add(this.largeMap);
  }
  if (this.undergroundMapMode.enabled) {
    this.mapList.add(this.undergroundMap);
  }
  this.mapList.add(null);
  this.nextOverlayMode(0);
  this.currentMap=this.mapList.get(this.mw.overlayModeIndex);
}
Program: 26404
Project: 26404
Buggy source:
public MapRenderer nextOverlayMode(int increment){
  int size=this.mapList.size();
  this.mapListIndex=(this.mapListIndex + size + increment) % size;
  this.currentMap=this.mapList.get(this.mapListIndex);
  return this.currentMap;
}

Fixed version (ground truth):
public MapRenderer nextOverlayMode(int increment){
  int size=this.mapList.size();
  this.mw.overlayModeIndex=(this.mw.overlayModeIndex + size + increment) % size;
  this.currentMap=this.mapList.get(this.mw.overlayModeIndex);
  return this.currentMap;
}
Program: 26405
Project: 26405
Buggy source:
public static void disableStencil(){
  GL11.glDepthFunc(GL11.GL_LEQUAL);
  GL11.glDisable(GL11.GL_DEPTH_TEST);
}

Fixed version (ground truth):
public static void disableStencil(){
  GL11.glDepthMask(true);
  GL11.glDepthFunc(GL11.GL_LEQUAL);
  GL11.glDisable(GL11.GL_DEPTH_TEST);
}
Program: 26406
Project: 26406
Buggy source:
public static void setCircularStencil(double x,double y,double r){
  GL11.glEnable(GL11.GL_DEPTH_TEST);
  GL11.glColorMask(false,false,false,false);
  GL11.glDepthMask(true);
  GL11.glClearDepth(3000.0);
  GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
  GL11.glDepthFunc(GL11.GL_ALWAYS);
  Render.setColour(0xffffffff);
  Render.zDepth=1000.0;
  Render.drawCircle(x,y,r);
  Render.zDepth=0.0;
  GL11.glColorMask(true,true,true,true);
  GL11.glDepthMask(false);
  GL11.glDepthFunc(GL11.GL_GREATER);
}

Fixed version (ground truth):
public static void setCircularStencil(double x,double y,double r){
  GL11.glEnable(GL11.GL_DEPTH_TEST);
  GL11.glColorMask(false,false,false,false);
  GL11.glDepthMask(true);
  GL11.glDepthFunc(GL11.GL_ALWAYS);
  Render.setColour(0xffffffff);
  Render.zDepth=1000.0;
  Render.drawCircle(x,y,r);
  Render.zDepth=0.0;
  GL11.glColorMask(true,true,true,true);
  GL11.glDepthMask(false);
  GL11.glDepthFunc(GL11.GL_GREATER);
}
Program: 26407
Project: 26407
Buggy source:
public void draw(){
  int regionZoomLevel=Math.max(0,this.mapView.getZoomLevel());
  double tSize=(double)(this.mw.mapTexture.textureSize << regionZoomLevel);
  double u=(this.mapView.getMinX() % tSize) / tSize;
  double v=(this.mapView.getMinZ() % tSize) / tSize;
  double w=this.mapView.getWidth() / tSize;
  double h=this.mapView.getHeight() / tSize;
  GL11.glPushMatrix();
  GL11.glLoadIdentity();
  GL11.glTranslatef((float)this.mapMode.xTranslation,(float)this.mapMode.yTranslation,-2000.0f);
  if (this.mapMode.rotate) {
    GL11.glRotatef((float)this.mw.mapRotationDegrees,0.0f,0.0f,1.0f);
  }
  if (this.mapMode.circular) {
    Render.setCircularStencil(0,0,this.mapMode.h / 2.0);
  }
  Render.setColourWithAlphaPercent(0xffffff,this.mapMode.alphaPercent);
  this.mw.mapTexture.bind();
  Render.drawTexturedRect(this.mapMode.x,this.mapMode.y,this.mapMode.w,this.mapMode.h,u,v,u + w,v + h);
  Render.disableStencil();
  this.drawBorder(this.mapMode);
  this.mw.markerManager.drawMarkers(this.mapMode,this.mapView);
  if (this.mw.playerTrail.enabled) {
    this.mw.playerTrail.draw(this.mapMode,this.mapView);
  }
  Point.Double arrow=this.getPlayerArrowPos();
  Render.setColour(this.mapMode.playerArrowColour);
  Render.drawArrow(arrow.x,arrow.y,this.mw.playerHeading,this.mapMode.playerArrowSize);
  GL11.glLoadIdentity();
  GL11.glTranslatef((float)this.mapMode.xTranslation,(float)this.mapMode.yTranslation,-2000.0f);
  drawCoords(this.mw,this.mapMode);
  GL11.glPopMatrix();
}

Fixed version (ground truth):
public void draw(){
  int regionZoomLevel=Math.max(0,this.mapView.getZoomLevel());
  double tSize=(double)(this.mw.mapTexture.textureSize << regionZoomLevel);
  double u=(this.mapView.getMinX() % tSize) / tSize;
  double v=(this.mapView.getMinZ() % tSize) / tSize;
  double w=this.mapView.getWidth() / tSize;
  double h=this.mapView.getHeight() / tSize;
  GL11.glPushMatrix();
  GL11.glLoadIdentity();
  GL11.glTranslatef((float)this.mapMode.xTranslation,(float)this.mapMode.yTranslation,-2000.0f);
  if (this.mapMode.rotate) {
    GL11.glRotatef((float)this.mw.mapRotationDegrees,0.0f,0.0f,1.0f);
  }
  if (this.mapMode.circular) {
    Render.setCircularStencil(0,0,this.mapMode.h / 2.0);
  }
  Render.setColourWithAlphaPercent(0xffffff,this.mapMode.alphaPercent);
  this.mw.mapTexture.bind();
  Render.drawTexturedRect(this.mapMode.x,this.mapMode.y,this.mapMode.w,this.mapMode.h,u,v,u + w,v + h);
  if (this.mapMode.circular) {
    Render.disableStencil();
  }
  this.drawBorder(this.mapMode);
  this.mw.markerManager.drawMarkers(this.mapMode,this.mapView);
  if (this.mw.playerTrail.enabled) {
    this.mw.playerTrail.draw(this.mapMode,this.mapView);
  }
  Point.Double arrow=this.getPlayerArrowPos();
  Render.setColour(this.mapMode.playerArrowColour);
  Render.drawArrow(arrow.x,arrow.y,this.mw.playerHeading,this.mapMode.playerArrowSize);
  GL11.glLoadIdentity();
  GL11.glTranslatef((float)this.mapMode.xTranslation,(float)this.mapMode.yTranslation,-2000.0f);
  drawCoords(this.mw,this.mapMode);
  GL11.glEnable(GL11.GL_DEPTH_TEST);
  GL11.glPopMatrix();
}
Program: 26408
Project: 26408
Buggy source:
public void draw(){
  double tu1=(this.viewX % 16.0) / 16.0;
  double tv1=(this.viewZ % 16.0) / 16.0;
  double tu2=tu1 + (this.viewW / 16.0);
  double tv2=tv1 + (this.viewH / 16.0);
  GL11.glPushMatrix();
  GL11.glLoadIdentity();
  GL11.glTranslatef((float)this.mapMode.xTranslation,(float)this.mapMode.yTranslation,-2000.0f);
  if (this.mapMode.rotate) {
    GL11.glRotatef((float)this.mw.mapRotationDegrees,0.0f,0.0f,1.0f);
  }
  if (this.mapMode.circular) {
    Render.setCircularStencil(0,0,this.mapMode.h / 2.0);
  }
  Render.setColourWithAlphaPercent(0xffffff,this.mapMode.alphaPercent);
  this.undergroundTexture.bind();
  Render.drawTexturedRect(this.mapMode.x,this.mapMode.y,this.mapMode.w,this.mapMode.h,tu1,tv1,tu2,tv2);
  Render.disableStencil();
  StandardMapRenderer.drawBorder(this.mapMode);
  double arrowX=this.mapMode.x + this.mapMode.w / 2;
  double arrowZ=this.mapMode.y + this.mapMode.h / 2;
  Render.setColour(this.mapMode.playerArrowColour);
  Render.drawArrow(arrowX,arrowZ,this.mw.playerHeading,this.mapMode.playerArrowSize);
  GL11.glLoadIdentity();
  GL11.glTranslatef((float)this.mapMode.xTranslation,(float)this.mapMode.yTranslation,-2000.0f);
  StandardMapRenderer.drawCoords(this.mw,this.mapMode);
  GL11.glPopMatrix();
}

Fixed version (ground truth):
public void draw(){
  double tu1=(this.viewX % 16.0) / 16.0;
  double tv1=(this.viewZ % 16.0) / 16.0;
  double tu2=tu1 + (this.viewW / 16.0);
  double tv2=tv1 + (this.viewH / 16.0);
  GL11.glPushMatrix();
  GL11.glLoadIdentity();
  GL11.glTranslatef((float)this.mapMode.xTranslation,(float)this.mapMode.yTranslation,-2000.0f);
  if (this.mapMode.rotate) {
    GL11.glRotatef((float)this.mw.mapRotationDegrees,0.0f,0.0f,1.0f);
  }
  if (this.mapMode.circular) {
    Render.setCircularStencil(0,0,this.mapMode.h / 2.0);
  }
  Render.setColourWithAlphaPercent(0xffffff,this.mapMode.alphaPercent);
  this.undergroundTexture.bind();
  Render.drawTexturedRect(this.mapMode.x,this.mapMode.y,this.mapMode.w,this.mapMode.h,tu1,tv1,tu2,tv2);
  if (this.mapMode.circular) {
    Render.disableStencil();
  }
  StandardMapRenderer.drawBorder(this.mapMode);
  double arrowX=this.mapMode.x + this.mapMode.w / 2;
  double arrowZ=this.mapMode.y + this.mapMode.h / 2;
  Render.setColour(this.mapMode.playerArrowColour);
  Render.drawArrow(arrowX,arrowZ,this.mw.playerHeading,this.mapMode.playerArrowSize);
  GL11.glLoadIdentity();
  GL11.glTranslatef((float)this.mapMode.xTranslation,(float)this.mapMode.yTranslation,-2000.0f);
  StandardMapRenderer.drawCoords(this.mw,this.mapMode);
  GL11.glEnable(GL11.GL_DEPTH_TEST);
  GL11.glPopMatrix();
}
Program: 26409
Project: 26409
Buggy source:
public boolean applyChangeParam(){
  if (request == null || request.length == 0) {
    BurpCallbacks.getInstance().print("String_Node_Str");
    return false;
  }
  if (origParam == null) {
    BurpCallbacks.getInstance().print("String_Node_Str");
    return false;
  }
  byte paramType=changeParam.getType();
switch (paramType) {
case SentinelHttpParam.PARAM_PATH:
    request=updateParameterPath(request,changeParam);
  break;
case SentinelHttpParam.PARAM_JSON:
request=updateParameterJSON(request,changeParam);
break;
case SentinelHttpParam.PARAM_BODY:
case SentinelHttpParam.PARAM_URL:
case SentinelHttpParam.PARAM_COOKIE:
request=BurpCallbacks.getInstance().getBurp().getHelpers().updateParameter(request,changeParam);
break;
default :
request=updateParameterJSON(request,changeParam);
return false;
}
requestInfo=BurpCallbacks.getInstance().getBurp().getHelpers().analyzeRequest(httpService,request);
for (IParameter newParam : requestInfo.getParameters()) {
if (changeParam.isThisParameter(newParam)) {
changeParam.updateLocationWith(newParam);
}
}
init();
return true;
}

Fixed version (ground truth):
public boolean applyChangeParam(){
  if (request == null || request.length == 0) {
    BurpCallbacks.getInstance().print("String_Node_Str");
    return false;
  }
  if (origParam == null) {
    BurpCallbacks.getInstance().print("String_Node_Str");
    return false;
  }
  byte paramType=changeParam.getType();
switch (paramType) {
case SentinelHttpParam.PARAM_PATH:
    request=updateParameterPath(request,changeParam);
  break;
case SentinelHttpParam.PARAM_JSON:
request=updateParameterJSON(request,changeParam);
break;
case SentinelHttpParam.PARAM_BODY:
case SentinelHttpParam.PARAM_URL:
case SentinelHttpParam.PARAM_COOKIE:
request=BurpCallbacks.getInstance().getBurp().getHelpers().updateParameter(request,changeParam);
break;
default :
request=updateParameterJSON(request,changeParam);
return true;
}
requestInfo=BurpCallbacks.getInstance().getBurp().getHelpers().analyzeRequest(httpService,request);
for (IParameter newParam : requestInfo.getParameters()) {
if (changeParam.isThisParameter(newParam)) {
changeParam.updateLocationWith(newParam);
}
}
init();
return true;
}
Program: 26410
Project: 26410
Buggy source:
private byte[] updateParameterJSON(byte[] request,SentinelHttpParam changeParam){
  String req=BurpCallbacks.getInstance().getBurp().getHelpers().bytesToString(request);
  StringBuilder r=new StringBuilder(req);
  r.replace(changeParam.getValueStart(),changeParam.getValueEnd(),changeParam.getValue());
  return BurpCallbacks.getInstance().getBurp().getHelpers().stringToBytes(r.toString());
}

Fixed version (ground truth):
private byte[] updateParameterJSON(byte[] request,SentinelHttpParam changeParam){
  String req=BurpCallbacks.getInstance().getBurp().getHelpers().bytesToString(request);
  StringBuilder r=new StringBuilder(req);
  r.replace(origParam.getValueStart(),origParam.getValueEnd(),changeParam.getValue());
  return BurpCallbacks.getInstance().getBurp().getHelpers().stringToBytes(r.toString());
}
Program: 26412
Project: 26412
Buggy source:
@Override public boolean performNextAttack(){
  boolean doContinue=false;
  AttackData data=attackData.get(state);
  SentinelHttpMessage httpMessage;
  try {
    httpMessage=attack(data);
  }
 catch (  ConnectionTimeoutException ex) {
    state++;
    return false;
  }
switch (state) {
case 0:
    doContinue=true;
  if (checkTag(httpMessage.getRes().getResponseStr(),XssIndicator.getInstance().getBaseIndicator())) {
    inputReflectedInTag=true;
  }
 else {
    inputReflectedInTag=false;
  }
break;
case 14:
doContinue=false;
break;
default :
doContinue=true;
break;
}
state++;
return doContinue;
}

Fixed version (ground truth):
@Override public boolean performNextAttack(){
  boolean doContinue=false;
  AttackData data=attackData.get(state);
  SentinelHttpMessage httpMessage;
  try {
    httpMessage=attack(data);
  }
 catch (  ConnectionTimeoutException ex) {
    state++;
    return false;
  }
switch (state) {
case 0:
    doContinue=true;
  if (checkTag(httpMessage.getRes().getResponseStr(),XssIndicator.getInstance().getBaseIndicator())) {
    inputReflectedInTag=true;
  }
 else {
    inputReflectedInTag=false;
  }
break;
case 11:
doContinue=false;
break;
default :
doContinue=true;
break;
}
state++;
return doContinue;
}
Program: 26414
Project: 26414
Buggy source:
public String getMessageDiffString(LinkedList<TidyMessage> origList,LinkedList<TidyMessage> currList){
  String ret="String_Node_Str";
  LinkedList<TidyMessage> diffList=new LinkedList<TidyMessage>();
  for (  TidyMessage curr : currList) {
    boolean found=false;
    for (    TidyMessage orig : origList) {
      if (orig.getLine() == curr.getLine()) {
        found=true;
        break;
      }
    }
    if (!found) {
      diffList.add(curr);
    }
  }
  for (  TidyMessage diff : diffList) {
    ret+=StringEscapeUtils.escapeHtml4(diff.getMessage()) + "String_Node_Str";
  }
  return ret;
}

Fixed version (ground truth):
public String getMessageDiffString(LinkedList<TidyMessage> origList,LinkedList<TidyMessage> currList){
  String ret="String_Node_Str";
  LinkedList<TidyMessage> diffList=new LinkedList<TidyMessage>();
  for (  TidyMessage curr : currList) {
    boolean found=false;
    for (    TidyMessage orig : origList) {
      if (orig.getErrorCode() == curr.getErrorCode()) {
        found=true;
        break;
      }
    }
    if (!found) {
      diffList.add(curr);
    }
  }
  for (  TidyMessage diff : diffList) {
    ret+=Integer.toString(diff.getLine()) + "String_Node_Str" + StringEscapeUtils.escapeHtml4(diff.getMessage())+ "String_Node_Str";
  }
  return ret;
}
Program: 26415
Project: 26415
Buggy source:
@Override public void update(Observable o,Object arg){
  if (o.getClass().equals(CategorizerManager.class)) {
    this.fireTableDataChanged();
  }
}

Fixed version (ground truth):
@Override public void update(Observable o,Object arg){
  if (o.getClass().equals(CategorizerManager.class)) {
    this.fireTableDataChanged();
  }
 else {
    this.fireTableDataChanged();
  }
}
Program: 26416
Project: 26416
Buggy source:
void addMessage(SentinelHttpMessageAtk httpMessage){
  messages.add(httpMessage);
  httpMessage.setTableIndexAttack(messages.size() - 1);
  httpMessage.addObserver(this);
  this.fireTableDataChanged();
}

Fixed version (ground truth):
void addMessage(SentinelHttpMessageAtk httpMessage){
  messages.add(httpMessage);
  httpMessage.setTableIndexAttack(messages.size() - 1);
  httpMessage.addObserver(this);
  httpMessage.getParentHttpMessage().addObserver(this);
  this.fireTableDataChanged();
}
Program: 26417
Project: 26417
Buggy source:
@Override public void setResponse(byte[] message){
  httpResponse=new SentinelHttpResponse(message);
}

Fixed version (ground truth):
@Override public void setResponse(byte[] message){
  httpResponse=new SentinelHttpResponse(message);
  notifyResponseContentChange();
}
Program: 26418
Project: 26418
Buggy source:
@Override public void update(Observable o,Object arg){
  this.fireTableDataChanged();
}

Fixed version (ground truth):
@Override public void update(Observable o,Object arg){
  this.fireTableDataChanged();
  parent.setUpdateCurrentSelected();
}
Program: 26419
Project: 26419
Buggy source:
@Override public boolean performNextAttack(){
  boolean doContinue=false;
  if (initialMessage == null || initialMessage.getRequest() == null) {
    Logger.getLogger(this.getClass().getName()).log(Level.SEVERE,"String_Node_Str");
  }
  if (initialMessage.getReq().getChangeParam() == null) {
  }
  ListManagerList list=ListManager.getInstance().getModel().getList(Integer.parseInt(attackData));
  String data=list.getContent().get(state);
  data=data.replace("String_Node_Str",XssIndicator.getInstance().getIndicator());
  try {
    SentinelHttpMessage httpMessage=attack(data);
  }
 catch (  ConnectionTimeoutException ex) {
    state++;
    return false;
  }
  if (state < list.getContent().size() - 1) {
    doContinue=true;
  }
 else {
    doContinue=false;
  }
  state++;
  return doContinue;
}

Fixed version (ground truth):
@Override public boolean performNextAttack(){
  boolean doContinue=false;
  if (initialMessage == null || initialMessage.getRequest() == null) {
    BurpCallbacks.getInstance().print("String_Node_Str");
    return false;
  }
  if (initialMessage.getReq().getChangeParam() == null) {
  }
  ListManagerList list=ListManager.getInstance().getModel().getList(Integer.parseInt(attackData));
  if (list == null) {
    BurpCallbacks.getInstance().print("String_Node_Str" + attackData + "String_Node_Str"+ state);
    return false;
  }
  String data=list.getContent().get(state);
  if (data == null || data.length() == 0) {
    BurpCallbacks.getInstance().print("String_Node_Str" + attackData + "String_Node_Str"+ state);
    return false;
  }
  data=data.replace("String_Node_Str",XssIndicator.getInstance().getIndicator());
  try {
    SentinelHttpMessage httpMessage=attack(data);
  }
 catch (  ConnectionTimeoutException ex) {
    BurpCallbacks.getInstance().print("String_Node_Str" + ex.getLocalizedMessage());
    return false;
  }
  if (state < list.getContent().size() - 1) {
    doContinue=true;
  }
 else {
    doContinue=false;
  }
  state++;
  return doContinue;
}
Program: 26420
Project: 26420
Buggy source:
void resetAttackSelection(){
  for (  PanelLeftTableUIEntry entry : uiEntries) {
    entry.isAllEnabled=false;
    entry.isSqlEnabled=false;
    entry.isOtherEnabled=false;
    entry.isAllEnabled=false;
    entry.isAuthEnabled=false;
    entry.authData=null;
  }
}

Fixed version (ground truth):
void resetAttackSelection(){
  for (  PanelLeftTableUIEntry entry : uiEntries) {
    entry.isAllEnabled=false;
    entry.isSqlEnabled=false;
    entry.isOtherEnabled=false;
    entry.isAllEnabled=false;
    entry.isAuthEnabled=false;
    entry.authData=null;
  }
  this.fireTableDataChanged();
}
Program: 26421
Project: 26421
Buggy source:
public ListManagerList(String s,String contentAsString){
  this(s);
  String c[]=contentAsString.split("String_Node_Str");
  for (int n=0; n < c.length; n++) {
    content.add(c[n]);
  }
}

Fixed version (ground truth):
public ListManagerList(String s,String contentAsString){
  this(s);
  String c[]=contentAsString.split("String_Node_Str");
  for (int n=0; n < c.length; n++) {
    if (c[n].length() > 0) {
      content.add(c[n]);
    }
  }
}
Program: 26422
Project: 26422
Buggy source:
private SentinelHttpMessage attack(String data) throws ConnectionTimeoutException {
  SentinelHttpMessageAtk httpMessage=initAttackHttpMessage(data);
  lastHttpMessage=httpMessage;
  BurpCallbacks.getInstance().sendRessource(httpMessage,attackWorkEntry.followRedirect);
  String response=httpMessage.getRes().getResponseStr();
  if (response.contains("String_Node_Str")) {
    AttackResult res=new AttackResult(AttackData.AttackType.VULN,"String_Node_Str" + state,httpMessage.getReq().getChangeParam(),true);
    httpMessage.addAttackResult(res);
    ResponseHighlight h=new ResponseHighlight("String_Node_Str",failColor);
    httpMessage.addHighlight(h);
  }
 else {
    AttackResult res=new AttackResult(AttackData.AttackType.NONE,"String_Node_Str" + state,httpMessage.getReq().getChangeParam(),false);
    httpMessage.addAttackResult(res);
  }
  return httpMessage;
}

Fixed version (ground truth):
private SentinelHttpMessage attack(String data) throws ConnectionTimeoutException {
  SentinelHttpMessageAtk httpMessage=initAttackHttpMessage(data);
  lastHttpMessage=httpMessage;
  BurpCallbacks.getInstance().sendRessource(httpMessage,attackWorkEntry.followRedirect);
  boolean hasError=false;
  ResponseCategory sqlResponseCategory=null;
  for (  ResponseCategory rc : httpMessage.getRes().getCategories()) {
    if (rc.getCategoryEntry().getTag().equals("String_Node_Str")) {
      hasError=true;
      sqlResponseCategory=rc;
      break;
    }
  }
  if (hasError) {
    AttackResult res=new AttackResult(AttackData.AttackType.VULN,"String_Node_Str" + state,httpMessage.getReq().getChangeParam(),true);
    httpMessage.addAttackResult(res);
    ResponseHighlight h=new ResponseHighlight(sqlResponseCategory.getIndicator(),failColor);
    httpMessage.addHighlight(h);
  }
 else {
    AttackResult res=new AttackResult(AttackData.AttackType.NONE,"String_Node_Str" + state,httpMessage.getReq().getChangeParam(),false);
    httpMessage.addAttackResult(res);
  }
  return httpMessage;
}
Program: 26423
Project: 26423
Buggy source:
public LinkedList<ResponseCategory> categorize(String input){
  LinkedList<ResponseCategory> categories=new LinkedList<ResponseCategory>();
  if (input == null || input.length() <= 0) {
    return categories;
  }
  LinkedList<CategoryEntry> categoryEntries=getCategories();
  for (  CategoryEntry entries : categoryEntries) {
    Pattern pattern=Pattern.compile(entries.getRegex());
    Matcher matcher=pattern.matcher(input);
    if (matcher.find()) {
      ResponseCategory c=new ResponseCategory(entries,matcher.group());
      categories.add(c);
    }
  }
  return categories;
}

Fixed version (ground truth):
public LinkedList<ResponseCategory> categorize(String input){
  LinkedList<ResponseCategory> categories=new LinkedList<ResponseCategory>();
  if (input == null || input.length() <= 0) {
    return categories;
  }
  for (  CategoryEntry entry : categorizerManagerUi.getCategories()) {
    categories.addAll(scanForRegex(entry,input));
  }
  for (  Map.Entry entry : staticCategories.entrySet()) {
    LinkedList<CategoryEntry> staticCategoriesEntry=(LinkedList<CategoryEntry>)entry.getValue();
    for (    CategoryEntry e : staticCategoriesEntry) {
      categories.addAll(scanForRegex(e,input));
    }
  }
  return categories;
}
Program: 26424
Project: 26424
Buggy source:
private void loadStaticCategories(){
  String[] fileNames={"String_Node_Str","String_Node_Str"};
  LinkedList<CategoryEntry> staticCategoryList;
  for (  String fileName : fileNames) {
    staticCategoryList=new LinkedList<CategoryEntry>();
    InputStream is=getClass().getResourceAsStream("String_Node_Str" + fileName + "String_Node_Str");
    BufferedReader reader=new BufferedReader(new InputStreamReader(is));
    String line;
    try {
      while ((line=reader.readLine()) != null) {
        String regex=line;
        CategoryEntry categoryEntry=new CategoryEntry(fileName,Pattern.quote(regex));
        staticCategoryList.add(categoryEntry);
      }
    }
 catch (    IOException ex) {
      BurpCallbacks.getInstance().print(ex.toString());
    }
    staticCategories.add(staticCategoryList);
  }
}

Fixed version (ground truth):
private void loadStaticCategories(){
  String[] fileNames={"String_Node_Str","String_Node_Str"};
  LinkedList<CategoryEntry> staticCategoryList;
  for (  String fileName : fileNames) {
    staticCategoryList=new LinkedList<CategoryEntry>();
    InputStream is=getClass().getResourceAsStream("String_Node_Str" + fileName + "String_Node_Str");
    BufferedReader reader=new BufferedReader(new InputStreamReader(is));
    String line;
    try {
      while ((line=reader.readLine()) != null) {
        String regex=line;
        CategoryEntry categoryEntry=new CategoryEntry(fileName,"String_Node_Str" + Pattern.quote(regex) + "String_Node_Str");
        staticCategoryList.add(categoryEntry);
      }
    }
 catch (    IOException ex) {
      BurpCallbacks.getInstance().print(ex.toString());
    }
    staticCategories.put(fileName,staticCategoryList);
  }
}
Program: 26425
Project: 26425
Buggy source:
@Override public void update(Observable o,Object arg){
  int selected=parent.getSelected();
  this.fireTableDataChanged();
  parent.setSelected(selected);
}

Fixed version (ground truth):
@Override public void update(Observable o,Object arg){
  this.fireTableDataChanged();
  parent.setSelected();
}
Program: 26427
Project: 26427
Buggy source:
@Override public void valueChanged(ListSelectionEvent e){
  if (e.getValueIsAdjusting())   return;
  ListSelectionModel lsm=(ListSelectionModel)e.getSource();
  if (lsm.isSelectionEmpty()) {
  }
 else {
    currentSelectedRow=lsm.getMinSelectionIndex();
    SentinelMainUi.getMainUi().showMessage(currentSelectedRow);
  }
}

Fixed version (ground truth):
@Override public void valueChanged(ListSelectionEvent e){
  if (e.getValueIsAdjusting())   return;
  ListSelectionModel lsm=(ListSelectionModel)e.getSource();
  if (lsm.isSelectionEmpty()) {
  }
 else {
    int oldSelected=currentSelectedRow;
    currentSelectedRow=lsm.getMinSelectionIndex();
    if (currentSelectedRow != oldSelected) {
      SentinelMainUi.getMainUi().showMessage(currentSelectedRow);
    }
  }
}
Program: 26428
Project: 26428
Buggy source:
@Override public void valueChanged(ListSelectionEvent e){
  if (e.getValueIsAdjusting())   return;
  ListSelectionModel lsm=(ListSelectionModel)e.getSource();
  if (lsm.isSelectionEmpty()) {
  }
 else {
    int newSelectedRow=lsm.getMinSelectionIndex();
    if (newSelectedRow != currentSelectedRow) {
      viewHttpMessage(currentSelectedRow);
    }
    currentSelectedRow=newSelectedRow;
    tableMessages.getSelectionModel().setSelectionInterval(currentSelectedRow,currentSelectedRow);
  }
}

Fixed version (ground truth):
@Override public void valueChanged(ListSelectionEvent e){
  if (e.getValueIsAdjusting())   return;
  ListSelectionModel lsm=(ListSelectionModel)e.getSource();
  if (lsm.isSelectionEmpty()) {
  }
 else {
    int oldSelectedRow=currentSelectedRow;
    currentSelectedRow=lsm.getMinSelectionIndex();
    if (oldSelectedRow != currentSelectedRow) {
      viewHttpMessage(currentSelectedRow);
      tableMessages.getSelectionModel().setSelectionInterval(currentSelectedRow,currentSelectedRow);
    }
  }
}
Program: 26429
Project: 26429
Buggy source:
public void viewHttpMessage(int n){
  try {
    panelViewMessage.setHttpMessage(panelRightModel.getHttpMessage(n));
  }
 catch (  Exception ex) {
    BurpCallbacks.getInstance().print(ex.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public void viewHttpMessage(int n){
  try {
    BurpCallbacks.getInstance().print("String_Node_Str" + n);
    panelViewMessage.setHttpMessage(panelRightModel.getHttpMessage(n));
  }
 catch (  Exception ex) {
    BurpCallbacks.getInstance().print(ex.getLocalizedMessage());
  }
}
Program: 26431
Project: 26431
Buggy source:
private void reInit(){
  if (httpMessage.getRes().hasResponse()) {
    labelSize.setText(Integer.toString(httpMessage.getRes().getSize()));
    labelHttpCode.setText(httpMessage.getRes().getHttpCode());
    labelDom.setText(Integer.toString(httpMessage.getRes().getDom()));
    if (httpMessage instanceof SentinelHttpMessageOrig) {
      panelViewComboboxModel.hasParent(false);
    }
 else {
      panelViewComboboxModel.hasParent(true);
      SentinelHttpMessageAtk atk=(SentinelHttpMessageAtk)httpMessage;
      labelRedirected.setText(atk.isRedirected() ? "String_Node_Str" : "String_Node_Str");
    }
    viewDefaultContent=null;
    viewBeautifyContent=null;
    viewDiffContent=null;
  }
  showMessage();
}

Fixed version (ground truth):
private void reInit(){
  if (httpMessage.getRes().hasResponse()) {
    labelSize.setText(Integer.toString(httpMessage.getRes().getSize()));
    labelHttpCode.setText(httpMessage.getRes().getHttpCode());
    labelDom.setText(Integer.toString(httpMessage.getRes().getDom()));
    if (httpMessage instanceof SentinelHttpMessageOrig) {
      panelViewComboboxModel.hasParent(false);
    }
 else {
      panelViewComboboxModel.hasParent(true);
      SentinelHttpMessageAtk atk=(SentinelHttpMessageAtk)httpMessage;
      labelRedirected.setText(atk.isRedirected() ? "String_Node_Str" : "String_Node_Str");
    }
    viewDefaultContent=null;
    viewBeautifyContent=null;
    viewDiffContent=null;
  }
 else {
  }
  showMessage();
}
Program: 26432
Project: 26432
Buggy source:
@Override public boolean performNextAttack(){
  boolean doContinue=false;
  if (initialMessage == null || initialMessage.getRequest() == null) {
    Logger.getLogger(this.getClass().getName()).log(Level.SEVERE,"String_Node_Str");
  }
  if (initialMessage.getReq().getChangeParam() == null) {
    BurpCallbacks.getInstance().print("String_Node_Str");
  }
  String data=attackDataSql[state];
  SentinelHttpMessage httpMessage=attack(data);
  if (state < 4) {
    doContinue=true;
  }
 else {
    doContinue=false;
  }
  state++;
  return doContinue;
}

Fixed version (ground truth):
@Override public boolean performNextAttack(){
  boolean doContinue=false;
  if (initialMessage == null || initialMessage.getRequest() == null) {
    Logger.getLogger(this.getClass().getName()).log(Level.SEVERE,"String_Node_Str");
  }
  if (initialMessage.getReq().getChangeParam() == null) {
    BurpCallbacks.getInstance().print("String_Node_Str");
  }
  String data=attackDataSql[state];
  SentinelHttpMessage httpMessage=attack(data);
  if (state < 3) {
    doContinue=true;
  }
 else {
    doContinue=false;
  }
  state++;
  return doContinue;
}
Program: 26433
Project: 26433
Buggy source:
private void attackRessource(){
  if (comboBoxSession.getSelectedIndex() > 0) {
    tableModel.setSessionAttackMessage(true,(String)comboBoxSession.getSelectedItem());
  }
  LinkedList<SentinelHttpParam> attackHttpParams=tableModel.createChangeParam();
  tableModel.resetAttackSelection();
  comboBoxSession.setSelectedIndex(0);
  PanelAttackProgress panelProgress=new PanelAttackProgress(attackHttpParams,origHttpMessage,this,checkboxFollowRedirect.isSelected(),(String)comboboxMainSession.getSelectedItem());
  panelProgress.setLocationRelativeTo(this);
  panelProgress.setVisible(true);
  panelParent.updateUI();
  panelProgress.start();
}

Fixed version (ground truth):
private void attackRessource(){
  if (comboBoxSession.getSelectedIndex() > 0) {
    tableModel.setSessionAttackMessage(true,(String)comboBoxSession.getSelectedItem());
  }
  LinkedList<SentinelHttpParam> attackHttpParams=tableModel.createChangeParam();
  tableModel.resetAttackSelection();
  comboBoxSession.setSelectedIndex(0);
  System.out.println("String_Node_Str" + attackHttpParams.size());
  PanelAttackProgress panelProgress=new PanelAttackProgress(attackHttpParams,origHttpMessage,this,checkboxFollowRedirect.isSelected(),(String)comboboxMainSession.getSelectedItem());
  panelProgress.setLocationRelativeTo(this);
  panelProgress.setVisible(true);
  panelParent.updateUI();
  panelProgress.start();
}
Program: 26434
Project: 26434
Buggy source:
private void buttonSessionActionPerformed(java.awt.event.ActionEvent evt){
  SessionManager.getInstance().show();
  sessionComboBoxModel.myupdate();
  tableModel.fireTableDataChanged();
}

Fixed version (ground truth):
private void buttonSessionActionPerformed(java.awt.event.ActionEvent evt){
  SessionManager.getInstance().show();
  sessionComboBoxModel.myupdate();
  sessionComboBoxModelMain.myupdate();
  tableModel.fireTableDataChanged();
  comboboxMainSession.invalidate();
  comboboxMainSession.updateUI();
}
Program: 26435
Project: 26435
Buggy source:
void addMessage(SentinelHttpMessageAtk httpMessage){
  messages.add(httpMessage);
  httpMessage.setTableIndexAttack(messages.size() - 1);
  httpMessage.addObserver(this);
  int selected=parent.getSelected();
  this.fireTableDataChanged();
  parent.setSelected(selected);
}

Fixed version (ground truth):
void addMessage(SentinelHttpMessageAtk httpMessage){
  messages.add(httpMessage);
  httpMessage.setTableIndexAttack(messages.size() - 1);
  httpMessage.addObserver(this);
  this.fireTableDataChanged();
}
Program: 26436
Project: 26436
Buggy source:
public void addHttpMessage(SentinelHttpMessageAtk httpMessage){
  panelRightModel.addMessage(httpMessage);
  if (currentSelectedRow == -1) {
    currentSelectedRow=0;
  }
  tableMessages.getSelectionModel().setSelectionInterval(currentSelectedRow,currentSelectedRow);
  tableMessages.scrollRectToVisible(tableMessages.getCellRect(panelRightModel.getRowCount() - 1,0,true));
  this.updateUI();
}

Fixed version (ground truth):
public void addHttpMessage(SentinelHttpMessageAtk httpMessage){
  panelRightModel.addMessage(httpMessage);
  if (currentSelectedRow == -1) {
    currentSelectedRow=0;
    viewHttpMessage(currentSelectedRow);
  }
  tableMessages.getSelectionModel().setSelectionInterval(currentSelectedRow,currentSelectedRow);
  tableMessages.scrollRectToVisible(tableMessages.getCellRect(panelRightModel.getRowCount() - 1,0,true));
}
Program: 26437
Project: 26437
Buggy source:
@Override public void valueChanged(ListSelectionEvent e){
  if (e.getValueIsAdjusting())   return;
  ListSelectionModel lsm=(ListSelectionModel)e.getSource();
  if (lsm.isSelectionEmpty()) {
  }
 else {
    currentSelectedRow=lsm.getMinSelectionIndex();
    viewHttpMessage(currentSelectedRow);
    tableMessages.getSelectionModel().setSelectionInterval(currentSelectedRow,currentSelectedRow);
  }
}

Fixed version (ground truth):
@Override public void valueChanged(ListSelectionEvent e){
  if (e.getValueIsAdjusting())   return;
  ListSelectionModel lsm=(ListSelectionModel)e.getSource();
  if (lsm.isSelectionEmpty()) {
  }
 else {
    int newSelectedRow=lsm.getMinSelectionIndex();
    if (newSelectedRow != currentSelectedRow) {
      viewHttpMessage(currentSelectedRow);
    }
    currentSelectedRow=newSelectedRow;
    tableMessages.getSelectionModel().setSelectionInterval(currentSelectedRow,currentSelectedRow);
  }
}
Program: 26439
Project: 26439
Buggy source:
public void addAttackMessage(SentinelHttpMessageAtk httpMessage){
  panelRightUi.addHttpMessage(httpMessage);
  this.updateUI();
}

Fixed version (ground truth):
public void addAttackMessage(SentinelHttpMessageAtk httpMessage){
  panelRightUi.addHttpMessage(httpMessage);
}
Program: 26440
Project: 26440
Buggy source:
public void init(){
  worker=new NetworkerWorker();
  BurpCallbacks.getInstance().print("String_Node_Str");
  worker.execute();
}

Fixed version (ground truth):
public void init(){
  worker=new NetworkerWorker();
  worker.execute();
}
Program: 26442
Project: 26442
Buggy source:
private void writeChartData(JFreeChart chart,BaseChartDefinition definition,File saveDirectory){
  File csvFile=new File(saveDirectory,definition.getShortName().replace("String_Node_Str","String_Node_Str") + "String_Node_Str");
  FileWriter writer=null;
  Plot plot=chart.getPlot();
  DataTupleDataset dataset=null;
  if (plot instanceof CategoryPlot) {
    CategoryPlot cPlot=(CategoryPlot)plot;
    dataset=(DataTupleDataset)cPlot.getDataset();
  }
 else   if (plot instanceof XYPlot) {
    XYPlot xyPlot=(XYPlot)plot;
    dataset=(DataTupleDataset)xyPlot.getDataset();
  }
 else {
    System.err.println("String_Node_Str" + plot.getClass() + "String_Node_Str"+ chart.getTitle());
  }
  if (dataset != null) {
    try {
      writer=new FileWriter(csvFile);
      CSVWriter.write(dataset,writer);
    }
 catch (    IOException ioe) {
      System.err.println("String_Node_Str" + csvFile.getName());
    }
 finally {
      if (writer != null) {
        try {
          writer.close();
        }
 catch (        IOException ioe) {
        }
      }
    }
  }
}

Fixed version (ground truth):
private void writeChartData(JFreeChart chart,BaseChartDefinition definition,File saveDirectory){
  File csvFile=new File(saveDirectory,definition.getShortName().replace("String_Node_Str","String_Node_Str") + "String_Node_Str");
  FileWriter writer=null;
  Plot plot=chart.getPlot();
  DataTupleDataset dataset=null;
  if (plot instanceof CategoryPlot) {
    CategoryPlot cPlot=(CategoryPlot)plot;
    dataset=(DataTupleDataset)cPlot.getDataset();
  }
 else   if (plot instanceof XYPlot) {
    XYPlot xyPlot=(XYPlot)plot;
    dataset=(DataTupleDataset)xyPlot.getDataset();
  }
 else {
    System.err.println("String_Node_Str" + plot.getClass() + "String_Node_Str"+ chart.getTitle());
  }
  if (dataset != null) {
    try {
      writer=new FileWriter(csvFile);
      CSVWriter.write(dataset,writer);
    }
 catch (    IOException ioe) {
      System.err.println("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ csvFile.getName());
    }
 finally {
      if (writer != null) {
        try {
          writer.close();
        }
 catch (        IOException ioe) {
        }
      }
    }
  }
}