nus-yam/ex-repair huggingface dataset:
Program: 40270
Project: 40270
Buggy source:
@Override public Node call() throws Exception {
  AciAgent agent=null;
  try {
    agent=new AciAgent(AciCloud.this,template);
    LOGGER.log(Level.INFO,"String_Node_Str",agent.getNodeName());
    Jenkins.getInstance().addNode(agent);
    StopWatch stopWatch=new StopWatch();
    stopWatch.start();
    template.provisionAgents(AciCloud.this,agent,stopWatch);
    waitToOnline(agent,template.getTimeout(),stopWatch);
    return agent;
  }
 catch (  Exception e) {
    LOGGER.log(Level.WARNING,e.toString());
    if (agent != null) {
      agent.terminate();
    }
    throw new Exception(e);
  }
}

Fixed version (ground truth):
@Override public Node call() throws Exception {
  AciAgent agent=null;
  final Map<String,String> properties=new HashMap<>();
  try {
    agent=new AciAgent(AciCloud.this,template);
    LOGGER.log(Level.INFO,"String_Node_Str",agent.getNodeName());
    Jenkins.getInstance().addNode(agent);
    StopWatch stopWatch=new StopWatch();
    stopWatch.start();
    properties.put(AppInsightsConstants.AZURE_SUBSCRIPTION_ID,AzureCredentials.getServicePrincipal(credentialsId).getSubscriptionId());
    properties.put(Constants.AI_ACI_NAME,agent.getNodeName());
    template.provisionAgents(AciCloud.this,agent,stopWatch);
    waitToOnline(agent,template.getTimeout(),stopWatch);
    ContainerPlugin.sendEvent(Constants.AI_ACI_AGENT,"String_Node_Str",properties);
    return agent;
  }
 catch (  Exception e) {
    LOGGER.log(Level.WARNING,e.toString());
    properties.put("String_Node_Str",e.getMessage());
    ContainerPlugin.sendEvent(Constants.AI_ACI_AGENT,"String_Node_Str",properties);
    if (agent != null) {
      agent.terminate();
    }
    throw new Exception(e);
  }
}
Program: 40272
Project: 40272
Buggy source:
@DataBoundConstructor public AciContainerTemplate(String name,String label,int timeout,String osType,String image,String command,String rootFs,List<AciPort> ports,List<DockerRegistryEndpoint> privateRegistryCredentials,List<PodEnvVar> envVars,List<AzureFileVolume> volumes,RetentionStrategy<?> retentionStrategy,String cpu,String memory){
  this.name=name;
  this.label=label;
  this.image=image;
  this.osType=osType;
  this.command=command;
  this.rootFs=rootFs;
  this.ports=ports;
  this.cpu=cpu;
  this.memory=memory;
  this.timeout=timeout;
  this.retentionStrategy=retentionStrategy;
  this.envVars=envVars;
  this.privateRegistryCredentials=privateRegistryCredentials;
  this.volumes=volumes;
}

Fixed version (ground truth):
@DataBoundConstructor public AciContainerTemplate(String name,String label,int timeout,String osType,String image,String command,String rootFs,List<AciPort> ports,List<DockerRegistryEndpoint> privateRegistryCredentials,List<PodEnvVar> envVars,List<AzureFileVolume> volumes,RetentionStrategy<?> retentionStrategy,String cpu,String memory){
  this.name=name;
  this.label=label;
  this.image=image;
  this.osType=osType;
  this.command=command;
  this.rootFs=rootFs;
  this.ports=ports == null ? new ArrayList<>() : ports;
  this.cpu=cpu;
  this.memory=memory;
  this.timeout=timeout;
  this.retentionStrategy=retentionStrategy;
  this.envVars=envVars == null ? new ArrayList<>() : envVars;
  this.privateRegistryCredentials=privateRegistryCredentials == null ? new ArrayList<>() : privateRegistryCredentials;
  this.volumes=volumes == null ? new ArrayList<>() : volumes;
}
Program: 40273
Project: 40273
Buggy source:
public static void deleteAciContainerGroup(String credentialsId,String resourceGroup,String containerGroupName,String deployName){
  final Azure azureClient=AzureContainerUtils.getAzureClient(credentialsId);
  try {
    azureClient.genericResources().delete(resourceGroup,"String_Node_Str","String_Node_Str","String_Node_Str",containerGroupName,"String_Node_Str");
    LOGGER.log(Level.INFO,"String_Node_Str",containerGroupName);
    if (deployName != null) {
      azureClient.deployments().deleteByResourceGroup(resourceGroup,deployName);
      LOGGER.log(Level.INFO,"String_Node_Str",deployName);
    }
  }
 catch (  Exception e) {
    LOGGER.log(Level.WARNING,"String_Node_Str",new Object[]{containerGroupName,e});
  }
}

Fixed version (ground truth):
public static void deleteAciContainerGroup(String credentialsId,String resourceGroup,String containerGroupName,String deployName){
  final Azure azureClient=AzureContainerUtils.getAzureClient(credentialsId);
  final Map<String,String> properties=new HashMap<>();
  try {
    azureClient.genericResources().delete(resourceGroup,"String_Node_Str","String_Node_Str","String_Node_Str",containerGroupName,"String_Node_Str");
    LOGGER.log(Level.INFO,"String_Node_Str",containerGroupName);
    properties.put(Constants.AI_ACI_NAME,containerGroupName);
    ContainerPlugin.sendEvent(Constants.AI_ACI_AGENT,"String_Node_Str",properties);
    if (deployName != null) {
      azureClient.deployments().deleteByResourceGroup(resourceGroup,deployName);
      LOGGER.log(Level.INFO,"String_Node_Str",deployName);
    }
  }
 catch (  Exception e) {
    LOGGER.log(Level.WARNING,"String_Node_Str",new Object[]{containerGroupName,e});
    properties.put("String_Node_Str",e.getMessage());
    ContainerPlugin.sendEvent(Constants.AI_ACI_AGENT,"String_Node_Str",properties);
  }
}
Program: 40274
Project: 40274
Buggy source:
public static ListBoxModel listResourceGroupItems(String credentialsId) throws IOException {
  ListBoxModel model=new ListBoxModel();
  model.add("String_Node_Str","String_Node_Str");
  if (StringUtils.isBlank(credentialsId)) {
    return model;
  }
  try {
    AzureCredentials.ServicePrincipal servicePrincipal=AzureCredentials.getServicePrincipal(credentialsId);
    final Azure azureClient=TokenCache.getInstance(servicePrincipal).getAzureClient();
    List<ResourceGroup> list=azureClient.resourceGroups().list();
    for (    ResourceGroup resourceGroup : list) {
      model.add(resourceGroup.name());
    }
  }
 catch (  Exception e) {
    LOGGER.log(Level.INFO,"String_Node_Str",e);
  }
  return model;
}

Fixed version (ground truth):
public static ListBoxModel listResourceGroupItems(String credentialsId) throws IOException {
  ListBoxModel model=new ListBoxModel();
  model.add("String_Node_Str","String_Node_Str");
  if (StringUtils.isBlank(credentialsId)) {
    return model;
  }
  try {
    final Azure azureClient=getAzureClient(credentialsId);
    List<ResourceGroup> list=azureClient.resourceGroups().list();
    for (    ResourceGroup resourceGroup : list) {
      model.add(resourceGroup.name());
    }
  }
 catch (  Exception e) {
    LOGGER.log(Level.INFO,"String_Node_Str",e);
  }
  return model;
}
Program: 40275
Project: 40275
Buggy source:
public Azure getAzureClient(){
  return Azure.configure().withInterceptor(new KubernetesPlugin.AzureTelemetryInterceptor()).withLogLevel(LogLevel.NONE).withUserAgent(getUserAgent()).authenticate(get(credentials)).withSubscription(credentials.getSubscriptionId());
}

Fixed version (ground truth):
public Azure getAzureClient(){
  return Azure.configure().withInterceptor(new ContainerPlugin.AzureTelemetryInterceptor()).withLogLevel(LogLevel.NONE).withUserAgent(getUserAgent()).authenticate(get(credentials)).withSubscription(credentials.getSubscriptionId());
}
Program: 40276
Project: 40276
Buggy source:
public void render(){
  glClear(GL_COLOR_BUFFER_BIT);
  RenderContext.colour(Theme.BASE);
  RenderContext.rect(0,0,Display.getWidth(),Display.getHeight());
  renderChildren(children);
  RenderContext.colour(Colour.YELLOW);
  String framerate="String_Node_Str" + frameRate;
  int padding=60;
  RenderContext.drawString(framerate,Display.getWidth() - RenderBackend.INTERFACE_FONT.getWidth(framerate) - padding,Display.getHeight() - RenderBackend.INTERFACE_FONT.getHeight() - padding);
  RenderContext.drawString("String_Node_Str" + commands + "String_Node_Str",40,Display.getHeight() - padding);
}

Fixed version (ground truth):
public void render(){
  glClear(GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
  RenderContext.colour(Theme.BASE);
  RenderContext.rect(0,0,Display.getWidth(),Display.getHeight());
  renderChildren(children);
  RenderContext.colour(Colour.YELLOW);
  String framerate="String_Node_Str" + frameRate;
  int padding=60;
  RenderContext.drawString(framerate,Display.getWidth() - RenderBackend.INTERFACE_FONT.getWidth(framerate) - padding,Display.getHeight() - RenderBackend.INTERFACE_FONT.getHeight() - padding);
  RenderContext.drawString("String_Node_Str" + commands + "String_Node_Str",40,Display.getHeight() - padding);
}
Program: 40277
Project: 40277
Buggy source:
@Override public void init(final int width,final int height){
  GL11.glEnable(GL11.GL_TEXTURE_2D);
  GL11.glMatrixMode(GL11.GL_PROJECTION);
  GL11.glLoadIdentity();
  GL11.glMatrixMode(GL11.GL_MODELVIEW);
  GL11.glOrtho(0,width,height,0,1,-1);
}

Fixed version (ground truth):
@Override public void init(final int width,final int height){
  System.out.println("String_Node_Str");
  GL11.glMatrixMode(GL11.GL_PROJECTION);
  GL11.glLoadIdentity();
  GL11.glMatrixMode(GL11.GL_MODELVIEW);
  GL11.glOrtho(0,width,height,0,1,-1);
}
Program: 40278
Project: 40278
Buggy source:
public static void drawString(String suggName,int x,int y){
  GL11.glEnable(GL11.GL_BLEND);
  GL11.glBlendFunc(GL11.GL_SRC_ALPHA,GL11.GL_ONE_MINUS_SRC_ALPHA);
  RenderBackend.CURRENT_FONT.drawString(x,y,suggName,backend.currentColour.getStupidFuckingColour());
  GL11.glDisable(GL11.GL_BLEND);
}

Fixed version (ground truth):
public static void drawString(String suggName,int x,int y){
  GL11.glEnable(GL11.GL_TEXTURE_2D);
  GL11.glEnable(GL11.GL_BLEND);
  GL11.glBlendFunc(GL11.GL_SRC_ALPHA,GL11.GL_ONE_MINUS_SRC_ALPHA);
  RenderBackend.CURRENT_FONT.drawString(x,y,suggName,backend.currentColour.getStupidFuckingColour());
  GL11.glDisable(GL11.GL_BLEND);
  GL11.glDisable(GL11.GL_TEXTURE_2D);
}
Program: 40279
Project: 40279
Buggy source:
public void render(){
  glClear(GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
  RenderContext.colour(Theme.BASE);
  RenderContext.rect(0,0,Display.getWidth(),Display.getHeight());
  renderChildren(children);
  RenderContext.colour(Colour.YELLOW);
  final String framerate="String_Node_Str" + frameRate + "String_Node_Str"+ tickRate;
  final int padding=60;
  RenderContext.drawString(framerate,Display.getWidth() - RenderBackend.INTERFACE_FONT.getWidth(framerate) - (padding * 2),Display.getHeight() - RenderBackend.INTERFACE_FONT.getHeight() - padding);
  RenderContext.drawString("String_Node_Str" + commands + "String_Node_Str",padding,Display.getHeight() - padding);
}

Fixed version (ground truth):
public void render(){
  glClear(GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
  RenderContext.colour(Theme.BASE);
  RenderContext.rect(0,0,Display.getWidth(),Display.getHeight());
  renderChildren(children);
  RenderContext.colour(Colour.YELLOW);
  final String framerate="String_Node_Str" + frameRate + "String_Node_Str"+ tickRate;
  final int padding=60;
  RenderContext.drawString(framerate,Display.getWidth() - RenderBackend.INTERFACE_FONT.getWidth(framerate) - (padding * 2),Display.getHeight() - RenderBackend.INTERFACE_FONT.getHeight() - padding);
  RenderContext.drawString("String_Node_Str" + commands + "String_Node_Str",padding,Display.getHeight() - RenderBackend.INTERFACE_FONT.getHeight() - padding);
}
Program: 40280
Project: 40280
Buggy source:
public void save(){
  if (!isSaved()) {
    JFileChooser chooser=new JFileChooser(System.getenv("String_Node_Str"));
    chooser.setDialogTitle("String_Node_Str" + name + "String_Node_Str");
    chooser.setSelectedFile(new File(name));
    if (chooser.showSaveDialog(null) == JFileChooser.APPROVE_OPTION) {
      file=chooser.getSelectedFile();
    }
 else {
      System.err.println("String_Node_Str");
      return;
    }
  }
  if (file == null) {
    System.err.println("String_Node_Str");
    return;
  }
  try {
    BufferedWriter bw=new BufferedWriter(new FileWriter(file));
    for (    Line builtString : buffer) {
      String actualString=builtString.toString() + '\n';
      bw.write(actualString);
    }
    bw.close();
  }
 catch (  Exception e) {
    System.err.println("String_Node_Str");
  }
  saved=true;
}

Fixed version (ground truth):
public void save(){
  if (!isSaved()) {
    JFileChooser chooser=new JFileChooser(System.getenv("String_Node_Str"));
    chooser.setDialogTitle("String_Node_Str" + name + "String_Node_Str");
    chooser.setSelectedFile(new File(name));
    if (chooser.showSaveDialog(null) == JFileChooser.APPROVE_OPTION) {
      file=chooser.getSelectedFile();
    }
 else {
      System.err.println("String_Node_Str");
      return;
    }
  }
  if (file == null) {
    System.err.println("String_Node_Str");
    return;
  }
  try {
    BufferedWriter bw=new BufferedWriter(new FileWriter(file));
    for (    Line builtString : buffer) {
      String actualString=builtString.toString() + '\n';
      bw.write(actualString);
    }
    bw.close();
    saved=true;
  }
 catch (  Exception e) {
    System.err.println("String_Node_Str");
  }
  saved=true;
}
Program: 40281
Project: 40281
Buggy source:
public void update(){
  super.update();
  title.setValue((saved ? name : "String_Node_Str" + name) + "String_Node_Str" + (getCaret().iy + 1));
}

Fixed version (ground truth):
public void update(){
  super.update();
  title.setValue((saved ? name : "String_Node_Str" + name) + "String_Node_Str" + (getCaret().iy + 1));
  if (System.currentTimeMillis() - timer > 1000 && hasBeenSaved()) {
    save();
    timer+=1000;
  }
}
Program: 40282
Project: 40282
Buggy source:
public void closeCurrentBuffer(){
  Buffer buff=buffers.pop();
  children.remove(buff);
  if (buffers.isEmpty()) {
    return;
  }
  if (buffers.peek() != null) {
    buffers.peek().setFocus(true);
  }
}

Fixed version (ground truth):
public void closeCurrentBuffer(){
  if (buffers.empty()) {
    return;
  }
  Buffer buff=buffers.pop();
  children.remove(buff);
  if (buffers.isEmpty()) {
    return;
  }
  if (!buffers.empty()) {
    buffers.peek().setFocus(true);
  }
}
Program: 40283
Project: 40283
Buggy source:
public Colour darker(){
  this.r*=(1 - 5);
  this.g*=(1 - 5);
  this.b*=(1 - 5);
  return this;
}

Fixed version (ground truth):
public Colour darker(){
  this.r*=(1 - 0.1);
  this.g*=(1 - 0.1);
  this.b*=(1 - 0.1);
  return this;
}
Program: 40284
Project: 40284
Buggy source:
public Buffer(File file){
  this.name=file.getName();
  this.saved=true;
  this.file=file;
  buffer.clear();
  this.loadFile(file);
}

Fixed version (ground truth):
public Buffer(File file){
  this(file.getName());
  this.saved=true;
  this.file=file;
  buffer.clear();
  this.loadFile(file);
}
Program: 40285
Project: 40285
Buggy source:
public void save(){
  if (!isSaved()) {
    JFileChooser chooser=new JFileChooser(System.getenv("String_Node_Str"));
    if (chooser.showSaveDialog(null) == JFileChooser.APPROVE_OPTION) {
      file=chooser.getSelectedFile();
    }
 else {
      System.err.println("String_Node_Str");
      return;
    }
  }
  if (file == null) {
    System.err.println("String_Node_Str");
    return;
  }
  try {
    BufferedWriter bw=new BufferedWriter(new FileWriter(file));
    for (    StringBuilder builtString : buffer) {
      String actualString=builtString.toString() + '\n';
      bw.write(actualString);
    }
    bw.close();
  }
 catch (  Exception e) {
    System.err.println("String_Node_Str");
  }
  saved=true;
}

Fixed version (ground truth):
public void save(){
  if (!isSaved()) {
    JFileChooser chooser=new JFileChooser(System.getenv("String_Node_Str"));
    chooser.setDialogTitle("String_Node_Str" + name + "String_Node_Str");
    chooser.setSelectedFile(new File(name));
    if (chooser.showSaveDialog(null) == JFileChooser.APPROVE_OPTION) {
      file=chooser.getSelectedFile();
    }
 else {
      System.err.println("String_Node_Str");
      return;
    }
  }
  if (file == null) {
    System.err.println("String_Node_Str");
    return;
  }
  try {
    BufferedWriter bw=new BufferedWriter(new FileWriter(file));
    for (    StringBuilder builtString : buffer) {
      String actualString=builtString.toString() + '\n';
      bw.write(actualString);
    }
    bw.close();
  }
 catch (  Exception e) {
    System.err.println("String_Node_Str");
  }
  saved=true;
}
Program: 40286
Project: 40286
Buggy source:
public static Object getSetting(String key){
  if (USER_SETTING_LOOKUP.containsKey(key)) {
    Object res=USER_SETTING_LOOKUP.get(key);
    if (res instanceof Long) {
      return (int)safeLongToInt((long)res);
    }
    return res;
  }
  System.err.println("String_Node_Str" + key + "String_Node_Str");
  Object res=DEFAULT_SETTING_LOOKUP.get(key);
  if (res instanceof Long) {
    return (int)safeLongToInt((long)res);
  }
  return res;
}

Fixed version (ground truth):
public static Object getSetting(String key){
  if (USER_SETTING_LOOKUP.containsKey(key)) {
    Object res=USER_SETTING_LOOKUP.get(key);
    System.out.println("String_Node_Str" + key + "String_Node_Str"+ res.toString());
    if (res instanceof Long) {
      return (int)safeLongToInt((long)res);
    }
    return res;
  }
  System.err.println("String_Node_Str" + key + "String_Node_Str");
  Object res=DEFAULT_SETTING_LOOKUP.get(key);
  if (res instanceof Long) {
    return (int)safeLongToInt((long)res);
  }
  return res;
}
Program: 40287
Project: 40287
Buggy source:
public void place(char c,int ix,int iy){
  StringBuilder line=getLine(iy);
  if (ix >= line.length()) {
    line.append(c);
  }
 else {
    line.insert(ix,c);
  }
  setLine(line,iy);
}

Fixed version (ground truth):
public void place(char c,int ix,int iy){
  if (ix == 0 && iy == 0 && buffer.size() == 0) {
    buffer.add(new StringBuilder(1));
  }
  StringBuilder line=getLine(iy);
  if (ix >= line.length()) {
    line.append(c);
  }
 else {
    line.insert(ix,c);
  }
  setLine(line,iy);
}
Program: 40288
Project: 40288
Buggy source:
@Override public void render(){
  Render.endClip();
  Render.colour(Colour.BLACK);
  Render.rect(x,y,w + 2,h + 2);
  renderChildren(children);
  for (int i=0; i < suggestions.size(); i++) {
    Render.colour(selectedSuggestion == i ? Theme.DARK_ACCENT : Theme.ACCENT);
    Render.rect(x,y + ((i + 1) * h),w,h);
    Render.colour(Colour.WHITE);
    Render.font(caret.getFont());
    Render.drawString(suggestions.get(i).name,x + 5,y + 4 + ((i + 1) * h));
  }
}

Fixed version (ground truth):
@Override public void render(){
  Render.endClip();
  Render.colour(Colour.BLACK);
  Render.rect(x,y,w + 2,h + 2);
  renderChildren(children);
  for (int i=0; i < suggestions.size(); i++) {
    Command sugg=suggestions.get(i);
    Render.colour(selectedSuggestion == i ? Theme.DARK_ACCENT : Theme.ACCENT);
    Render.rect(x,y + ((i + 1) * h),w,h);
    Render.colour(Colour.WHITE);
    Render.font(caret.getFont());
    String suggName=sugg.name;
    Render.drawString(suggName,x + 5,y + 4 + ((i + 1) * h));
    Render.colour(Colour.GRAY);
    Render.drawString("String_Node_Str" + sugg.getShortHelp(),x + 5 + caret.getFont().getWidth(suggName),y + 4 + ((i + 1) * h));
  }
}
Program: 40289
Project: 40289
Buggy source:
@Override public boolean keyPress(int keyCode){
  findSuggestions(buffer.getLine().toString());
switch (keyCode) {
case Keyboard.KEY_TAB:
    return true;
case Keyboard.KEY_RETURN:
  if (suggestions.size() > 0 && selectedSuggestion != -1) {
    String suggested=suggestions.get(selectedSuggestion).name;
    String oldLine=buffer.getLine(0).toString();
    buffer.setLine(suggested);
    buffer.moveCursor(suggested.length() - oldLine.length(),0);
    Command cmd=suggestions.get(selectedSuggestion);
    if (cmd.argumentCount > 0) {
      buffer.append(' ');
      buffer.moveCursor(1,0);
    }
    removeSuggestions();
  }
 else {
    String[] command=buffer.getBuffer().get(0).toString().split("String_Node_Str");
    if (!commands.containsKey(command[0])) {
      System.err.println("String_Node_Str");
      hide();
      return true;
    }
    processCommand(command);
    hide();
  }
return true;
case Keyboard.KEY_ESCAPE:
if (timeAlive > 5) {
hide();
}
break;
}
if (suggestions.size() > 0) {
String[] command=buffer.getBuffer().get(0).toString().split("String_Node_Str");
int suggestionIndex=getSuggestionIndex(command[0]);
if (suggestionIndex != -1) {
selectedSuggestion=suggestionIndex;
}
}
return false;
}

Fixed version (ground truth):
@Override public boolean keyPress(int keyCode){
  findSuggestions(buffer.getLine().toString());
switch (keyCode) {
case Keyboard.KEY_TAB:
    return true;
case Keyboard.KEY_RETURN:
  if (suggestions.size() > 0 && selectedSuggestion != -1) {
    String suggested=suggestions.get(selectedSuggestion).name;
    String oldLine=buffer.getLine(0).toString();
    buffer.setLine(suggested);
    buffer.moveCursor(suggested.length() - oldLine.length(),0);
    Command cmd=suggestions.get(selectedSuggestion);
    if (cmd.argumentCount > 0) {
      buffer.append(' ');
      buffer.moveCursor(1,0);
    }
    removeSuggestions();
  }
 else {
    String[] command=buffer.getBuffer().get(0).toString().split("String_Node_Str");
    if (command[0].equals("String_Node_Str")) {
      for (      String c : commands.keySet()) {
        suggestions.add(commands.get(c));
      }
      return true;
    }
    if (!commands.containsKey(command[0])) {
      System.err.println("String_Node_Str");
      hide();
      return true;
    }
    processCommand(command);
    hide();
  }
return true;
case Keyboard.KEY_UP:
case Keyboard.KEY_DOWN:
return true;
case Keyboard.KEY_ESCAPE:
if (timeAlive > 5) {
hide();
}
break;
}
if (suggestions.size() > 0) {
String[] command=buffer.getBuffer().get(0).toString().split("String_Node_Str");
int suggestionIndex=getSuggestionIndex(command[0]);
if (suggestionIndex != -1) {
selectedSuggestion=suggestionIndex;
}
}
return false;
}
Program: 40290
Project: 40290
Buggy source:
@Override public String getHelp(){
  return "String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str";
}

Fixed version (ground truth):
@Override public String getHelp(){
  return "String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
}
Program: 40291
Project: 40291
Buggy source:
@Override public String getHelp(){
  return "String_Node_Str" + "String_Node_Str";
}

Fixed version (ground truth):
@Override public String getHelp(){
  return "String_Node_Str" + "String_Node_Str" + "String_Node_Str";
}
Program: 40292
Project: 40292
Buggy source:
public void handleShiftCombo(){
  while (Keyboard.next()) {
    if (Keyboard.getEventKeyState()) {
      int keyCode=Keyboard.getEventKey();
switch (keyCode) {
case Keyboard.KEY_LEFT:
        break;
case Keyboard.KEY_RIGHT:
      break;
default :
    owner.place(Keyboard.getEventCharacter(),ix,iy);
  move(1,0);
break;
case Keyboard.KEY_LSHIFT:
case Keyboard.KEY_RSHIFT:
case Keyboard.KEY_LCONTROL:
case Keyboard.KEY_RCONTROL:
break;
}
}
}
}

Fixed version (ground truth):
public void handleShiftCombo(){
  while (Keyboard.next()) {
    if (Keyboard.getEventKeyState()) {
      int keyCode=Keyboard.getEventKey();
switch (keyCode) {
case Keyboard.KEY_LEFT:
        break;
case Keyboard.KEY_RIGHT:
      break;
default :
    handleKeyCode(keyCode);
  break;
case Keyboard.KEY_LSHIFT:
case Keyboard.KEY_RSHIFT:
case Keyboard.KEY_LCONTROL:
case Keyboard.KEY_RCONTROL:
break;
}
}
}
}
Program: 40294
Project: 40294
Buggy source:
public void handleControlCombo(){
  while (Keyboard.next()) {
    if (Keyboard.getEventKeyState()) {
      int keyCode=Keyboard.getEventKey();
switch (keyCode) {
case Keyboard.KEY_C:
        break;
case Keyboard.KEY_N:
      break;
case Keyboard.KEY_W:
    Editor.getInstance().closeCurrentBuffer();
  break;
case Keyboard.KEY_S:
Editor.getInstance().getCurrentBuffer().save();
break;
case Keyboard.KEY_L:
Editor.getInstance().showCommandPalette("String_Node_Str");
break;
case Keyboard.KEY_LEFT:
String previousWord=getWordBefore(ix);
move(-previousWord.length(),0);
break;
case Keyboard.KEY_RIGHT:
String nextWord=getWordAfter(ix);
move(nextWord.length(),0);
break;
case Keyboard.KEY_BACK:
String prevWord=getWordBefore(ix);
for (int i=0; i < prevWord.length() + 1; i++) {
owner.backspace(this);
}
break;
case Keyboard.KEY_DELETE:
String next=getWordAfter(ix);
for (int i=0; i < next.length(); i++) {
owner.delete(ix,iy);
}
break;
case Keyboard.KEY_D:
if (iy >= 0 && iy < owner.getLineCount() - 1) {
owner.deleteLine(iy);
carriageReturn();
}
 else if (iy == owner.getLineCount() - 1 && owner.getLine(iy).length() == 0) {
if (iy != 0) {
owner.deleteLine(iy);
move(owner.getLine(iy - 1).length(),-1);
}
}
 else if (owner.getLine(iy).toString().trim().length() == 0) {
owner.deleteLine(iy);
move(owner.getLine(iy - 1).length(),-1);
}
 else {
owner.clearLine(iy);
carriageReturn();
}
break;
default :
break;
case Keyboard.KEY_LSHIFT:
case Keyboard.KEY_RSHIFT:
case Keyboard.KEY_LCONTROL:
case Keyboard.KEY_RCONTROL:
break;
}
}
}
}

Fixed version (ground truth):
public void handleControlCombo(){
  while (Keyboard.next()) {
    if (Keyboard.getEventKeyState()) {
      int keyCode=Keyboard.getEventKey();
switch (keyCode) {
case Keyboard.KEY_C:
        break;
case Keyboard.KEY_N:
      Editor.getInstance().showCommandPalette("String_Node_Str");
    break;
case Keyboard.KEY_W:
  Editor.getInstance().closeCurrentBuffer();
break;
case Keyboard.KEY_S:
Editor.getInstance().getCurrentBuffer().save();
break;
case Keyboard.KEY_L:
Editor.getInstance().showCommandPalette("String_Node_Str");
break;
case Keyboard.KEY_LEFT:
String previousWord=getWordBefore(ix);
move(-previousWord.length(),0);
break;
case Keyboard.KEY_RIGHT:
String nextWord=getWordAfter(ix);
move(nextWord.length(),0);
break;
case Keyboard.KEY_BACK:
String prevWord=getWordBefore(ix);
for (int i=0; i < prevWord.length() + 1; i++) {
owner.backspace(this);
}
break;
case Keyboard.KEY_DELETE:
String next=getWordAfter(ix);
for (int i=0; i < next.length(); i++) {
owner.delete(ix,iy);
}
break;
case Keyboard.KEY_D:
if (iy >= 0 && iy < owner.getLineCount() - 1) {
owner.deleteLine(iy);
carriageReturn();
}
 else if (iy == owner.getLineCount() - 1 && owner.getLine(iy).length() == 0) {
if (iy != 0) {
owner.deleteLine(iy);
move(owner.getLine(iy - 1).length(),-1);
}
}
 else if (owner.getLine(iy).toString().trim().length() == 0) {
owner.deleteLine(iy);
move(owner.getLine(iy - 1).length(),-1);
}
 else {
owner.clearLine(iy);
carriageReturn();
}
break;
default :
break;
case Keyboard.KEY_LSHIFT:
case Keyboard.KEY_RSHIFT:
case Keyboard.KEY_LCONTROL:
case Keyboard.KEY_RCONTROL:
break;
}
}
}
}
Program: 40295
Project: 40295
Buggy source:
public void run(){
  init();
  long timer=System.currentTimeMillis();
  int frames=0;
  while (!Display.isCloseRequested()) {
    render();
    update();
    frames++;
    if (System.currentTimeMillis() - timer > 1000) {
      timer+=1000;
      this.frames=frames;
      frames=0;
    }
  }
  Display.destroy();
  stop();
}

Fixed version (ground truth):
public void run(){
  init();
  long timer=System.currentTimeMillis();
  int frames=0;
  double ns=1000000000.0 / 60.0;
  double delta=0;
  long last=System.nanoTime();
  while (!Display.isCloseRequested()) {
    long now=System.nanoTime();
    delta+=(now - last) / ns;
    last=now;
    if (delta >= 1) {
      render();
      update();
      frames++;
      delta--;
    }
    if (System.currentTimeMillis() - timer > 1000) {
      timer+=1000;
      this.frames=frames;
      frames=0;
    }
    try {
      Thread.sleep(2);
    }
 catch (    Exception e) {
    }
  }
  Display.destroy();
  stop();
}
Program: 40296
Project: 40296
Buggy source:
public Buffer(File file){
  this.name=file.getName();
  this.saved=true;
  this.file=file;
  this.loadFile(file);
  this.saved=true;
}

Fixed version (ground truth):
public Buffer(File file){
  this.name=file.getName();
  this.saved=true;
  this.file=file;
  this.loadFile(file);
  this.saved=true;
  buffer.clear();
}
Program: 40297
Project: 40297
Buggy source:
@Override public void update(){
  updateChildren(children);
  hack++;
  System.out.println(hack);
}

Fixed version (ground truth):
@Override public void update(){
  updateChildren(children);
  hack++;
}
Program: 40298
Project: 40298
Buggy source:
@Override public void keyPress(int keyCode){
switch (keyCode) {
case Keyboard.KEY_RETURN:
    String command=buffer.getBuffer().get(0).toString();
  processCommand(command.split("String_Node_Str"));
hide();
break;
case Keyboard.KEY_ESCAPE:
if (hack > 5) {
hide();
}
break;
}
}

Fixed version (ground truth):
@Override public void keyPress(int keyCode){
switch (keyCode) {
case Keyboard.KEY_RETURN:
    String command=buffer.getBuffer().get(0).toString();
  String[] args=command.split("String_Node_Str");
for (String a : args) {
  System.out.println(a + "String_Node_Str");
}
processCommand(args);
hide();
break;
case Keyboard.KEY_ESCAPE:
if (hack > 5) {
hide();
}
break;
}
}
Program: 40299
Project: 40299
Buggy source:
public void init(){
  try {
    Display.setDisplayMode(new DisplayMode(1280,720));
    Display.create();
  }
 catch (  Exception e) {
    System.err.println("String_Node_Str");
  }
  this.w=Display.getWidth();
  this.h=Display.getHeight();
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  glMatrixMode(GL_MODELVIEW);
  glOrtho(0,Display.getWidth(),Display.getHeight(),0,1,-1);
  addChild(new TextArea(Display.getWidth(),Display.getHeight()),Layout.Halves);
  addChild(new TextArea(Display.getWidth(),Display.getHeight()),Layout.Halves);
  DEBUG_INTERFACE=new Panel(Display.getWidth() - 150,15);
  addChild(DEBUG_INTERFACE,Layout.Free);
  DEBUG_INTERFACE.setFocusable(false);
  fps=new Label("String_Node_Str");
  DEBUG_INTERFACE.addChild(fps,Layout.Child);
}

Fixed version (ground truth):
public void init(){
  try {
    Display.setDisplayMode(new DisplayMode(1280,720));
    Display.create();
  }
 catch (  Exception e) {
    System.err.println("String_Node_Str");
  }
  this.w=Display.getWidth();
  this.h=Display.getHeight();
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  glMatrixMode(GL_MODELVIEW);
  glOrtho(0,Display.getWidth(),Display.getHeight(),0,1,-1);
  if (children.size() != 0) {
    children.get(RNG.cap(children.size())).setFocus(true);
  }
  DEBUG_INTERFACE=new Panel(Display.getWidth() - 150,15);
  addChild(DEBUG_INTERFACE,Layout.Free);
  DEBUG_INTERFACE.setFocusable(false);
  fps=new Label("String_Node_Str");
}
Program: 40300
Project: 40300
Buggy source:
public void update(){
  Input.update();
  checkFocus();
  for (  Component c : children) {
    c.checkFocus();
    if (!c.getFocusable() || c.getFocus()) {
      c.update();
    }
  }
  Display.update();
}

Fixed version (ground truth):
public void update(){
  Input.update();
  if (Keyboard.isKeyDown(Keyboard.KEY_F2)) {
    JFileChooser chooser=new JFileChooser();
    chooser.setVisible(true);
    if (chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
      File file=chooser.getSelectedFile();
      TextArea buff=new TextArea(Display.getWidth(),Display.getHeight());
      buff.loadFile(file);
      addChild(buff);
    }
  }
  checkFocus();
  for (  Component c : children) {
    c.checkFocus();
    if (!c.getFocusable() || c.getFocus()) {
      c.update();
    }
  }
  Display.update();
}
Program: 40301
Project: 40301
Buggy source:
public static void main(String[] args){
  new Editor().start();
}

Fixed version (ground truth):
public static void main(String[] args){
  try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
  }
 catch (  Exception e) {
  }
  new Editor().start();
}
Program: 40302
Project: 40302
Buggy source:
public void move(int x,int y){
  System.out.println(Math.signum(y));
  ix+=Math.signum(x);
  iy+=Math.signum(y);
  xOffset+=charWidth * x;
  yOffset+=charHeight * y;
}

Fixed version (ground truth):
public void move(int x,int y){
  System.out.println(Math.signum(y));
  ix+=x;
  iy+=y;
  xOffset+=charWidth * x;
  yOffset+=charHeight * y;
}
Program: 40303
Project: 40303
Buggy source:
@Override public void update(){
  this.x=owner.x;
  this.y=owner.y;
  while (Keyboard.next()) {
    if (Keyboard.getEventKeyState()) {
switch (Keyboard.getEventKey()) {
case Keyboard.KEY_LSHIFT:
case Keyboard.KEY_RSHIFT:
case Keyboard.KEY_LCONTROL:
case Keyboard.KEY_RCONTROL:
case Keyboard.KEY_LMETA:
case Keyboard.KEY_RMETA:
case Keyboard.KEY_LMENU:
case Keyboard.KEY_RMENU:
        break;
case Keyboard.KEY_LEFT:
      move(-1,0);
    break;
case Keyboard.KEY_RIGHT:
  move(1,0);
break;
case Keyboard.KEY_UP:
move(0,-1);
break;
case Keyboard.KEY_DOWN:
move(0,1);
break;
case Keyboard.KEY_RETURN:
owner.newline();
move(0,1);
reset();
break;
default :
owner.place(Keyboard.getEventCharacter(),ix,iy);
move(1,0);
break;
}
}
}
}

Fixed version (ground truth):
@Override public void update(){
  this.x=owner.x;
  this.y=owner.y;
  while (Keyboard.next()) {
    if (Keyboard.getEventKeyState()) {
switch (Keyboard.getEventKey()) {
case Keyboard.KEY_LSHIFT:
case Keyboard.KEY_RSHIFT:
case Keyboard.KEY_LCONTROL:
case Keyboard.KEY_RCONTROL:
case Keyboard.KEY_LMETA:
case Keyboard.KEY_RMETA:
case Keyboard.KEY_LMENU:
case Keyboard.KEY_RMENU:
        break;
case Keyboard.KEY_BACK:
      owner.backspace(this,ix,iy);
    break;
case Keyboard.KEY_LEFT:
  if (ix > 0) {
    move(-1,0);
  }
break;
case Keyboard.KEY_RIGHT:
if (ix < owner.getLine(iy).length()) {
move(1,0);
}
break;
case Keyboard.KEY_UP:
move(0,-1);
break;
case Keyboard.KEY_DOWN:
move(0,1);
break;
case Keyboard.KEY_HOME:
move(-ix,0);
break;
case Keyboard.KEY_END:
System.out.println(ix);
if (ix < owner.getLine(iy).length()) {
move(owner.getLine(iy).length(),0);
}
break;
case Keyboard.KEY_RETURN:
owner.newline();
move(0,1);
reset();
break;
default :
owner.place(Keyboard.getEventCharacter(),ix,iy);
move(1,0);
break;
}
}
}
}
Program: 40304
Project: 40304
Buggy source:
public StringBuilder getLine(int lineNum){
  return buffer.get(lineNum);
}

Fixed version (ground truth):
public StringBuilder getLine(){
  return buffer.get(buffer.size() - 1);
}
Program: 40305
Project: 40305
Buggy source:
public void append(char c){
}

Fixed version (ground truth):
public void append(char c){
  setLine(getLine().append(c),buffer.size() - 1);
}
Program: 40306
Project: 40306
Buggy source:
public void init(){
  java.awt.DisplayMode mode=GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode();
  final int width=mode.getWidth() / 12 * 9;
  final int height=mode.getHeight() / 12 * 9;
  try {
    Display.setDisplayMode(new DisplayMode(width,height));
    Display.create();
  }
 catch (  Exception e) {
    System.err.println("String_Node_Str");
  }
  this.w=Display.getWidth();
  this.h=Display.getHeight();
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  glMatrixMode(GL_MODELVIEW);
  glOrtho(0,Display.getWidth(),Display.getHeight(),0,1,-1);
  if (children.size() != 0) {
    children.get(RNG.cap(children.size())).setFocus(true);
  }
  areas=new Stack<TextArea>();
  palette=new CommandPalette();
  palette.setVisible(false);
}

Fixed version (ground truth):
public void init(){
  java.awt.DisplayMode mode=GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode();
  final int width=mode.getWidth() / 12 * 9;
  final int height=mode.getHeight() / 12 * 9;
  try {
    Display.setDisplayMode(new DisplayMode(width,height));
    Display.setTitle("String_Node_Str");
    Display.create();
  }
 catch (  Exception e) {
    System.err.println("String_Node_Str");
  }
  this.w=Display.getWidth();
  this.h=Display.getHeight();
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  glMatrixMode(GL_MODELVIEW);
  glOrtho(0,Display.getWidth(),Display.getHeight(),0,1,-1);
  if (children.size() != 0) {
    children.get(RNG.cap(children.size())).setFocus(true);
  }
  areas=new Stack<TextArea>();
  palette=new CommandPalette();
  palette.setVisible(false);
}
Program: 40307
Project: 40307
Buggy source:
public void update(){
  if (Input.getKeyPressed(Keyboard.KEY_ESCAPE)) {
    palette.setVisible(true);
    palette.setFocus(true);
  }
 else   if (Input.getKeyPressed(Keyboard.KEY_F2)) {
    JFileChooser chooser=new JFileChooser();
    chooser.setVisible(true);
    if (chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
      File file=chooser.getSelectedFile();
      TextArea buff=new TextArea(Display.getWidth(),Display.getHeight());
      buff.loadFile(file);
      addChild(buff);
    }
  }
  if (palette.isVisible() && palette.getFocus()) {
    palette.update();
  }
 else {
    updateChildren(children);
  }
  Input.update();
  Display.update();
}

Fixed version (ground truth):
public void update(){
  if (Input.getKeyPressed(Keyboard.KEY_ESCAPE)) {
    palette.setVisible(true);
    palette.setFocus(true);
  }
  if (palette.isVisible() && palette.getFocus()) {
    palette.update();
  }
 else {
    updateChildren(children);
  }
  while (Keyboard.next()) {
  }
  Input.update();
  Display.update();
}
Program: 40308
Project: 40308
Buggy source:
public void render(){
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  Render.colour(Colour.BLACK);
  Render.rect(0,0,Display.getWidth(),Display.getHeight());
  renderChildren(children);
  if (palette.isVisible()) {
    palette.render();
  }
  Input.render();
  Render.colour(255,0,0);
  Render.drawString("String_Node_Str" + frames,Display.getWidth() - 100,20);
}

Fixed version (ground truth):
public void render(){
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  Render.colour(Colour.WHITE);
  Render.rect(0,0,Display.getWidth(),Display.getHeight());
  renderChildren(children);
  if (palette.isVisible()) {
    palette.render();
  }
  Input.render();
  Render.colour(255,0,0);
  Render.drawString("String_Node_Str" + frames,Display.getWidth() - 100,20);
}
Program: 40309
Project: 40309
Buggy source:
public void setCurrentTextArea(TextArea area){
  addChild(area);
  this.areas.push(area);
}

Fixed version (ground truth):
public void setCurrentTextArea(TextArea area){
  addChild(area);
  this.areas.push(area);
  area.setFocus(true);
}
Program: 40311
Project: 40311
Buggy source:
public void clear(){
  caret.carriageReturn();
  buffer.clear();
  buffer.add(new StringBuilder());
}

Fixed version (ground truth):
public void clear(){
  caret.carriageReturn();
  buffer.clear();
  buffer.add(new StringBuilder());
  caret.reset();
}
Program: 40312
Project: 40312
Buggy source:
@Override public void update(){
  updateChildren(children);
}

Fixed version (ground truth):
@Override public void update(){
  updateChildren(children);
  hack++;
  System.out.println(hack);
}
Program: 40313
Project: 40313
Buggy source:
public CommandPalette(){
  this.defaultHeight=Render.MONOSPACED_FONT.getHeight() + 10;
  this.w=512;
  this.h=defaultHeight;
  this.x=(Display.getWidth() / 2) - (this.w / 2);
  this.y=0;
  this.buffer=new TextArea(this.w,defaultHeight);
  buffer.setFocus(true);
  buffer.getCaret().setCursorAction(this);
  addChild(buffer,Layout.Child);
}

Fixed version (ground truth):
public CommandPalette(){
  this.defaultHeight=Render.MONOSPACED_FONT.getHeight() + 10;
  this.w=512;
  this.h=defaultHeight;
  this.x=(Display.getWidth() / 2) - (this.w / 2);
  this.y=0;
  this.buffer=new TextArea(this.w,defaultHeight);
  buffer.setBackground(Colour.BLACK);
  buffer.setFocus(true);
  buffer.getCaret().setCursorAction(this);
  addChild(buffer,Layout.Child);
}
Program: 40314
Project: 40314
Buggy source:
@Override public void keyPress(int keyCode){
  if (keyCode == Keyboard.KEY_RETURN) {
    String command=buffer.getBuffer().get(0).toString();
    processCommand(command.split("String_Node_Str"));
    buffer.clear();
    buffer.getCaret().reset();
    setVisible(false);
    setFocus(false);
  }
}

Fixed version (ground truth):
@Override public void keyPress(int keyCode){
switch (keyCode) {
case Keyboard.KEY_RETURN:
    String command=buffer.getBuffer().get(0).toString();
  processCommand(command.split("String_Node_Str"));
hide();
break;
case Keyboard.KEY_ESCAPE:
if (hack > 5) {
hide();
}
break;
}
}
Program: 40315
Project: 40315
Buggy source:
@Override public void action(String[] arguments){
  String filename=arguments[0];
  TextArea area=new TextArea(filename);
  area.setBackground(new Colour(0x3D3331));
  area.setCursorColour(new Colour(0x61A598));
  area.setForeground(Colour.PINK);
  Editor.getInstance().clearFocus();
  Editor.getInstance().setCurrentTextArea(area);
}

Fixed version (ground truth):
@Override public void action(String[] arguments){
  String filename=arguments[0];
  TextArea area=new TextArea(filename);
  Editor.getInstance().clearFocus();
  Editor.getInstance().setCurrentTextArea(area);
}
Program: 40316
Project: 40316
Buggy source:
@Override public void action(String[] arguments){
}

Fixed version (ground truth):
@Override public void action(String[] arguments){
  System.out.println(arguments.toString());
  if (arguments[0].equals("String_Node_Str")) {
    JFileChooser chooser=new JFileChooser();
    chooser.setVisible(true);
    if (chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
      File file=chooser.getSelectedFile();
      TextArea buff=new TextArea(file.getName());
      buff.loadFile(file);
      Editor.getInstance().setCurrentTextArea(buff);
    }
  }
}
Program: 40317
Project: 40317
Buggy source:
public static void render(){
  Render.colour(Colour.BLACK);
  Render.rect(x,y,w,h);
}

Fixed version (ground truth):
public static void render(){
  Render.colour(Colour.YELLOW);
  Render.rect(x,y,w,h);
}
Program: 40318
Project: 40318
Buggy source:
public void init(){
  java.awt.DisplayMode mode=GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode();
  final int width=mode.getWidth() / 12 * 9;
  final int height=mode.getHeight() / 12 * 9;
  try {
    Display.setDisplayMode(new DisplayMode(width,height));
    Display.setTitle("String_Node_Str");
    Display.create();
  }
 catch (  Exception e) {
    System.err.println("String_Node_Str");
  }
  this.w=Display.getWidth();
  this.h=Display.getHeight();
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  glMatrixMode(GL_MODELVIEW);
  glOrtho(0,Display.getWidth(),Display.getHeight(),0,1,-1);
  if (children.size() != 0) {
    children.get(RNG.cap(children.size())).setFocus(true);
  }
  areas=new Stack<TextArea>();
  palette=new CommandPalette();
  palette.setVisible(false);
}

Fixed version (ground truth):
public void init(){
  java.awt.DisplayMode mode=GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode();
  final int width=mode.getWidth() / 12 * 9;
  final int height=mode.getHeight() / 12 * 9;
  try {
    Display.setDisplayMode(new DisplayMode(width,height));
    Display.setTitle("String_Node_Str");
    Display.create();
  }
 catch (  Exception e) {
    System.err.println("String_Node_Str");
  }
  this.w=Display.getWidth();
  this.h=Display.getHeight();
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  glMatrixMode(GL_MODELVIEW);
  glOrtho(0,Display.getWidth(),Display.getHeight(),0,1,-1);
  if (children.size() != 0) {
    children.get(RNG.cap(children.size())).setFocus(true);
  }
  buffers=new Stack<Buffer>();
  palette=new CommandPalette();
  palette.setVisible(false);
}
Program: 40319
Project: 40319
Buggy source:
public void closeCurrentBuffer(){
  TextArea area=areas.pop();
  children.remove(area);
  if (areas.isEmpty()) {
    return;
  }
  areas.peek().setFocus(true);
}

Fixed version (ground truth):
public void closeCurrentBuffer(){
  Buffer buff=buffers.pop();
  children.remove(buff);
  if (buffers.isEmpty()) {
    return;
  }
  buffers.peek().setFocus(true);
}
Program: 40321
Project: 40321
Buggy source:
public TextArea(String name){
  this(name,Display.getWidth(),Display.getHeight());
}

Fixed version (ground truth):
public TextArea(){
  this(Display.getWidth(),Display.getHeight());
}
Program: 40322
Project: 40322
Buggy source:
@Override public void action(String[] arguments){
  String filename=arguments[0];
  TextArea area=new TextArea(filename);
  Editor.getInstance().clearFocus();
  Editor.getInstance().setCurrentTextArea(area);
}

Fixed version (ground truth):
@Override public void action(String[] arguments){
  String filename=arguments[0];
  Editor.getInstance().setCurrentBuffer(new Buffer(filename,false));
}
Program: 40323
Project: 40323
Buggy source:
@Override public void action(String[] arguments){
  System.out.println(arguments.toString());
  if (arguments[0].equals("String_Node_Str")) {
    JFileChooser chooser=new JFileChooser();
    chooser.setVisible(true);
    if (chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
      File file=chooser.getSelectedFile();
      TextArea buff=new TextArea(file.getName());
      buff.loadFile(file);
      Editor.getInstance().setCurrentTextArea(buff);
    }
  }
}

Fixed version (ground truth):
@Override public void action(String[] arguments){
  if (arguments[0].equals("String_Node_Str")) {
    JFileChooser chooser=new JFileChooser();
    chooser.setVisible(true);
    if (chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
      File file=chooser.getSelectedFile();
      Editor.getInstance().setCurrentBuffer(new Buffer(file));
    }
    return;
  }
  File potentialFile=new File(arguments[0]);
  if (potentialFile.isFile()) {
    Editor.getInstance().setCurrentBuffer(new Buffer(potentialFile));
    return;
  }
}
Program: 40324
Project: 40324
Buggy source:
@POST @Path(PROTOBUF_URL) @Produces(MediaTypeExt.APPLICATION_PROTOBUF) @Consumes(MediaTypeExt.APPLICATION_PROTOBUF) public ConnectorMessage checkConfiguration(ConnectorMessage msg) throws SQLException {
  if (msg.getType().equals(ConnectorMessage.Type.RAT_REPO_REQUEST)) {
    try {
      AttestationRepositoryRequest request=msg.getAttestationRepositoryRequest();
      int numPcrValues=request.getPcrValuesCount();
      IdsAttestationType type=request.getAtype();
      if (numPcrValues > 0) {
switch (type) {
case BASIC:
          if (numPcrValues == 11) {
            return this.checkMessage(msg);
          }
 else {
            return this.sendError("String_Node_Str" + numPcrValues + "String_Node_Str",msg.getId());
          }
case ADVANCED:
        return this.checkMessage(msg);
case ALL:
      if (numPcrValues == 24) {
        return this.checkMessage(msg);
      }
 else {
        return this.sendError("String_Node_Str" + numPcrValues + "String_Node_Str",msg.getId());
      }
default :
    return this.sendError("String_Node_Str",msg.getId());
}
}
 else {
return this.sendError("String_Node_Str",msg.getId());
}
}
 catch (Exception e) {
return this.sendError(e.getMessage(),msg.getId());
}
}
 else {
return this.sendError("String_Node_Str",msg.getId());
}
}

Fixed version (ground truth):
@POST @Path(PROTOBUF_URL) @Produces(MediaTypeExt.APPLICATION_PROTOBUF) @Consumes(MediaTypeExt.APPLICATION_PROTOBUF) public ConnectorMessage checkConfiguration(ConnectorMessage msg){
  if (msg.getType().equals(ConnectorMessage.Type.RAT_REPO_REQUEST)) {
    try {
      AttestationRepositoryRequest request=msg.getAttestationRepositoryRequest();
      int numPcrValues=request.getPcrValuesCount();
      IdsAttestationType type=request.getAtype();
      if (numPcrValues > 0) {
switch (type) {
case BASIC:
          if (numPcrValues == 11) {
            return this.checkMessage(msg);
          }
 else {
            return this.sendError("String_Node_Str" + numPcrValues + "String_Node_Str",msg.getId());
          }
case ADVANCED:
        return this.checkMessage(msg);
case ALL:
      if (numPcrValues == 24) {
        return this.checkMessage(msg);
      }
 else {
        return this.sendError("String_Node_Str" + numPcrValues + "String_Node_Str",msg.getId());
      }
default :
    return this.sendError("String_Node_Str",msg.getId());
}
}
 else {
return this.sendError("String_Node_Str",msg.getId());
}
}
 catch (Exception e) {
return this.sendError(e.getMessage(),msg.getId());
}
}
 else {
return this.sendError("String_Node_Str",msg.getId());
}
}
Program: 40325
Project: 40325
Buggy source:
@DELETE @Path("String_Node_Str") @Produces(MediaType.APPLICATION_JSON) public String deleteConfiguration(@PathParam("String_Node_Str") String cid) throws NumberFormatException, SQLException {
  this.setCORSHeader(response,corsEnabled);
  if (isInteger(cid)) {
    if (this.db.deleteConfigurationById(Integer.parseInt(cid))) {
      return cid;
    }
 else {
      throw new InternalServerErrorException();
    }
  }
 else {
    throw new InternalServerErrorException();
  }
}

Fixed version (ground truth):
@DELETE @Path("String_Node_Str") @Produces(MediaType.APPLICATION_JSON) public String deleteConfiguration(@PathParam("String_Node_Str") String cid) throws SQLException {
  this.setCORSHeader(response,corsEnabled);
  if (isInteger(cid)) {
    if (this.db.deleteConfigurationById(Integer.parseInt(cid))) {
      return cid;
    }
 else {
      throw new InternalServerErrorException();
    }
  }
 else {
    throw new InternalServerErrorException();
  }
}