nus-yam/ex-repair huggingface dataset:
Program: 180419
Project: 180419
Buggy source:
public void runMap() throws XLWrapException, IOException {
  System.out.println("String_Node_Str");
  XLWrapMapping map=MappingParser.parse(MAP_FILE_ROOT + doi + "String_Node_Str");
  XLWrapMaterializer mat=new XLWrapMaterializer();
  Model m=mat.generateModel(map);
  m.setNsPrefix("String_Node_Str",RDF_BASE_URL);
  File out=new File(RDF_FILE_ROOT + doi + "String_Node_Str");
  FileWriter writer=new FileWriter(out);
  m.write(writer,"String_Node_Str");
  System.out.println("String_Node_Str" + out.getAbsolutePath());
}

Fixed version (ground truth):
public void runMap() throws XLWrapException, IOException, XLWrapMapException {
  System.out.println("String_Node_Str");
  XLWrapMapping map=MappingParser.parse(MAP_FILE_ROOT + doi + "String_Node_Str");
  XLWrapMaterializer mat=new XLWrapMaterializer();
  Model m=mat.generateModel(map);
  m.setNsPrefix("String_Node_Str",RDF_BASE_URL);
  File out=new File(RDF_FILE_ROOT);
  if (!out.exists()) {
    throw new XLWrapMapException("String_Node_Str" + RDF_FILE_ROOT + "String_Node_Str");
  }
  out=new File(RDF_FILE_ROOT + doi + "String_Node_Str");
  FileWriter writer=new FileWriter(out);
  m.write(writer,"String_Node_Str");
  System.out.println("String_Node_Str" + out.getAbsolutePath());
}
Program: 180420
Project: 180420
Buggy source:
protected void writeTemplate(BufferedWriter writer) throws IOException, XLWrapException, XLWrapEOFException, XLWrapMapException {
  writer.write("String_Node_Str");
  writer.write(template());
  writer.write("String_Node_Str");
  writer.newLine();
  for (char meta='B'; meta < 'Y'; meta++) {
    int charValue=Character.valueOf(meta);
    String data=String.valueOf((char)(charValue + 1));
    System.out.println(meta + "String_Node_Str" + data);
    writeTemplateColumn(writer,"String_Node_Str" + meta,data);
  }
  writer.write("String_Node_Str");
  writer.newLine();
}

Fixed version (ground truth):
protected void writeTemplate(BufferedWriter writer) throws IOException, XLWrapException, XLWrapEOFException, XLWrapMapException {
  writer.write("String_Node_Str");
  writer.write(template());
  writer.write("String_Node_Str");
  writer.newLine();
  for (char meta='B'; meta < 'Y'; meta++) {
    int charValue=Character.valueOf(meta);
    String data=String.valueOf((char)(charValue - 1));
    System.out.println(meta + "String_Node_Str" + data);
    writeTemplateColumn(writer,"String_Node_Str" + meta,data);
  }
  writer.write("String_Node_Str");
  writer.newLine();
}
Program: 180421
Project: 180421
Buggy source:
private void writeTemplateColumn(BufferedWriter writer,String metaColumn,String dataColumn) throws IOException, XLWrapException, XLWrapEOFException, XLWrapMapException {
  String category=getCellValue(metaColumn,CATEGORY_ROW);
  if (category == null) {
    System.out.println("String_Node_Str" + metaColumn + "String_Node_Str");
    return;
  }
  String field=getCellValue(metaColumn,FIELD_ROW);
  if (field == null) {
    System.out.println("String_Node_Str" + metaColumn + "String_Node_Str");
    return;
  }
  String idType=getCellValue(metaColumn,ID_TYPE_ROW);
  writeURI(writer,category,field,idType,metaColumn);
  writer.write("String_Node_Str");
  writer.write(category);
  writer.write("String_Node_Str");
  writer.newLine();
  writer.write("String_Node_Str" + field + "String_Node_Str"+ dataColumn+ firstData+ "String_Node_Str");
  writer.newLine();
  for (int row=firstLink; row <= lastLink; row++) {
    writeLink(writer,metaColumn,dataColumn,row);
  }
  for (int row=firstConstant; row <= lastConstant; row++) {
    writeConstant(writer,metaColumn,row);
  }
  writer.write("String_Node_Str" + RDF_BASE_URL + "String_Node_Str"+ doi+ category+ "String_Node_Str");
  writer.newLine();
  writer.write("String_Node_Str");
  writer.newLine();
  writer.newLine();
}

Fixed version (ground truth):
private void writeTemplateColumn(BufferedWriter writer,String metaColumn,String dataColumn) throws IOException, XLWrapException, XLWrapEOFException, XLWrapMapException {
  String category=getCellValue(metaColumn,CATEGORY_ROW);
  if (category == null) {
    System.out.println("String_Node_Str" + metaColumn + "String_Node_Str");
    return;
  }
  String field=getCellValue(metaColumn,FIELD_ROW);
  if (field == null) {
    System.out.println("String_Node_Str" + metaColumn + "String_Node_Str");
    return;
  }
  String idType=getCellValue(metaColumn,ID_TYPE_ROW);
  writeURI(writer,category,field,idType,dataColumn);
  writer.write("String_Node_Str");
  writer.write(category);
  writer.write("String_Node_Str");
  writer.newLine();
  writer.write("String_Node_Str" + field + "String_Node_Str"+ dataColumn+ firstData+ "String_Node_Str");
  writer.newLine();
  for (int row=firstLink; row <= lastLink; row++) {
    writeLink(writer,metaColumn,dataColumn,row);
  }
  for (int row=firstConstant; row <= lastConstant; row++) {
    writeConstant(writer,metaColumn,row);
  }
  writer.write("String_Node_Str" + RDF_BASE_URL + "String_Node_Str"+ doi+ category+ "String_Node_Str");
  writer.newLine();
  writer.write("String_Node_Str");
  writer.newLine();
  writer.newLine();
}
Program: 180423
Project: 180423
Buggy source:
public static void main(String[] args) throws Exception {
  String[] celebs=readFile("String_Node_Str").split("String_Node_Str");
  String[] celebXMLList=new String[celebs.length];
  int i=0;
  for (  String celeb : celebs) {
    celebXMLList[i++]=openURL("String_Node_Str" + celeb);
    System.out.println("String_Node_Str" + celebXMLList[i - 1]);
  }
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  String[] celebs=Utils.readFile("String_Node_Str").split("String_Node_Str");
  String[] celebXMLList=new String[celebs.length];
  int i=0;
  for (  String celeb : celebs) {
    celebXMLList[i++]=Utils.openURL("String_Node_Str" + celeb);
    System.out.println("String_Node_Str" + celebXMLList[i - 1]);
  }
}
Program: 180424
Project: 180424
Buggy source:
/** 
 * Resizes an image using a Graphics2D object backed by a BufferedImage.
 * @param srcImg - source image to scale
 * @param w - desired width
 * @param h - desired height
 * @return - the new resized image
 */
private Image getScaledImage(Image srcImg,int w,int h){
  BufferedImage resizedImg=new BufferedImage(w,h,BufferedImage.TYPE_INT_RGB);
  Graphics2D g2=resizedImg.createGraphics();
  g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,RenderingHints.VALUE_INTERPOLATION_BILINEAR);
  g2.drawImage(srcImg,0,0,w,h,null);
  g2.dispose();
  return resizedImg;
}

Fixed version (ground truth):
/** 
 * Resizes an image using a Graphics2D object backed by a BufferedImage.
 * @param srcImg - source image to scale
 * @param w - desired width
 * @param h - desired height
 * @return - the new resized image
 */
private Image getScaledImage(BufferedImage srcImg,int w,int h){
  int srcWidth=srcImg.getWidth();
  int srcHeight=srcImg.getHeight();
  int diffWidth=maxWidth - srcWidth;
  int diffHeight=maxHeight - srcHeight;
  if (diffWidth > diffHeight) {
    w=maxWidth;
    double hf=((1.0 * maxHeight) * ((1.0 * srcWidth) / (1.0 * srcHeight)));
    h=(int)Math.round(hf);
  }
 else {
    double wf=((1.0 * maxWidth) * ((1.0 * srcHeight) / (1.0 * srcWidth)));
    w=(int)Math.round(wf);
    h=maxHeight;
  }
  BufferedImage resizedImg=new BufferedImage(w,h,BufferedImage.TYPE_INT_RGB);
  Graphics2D g2=resizedImg.createGraphics();
  g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,RenderingHints.VALUE_INTERPOLATION_BILINEAR);
  g2.drawImage(srcImg,0,0,w,h,null);
  g2.dispose();
  return resizedImg;
}
Program: 180425
Project: 180425
Buggy source:
public SessionConfig parse(InputStream in) throws Exception {
  Map<?,?> value=mapper.readValue(in,Map.class);
  Object version=value.get("String_Node_Str");
  if (version != null && version instanceof String) {
    VersionConfigParser parser=versionParsers.get((String)version);
    return parser.parse(mapper,value);
  }
 else {
    return legacyParser.parse(mapper,value);
  }
}

Fixed version (ground truth):
public SessionConfig parse(InputStream in) throws Exception {
  Map<?,?> value;
  try {
    value=mapper.readValue(in,Map.class);
  }
 catch (  JsonParseException e) {
    String msg=getFriendlyError(e);
    throw new Exception(msg,e);
  }
  Object version=value.get("String_Node_Str");
  if (version != null && version instanceof String) {
    VersionConfigParser parser=versionParsers.get((String)version);
    return parser.parse(mapper,value);
  }
 else {
    return legacyParser.parse(mapper,value);
  }
}
Program: 180426
Project: 180426
Buggy source:
/** 
 * @param config
 * @return
 * @throws IOException
 */
protected CategoryItem[] parseItems(SessionConfig config) throws IOException {
  if (config == null) {
    return new CategoryItem[0];
  }
  ItemConfig[] confItems=config.getItems();
  CategoryItem[] rval=new CategoryItem[confItems.length];
  String base=config.getItemBase();
  for (int i=0; i < rval.length; ++i) {
    File imgFile=new File(base,confItems[i].visualSD);
    File audioSD=null;
    if (confItems[i].audioSD != null) {
      audioSD=new File(base,confItems[i].audioSD);
    }
    File audioPrompt=null;
    if (confItems[i].audioPrompt != null) {
      audioPrompt=new File(base,confItems[i].audioPrompt);
    }
    rval[i]=new CategoryItem(imgFile,audioSD,audioPrompt);
  }
  return rval;
}

Fixed version (ground truth):
/** 
 * @param config
 * @return
 * @throws IOException
 */
protected CategoryItem[] parseItems(SessionConfig config) throws IOException {
  if (config == null) {
    return new CategoryItem[0];
  }
  ItemConfig[] confItems=config.getItems();
  CategoryItem[] rval=new CategoryItem[confItems.length];
  String base=config.getItemBase();
  for (int i=0; i < rval.length; ++i) {
    if (confItems[i].visualSD == null) {
      throw new IOException("String_Node_Str" + (i + 1) + "String_Node_Str");
    }
    File imgFile=new File(base,confItems[i].visualSD);
    File audioSD=null;
    if (confItems[i].audioSD != null) {
      audioSD=new File(base,confItems[i].audioSD);
    }
    File audioPrompt=null;
    if (confItems[i].audioPrompt != null) {
      audioPrompt=new File(base,confItems[i].audioPrompt);
    }
    rval[i]=new CategoryItem(imgFile,audioSD,audioPrompt);
  }
  return rval;
}
Program: 180427
Project: 180427
Buggy source:
public void startTimerTimeDelayAutoAdvance(int timeDelayAutoAdvance){
  Timer xxx=new Timer(timeDelayAutoAdvance * 1000,timerTimeDelayAutoAdvance);
  xxx.setRepeats(false);
  xxx.start();
  log.info(String.format("String_Node_Str",timeDelayAutoAdvance));
}

Fixed version (ground truth):
public void startTimerTimeDelayAutoAdvance(int timeDelayAutoAdvance){
  preBetweenTimer=new Timer(timeDelayAutoAdvance * 1000,timerTimeDelayAutoAdvance);
  preBetweenTimer.setRepeats(false);
  preBetweenTimer.start();
  log.info(String.format("String_Node_Str",timeDelayAutoAdvance));
}
Program: 180428
Project: 180428
Buggy source:
public void setupTimer(){
  if (null != timer) {
    timer.stop();
  }
  SessionConfig config=session.getConfig();
  int answerDelay=config.getTimeDelayAudioPrompt() + getPromptLen(currentItem.getAudioPrompt());
  timer=new Timer(answerDelay * 1000,timerAction);
  timer.setInitialDelay(config.getTimeDelayAudioSD() * 1000);
  timer.setRepeats(true);
  timer.start();
}

Fixed version (ground truth):
public void setupTimer(){
  if (null != timer) {
    timer.stop();
  }
  SessionConfig config=session.getConfig();
  int answerDelay=config.getTimeDelayAudioPrompt() + getSoundLen(currentItem.getAudioSD());
  timer=new Timer(answerDelay * 1000,timerAction);
  timer.setInitialDelay(config.getTimeDelayAudioSD() * 1000);
  timer.setRepeats(true);
  timer.start();
  log.info(String.format("String_Node_Str",config.getTimeDelayAudioSD(),answerDelay));
}
Program: 180429
Project: 180429
Buggy source:
public void stopTimer(){
  if (timer != null) {
    timer.stop();
  }
}

Fixed version (ground truth):
public void stopTimer(){
  if (timer != null) {
    timer.stop();
  }
  if (preBetweenTimer != null) {
    preBetweenTimer.stop();
  }
}
Program: 180430
Project: 180430
Buggy source:
private void timer(){
  if (playPrompt) {
    playPrompt=false;
    startSound(item.getAudioSD(),-1);
  }
 else {
    playPrompt=true;
    startSound(item.getAudioPrompt(),item.getItemNumber());
    gui.stopTimer();
    int timeDelayAutoAdvance=gui.getSession().getConfig().getTimeDelayAutoAdvance();
    if (timeDelayAutoAdvance > 0) {
      int audioPromptLen=gui.getPromptLen(item.getAudioPrompt());
      timeDelayAutoAdvance+=audioPromptLen;
      if (timeDelayAutoAdvance > 0) {
        gui.startTimerTimeDelayAutoAdvance(timeDelayAutoAdvance);
      }
 else {
        log.error("String_Node_Str");
      }
    }
  }
}

Fixed version (ground truth):
private void timer(){
  if (playPrompt) {
    playPrompt=false;
    startSound(item.getAudioSD(),-1);
  }
 else {
    playPrompt=true;
    startSound(item.getAudioPrompt(),item.getItemNumber());
    gui.stopTimer();
    int timeDelayAutoAdvance=gui.getSession().getConfig().getTimeDelayAutoAdvance();
    if (timeDelayAutoAdvance > 0) {
      int audioPromptLen=gui.getSoundLen(item.getAudioPrompt());
      timeDelayAutoAdvance+=audioPromptLen;
      if (timeDelayAutoAdvance > 0) {
        gui.startTimerTimeDelayAutoAdvance(timeDelayAutoAdvance);
      }
 else {
        log.error("String_Node_Str");
      }
    }
  }
}
Program: 180431
Project: 180431
Buggy source:
public void useNewSession(){
  if (bDebounce) {
    return;
  }
  bDebounce=true;
  centerButton.removeActionListener(this);
  clickToStartButton.setEnabled(false);
  clickToStartButton.setForeground(Color.white);
  if (null != session) {
    CategoryItem[] copy=Arrays.copyOf(session.getItems(),session.getItems().length);
    SessionConfig config=session.getConfig();
    for (int i=0; i < config.getShuffleCount(); ++i) {
      Shuffler.shuffle(copy);
    }
    itemQueue=new ConcurrentLinkedQueue<CategoryItem>();
    for (    CategoryItem item : copy) {
      itemQueue.add(item);
    }
    itemQueue.add(copy[copy.length - 1]);
    totalItemCount=itemQueue.size() - 1;
    mediator.setSession(session);
    setupCenterButton();
    setFrameTitle();
    refreshGui();
    setupBetweenTimer();
    enableButtons();
    mediator.execute(Mediator.BETWEEN_TIMER);
  }
}

Fixed version (ground truth):
public void useNewSession(){
  if (bDebounce) {
    return;
  }
  bDebounce=true;
  shownItemCount=0;
  centerButton.removeActionListener(this);
  clickToStartButton.setEnabled(false);
  clickToStartButton.setForeground(Color.white);
  if (null != session) {
    CategoryItem[] copy=Arrays.copyOf(session.getItems(),session.getItems().length);
    SessionConfig config=session.getConfig();
    for (int i=0; i < config.getShuffleCount(); ++i) {
      Shuffler.shuffle(copy);
    }
    itemQueue=new ConcurrentLinkedQueue<CategoryItem>();
    for (    CategoryItem item : copy) {
      itemQueue.add(item);
    }
    itemQueue.add(copy[copy.length - 1]);
    totalItemCount=itemQueue.size() - 1;
    mediator.setSession(session);
    setupCenterButton();
    setFrameTitle();
    refreshGui();
    setupBetweenTimer();
    enableButtons();
    mediator.execute(Mediator.BETWEEN_TIMER);
  }
}
Program: 180433
Project: 180433
Buggy source:
/** 
 * @param config
 * @return
 * @throws IOException
 */
protected CategoryItem[] parseItems(SessionConfig config) throws IOException {
  if (config == null) {
    return new CategoryItem[0];
  }
  ItemConfig[] confItems=config.getItems();
  CategoryItem[] rval=new CategoryItem[confItems.length];
  String base=config.getItemBase();
  for (int i=0; i < rval.length; ++i) {
    File imgFile=new File(base,confItems[i].visualSD);
    File audioSD=new File(base,confItems[i].audioSD);
    File audioPrompt=new File(base,confItems[i].audioPrompt);
    rval[i]=new CategoryItem(imgFile,audioSD,audioPrompt);
  }
  return rval;
}

Fixed version (ground truth):
/** 
 * @param config
 * @return
 * @throws IOException
 */
protected CategoryItem[] parseItems(SessionConfig config) throws IOException {
  if (config == null) {
    return new CategoryItem[0];
  }
  ItemConfig[] confItems=config.getItems();
  CategoryItem[] rval=new CategoryItem[confItems.length];
  String base=config.getItemBase();
  for (int i=0; i < rval.length; ++i) {
    File imgFile=new File(base,confItems[i].visualSD);
    File audioSD=null;
    if (confItems[i].audioSD != null) {
      audioSD=new File(base,confItems[i].audioSD);
    }
    File audioPrompt=null;
    if (confItems[i].audioPrompt != null) {
      audioPrompt=new File(base,confItems[i].audioPrompt);
    }
    rval[i]=new CategoryItem(imgFile,audioSD,audioPrompt);
  }
  return rval;
}
Program: 180434
Project: 180434
Buggy source:
private int getPromptLen(File sndFile){
  AudioInputStream audioInputStream;
  try {
    audioInputStream=AudioSystem.getAudioInputStream(sndFile);
    AudioFormat format=audioInputStream.getFormat();
    long frames=audioInputStream.getFrameLength();
    audioInputStream.close();
    return (int)(frames / format.getFrameRate());
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
    return 0;
  }
}

Fixed version (ground truth):
private int getPromptLen(File sndFile){
  if (sndFile == null) {
    return 0;
  }
  AudioInputStream audioInputStream;
  try {
    audioInputStream=AudioSystem.getAudioInputStream(sndFile);
    AudioFormat format=audioInputStream.getFormat();
    long frames=audioInputStream.getFrameLength();
    audioInputStream.close();
    return (int)(frames / format.getFrameRate());
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
    return 0;
  }
}
Program: 180436
Project: 180436
Buggy source:
@Test public void percentTest(){
  SessionDataCollector collector=new SessionDataCollector(session,desc);
  collector.addResponse(item1,true,RespType.INDEPENDANT);
  collector.addResponse(item1,false,RespType.MODEL);
  collector.addResponse(item2,true,RespType.VERBAL);
  collector.addResponse(item2,false,RespType.NONE);
  SessionData data=collector.getData();
  assertNotNull(data);
  Stats overall=data.getOverall();
  assertEquals(25,overall.getPercentIndep(),0);
  assertEquals(25,overall.getPercentVerbal(),0);
  assertEquals(25,overall.getPercentModel(),0);
  assertEquals(session,overall.getName());
}

Fixed version (ground truth):
@Test public void percentTest(){
  SessionDataCollector collector=new SessionDataCollector(session,desc);
  collector.addResponse(item1,true,RespType.INDEPENDENT);
  collector.addResponse(item1,false,RespType.MODEL);
  collector.addResponse(item2,true,RespType.VERBAL);
  collector.addResponse(item2,false,RespType.NONE);
  SessionData data=collector.getData();
  assertNotNull(data);
  Stats overall=data.getOverall();
  assertEquals(25,overall.getPercentIndep(),0);
  assertEquals(25,overall.getPercentVerbal(),0);
  assertEquals(25,overall.getPercentModel(),0);
  assertEquals(session,overall.getName());
}
Program: 180437
Project: 180437
Buggy source:
protected String getAudioString(String base,String imgStr){
  File imgFile=new File(base,imgStr);
  String rval=null;
  File audioFile=getAudio(imgFile);
  if (audioFile != null) {
    String absPath=audioFile.getAbsolutePath();
    if (base != null) {
      rval=absPath.substring(base.length());
    }
  }
  return rval;
}

Fixed version (ground truth):
protected String getAudioString(String base,String imgStr){
  File imgFile=new File(base,imgStr);
  String rval=null;
  File audioFile=getAudio(imgFile);
  if (audioFile != null) {
    String absPath=audioFile.getAbsolutePath();
    if (base != null) {
      rval=absPath.substring(absPath.indexOf(base) + base.length());
    }
  }
  return rval;
}
Program: 180438
Project: 180438
Buggy source:
public void useNewSession(){
  if (bDebounce) {
    return;
  }
  bDebounce=true;
  centerButton.removeActionListener(this);
  clickToStartButton.setEnabled(false);
  clickToStartButton.setForeground(Color.white);
  if (null != session) {
    CategoryItem[] copy=Arrays.copyOf(session.getItems(),session.getItems().length);
    for (int i=0; i < session.getShuffleCount(); ++i) {
      Shuffler.shuffle(copy);
    }
    itemQueue=new ConcurrentLinkedQueue<CategoryItem>();
    for (    CategoryItem item : copy) {
      itemQueue.add(item);
    }
    itemQueue.add(copy[copy.length - 1]);
    totalItemCount=itemQueue.size() - 1;
    mediator.setSession(session);
    setupCenterButton();
    setFrameTitle();
    refreshGui();
    setupTimer();
    setupBetweenTimer();
    enableButtons();
  }
}

Fixed version (ground truth):
public void useNewSession(){
  if (bDebounce) {
    return;
  }
  bDebounce=true;
  centerButton.removeActionListener(this);
  clickToStartButton.setEnabled(false);
  clickToStartButton.setForeground(Color.white);
  if (null != session) {
    CategoryItem[] copy=Arrays.copyOf(session.getItems(),session.getItems().length);
    for (int i=0; i < session.getShuffleCount(); ++i) {
      Shuffler.shuffle(copy);
    }
    itemQueue=new ConcurrentLinkedQueue<CategoryItem>();
    for (    CategoryItem item : copy) {
      itemQueue.add(item);
    }
    itemQueue.add(copy[copy.length - 1]);
    totalItemCount=itemQueue.size() - 1;
    mediator.setSession(session);
    setupCenterButton();
    setFrameTitle();
    refreshGui();
    setupTimer();
    setupBetweenTimer();
    enableButtons();
    mediator.execute(Mediator.BETWEEN_TIMER);
  }
}
Program: 180439
Project: 180439
Buggy source:
public void setupCenterButton(){
  CategoryItem first=itemQueue.remove();
  log.info(String.format("String_Node_Str",first.getImgFile(),first.getItemNumber()));
  imgIconCenter=new ImageIcon(first.getImg());
  centerButton.setIcon(imgIconCenter);
  Dimension max=session.getMaxDimensions();
  centerButton.setPreferredSize(max);
  int width=(int)max.getWidth();
  int height=(int)max.getHeight();
  clearImage=new BufferedImage(width,height,BufferedImage.TYPE_INT_RGB);
  Graphics g=clearImage.getGraphics();
  g.setColor(Color.WHITE);
  g.fillRect(0,0,width,height);
  g.dispose();
}

Fixed version (ground truth):
public void setupCenterButton(){
  Dimension max=session.getMaxDimensions();
  centerButton.setPreferredSize(max);
  int width=(int)max.getWidth();
  int height=(int)max.getHeight();
  clearImage=new BufferedImage(width,height,BufferedImage.TYPE_INT_RGB);
  Graphics g=clearImage.getGraphics();
  g.setColor(Color.WHITE);
  g.fillRect(0,0,width,height);
  g.dispose();
}
Program: 180440
Project: 180440
Buggy source:
public void useNewSession(){
  if (null != session) {
    CategoryItem[] copy=Arrays.copyOf(session.getItems(),session.getItems().length);
    for (int i=0; i < session.getShuffleCount(); ++i) {
      Shuffler.shuffle(copy);
    }
    itemQueue=new ConcurrentLinkedQueue<CategoryItem>();
    for (    CategoryItem item : copy) {
      itemQueue.add(item);
    }
    mediator.setSession(session);
    setupCenterButton();
    setFrameTitle();
    refreshGui();
    setupTimer();
  }
}

Fixed version (ground truth):
public void useNewSession(){
  if (null != session) {
    CategoryItem[] copy=Arrays.copyOf(session.getItems(),session.getItems().length);
    for (int i=0; i < session.getShuffleCount(); ++i) {
      Shuffler.shuffle(copy);
    }
    itemQueue=new ConcurrentLinkedQueue<CategoryItem>();
    for (    CategoryItem item : copy) {
      itemQueue.add(item);
    }
    mediator.setSession(session);
    setupCenterButton();
    setFrameTitle();
    refreshGui();
    setupTimer();
    enableButtons();
  }
}
Program: 180441
Project: 180441
Buggy source:
private JPanel setupMainPanel(){
  JPanel panel=new JPanel();
  panel.setLayout(new BorderLayout());
  JPanel southPanel=new JPanel();
  attending=new JCheckBox(attendingAction);
  southPanel.add(attending);
  JButton responseButton=new JButton(independentAction);
  southPanel.add(responseButton);
  responseButton=new JButton(verbalAction);
  southPanel.add(responseButton);
  responseButton=new JButton(modelingAction);
  southPanel.add(responseButton);
  responseButton=new JButton(noAnswerAction);
  southPanel.add(responseButton);
  panel.add(southPanel,BorderLayout.SOUTH);
  byte[] imageData=null;
  try {
    imageData=readImageDataFromClasspath("String_Node_Str",17833);
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str");
    e.printStackTrace();
  }
  ImageIcon ii=null;
  if (null != imageData) {
    ii=new ImageIcon(imageData);
  }
  if (null == imageData) {
    try {
      ii=new ImageIcon(new URL("String_Node_Str"));
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
  centerButton=new JButton(ii);
  panel.add(centerButton,BorderLayout.CENTER);
  return panel;
}

Fixed version (ground truth):
private JPanel setupMainPanel(){
  JPanel panel=new JPanel();
  panel.setLayout(new BorderLayout());
  JPanel southPanel=new JPanel();
  attending=new JCheckBox(attendingAction);
  southPanel.add(attending);
  lstButtons=new ArrayList<JComponent>();
  lstButtons.add(attending);
  addButton(southPanel,independentAction);
  addButton(southPanel,verbalAction);
  addButton(southPanel,modelingAction);
  addButton(southPanel,noAnswerAction);
  panel.add(southPanel,BorderLayout.SOUTH);
  byte[] imageData=null;
  try {
    imageData=readImageDataFromClasspath("String_Node_Str",17833);
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str");
    e.printStackTrace();
  }
  iiSmilingFace=null;
  if (null != imageData) {
    iiSmilingFace=new ImageIcon(imageData);
  }
  if (null == imageData) {
    try {
      iiSmilingFace=new ImageIcon(new URL("String_Node_Str"));
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
  centerButton=new JButton(iiSmilingFace);
  panel.add(centerButton,BorderLayout.CENTER);
  return panel;
}
Program: 180442
Project: 180442
Buggy source:
public Gui(){
  String tmpDirStr="String_Node_Str";
  tmpDir=new File(tmpDirStr);
  tmpDir.mkdirs();
  mediator=new Mediator(this);
  setupActions(mediator);
  mainPanel=setupMainPanel();
  frame=new JFrame(frameTitle);
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  frame.getContentPane().add(mainPanel);
  setupMenus();
}

Fixed version (ground truth):
public Gui(){
  String tmpDirStr="String_Node_Str";
  tmpDir=new File(tmpDirStr);
  tmpDir.mkdirs();
  mediator=new Mediator(this);
  setupActions(mediator);
  mainPanel=setupMainPanel();
  frame=new JFrame(frameTitle);
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  frame.getContentPane().add(mainPanel);
  setupMenus();
  disableButtons();
}
Program: 180443
Project: 180443
Buggy source:
public void setupTimer(){
  timer=new Timer(session.getTimeDelayAnswer(),timerAction);
  timer.setInitialDelay(session.getTimeDelayPrompt());
  timer.setRepeats(true);
  timer.start();
}

Fixed version (ground truth):
public void setupTimer(){
  timer=new Timer(session.getTimeDelayAnswer() * 1000,timerAction);
  timer.setInitialDelay(session.getTimeDelayPrompt() * 1000);
  timer.setRepeats(true);
  timer.start();
}
Program: 180444
Project: 180444
Buggy source:
public void execute(int action){
  boolean hit=false;
switch (action) {
case ATTENDING:
    break;
case INDEPENDENT:
  collector.addResponse(item,gui.getAttending().isSelected(),RespType.INDEPENDANT);
hit=true;
break;
case VERBAL:
collector.addResponse(item,gui.getAttending().isSelected(),RespType.VERBAL);
hit=true;
break;
case MODELING:
collector.addResponse(item,gui.getAttending().isSelected(),RespType.MODEL);
hit=true;
break;
case NO_ANSWER:
collector.addResponse(item,gui.getAttending().isSelected(),RespType.NONE);
hit=true;
break;
case QUIT:
System.exit(0);
break;
case TIMER:
timer();
break;
case OPEN:
gui.openSession();
break;
case OPEN_HTTP:
gui.openHttpSession();
break;
}
if (hit) {
if (gui.getItemQueue().size() == 0) {
String fileName=System.getProperty("String_Node_Str") + "String_Node_Str";
try {
File csvFile=new File(fileName);
CSVWriter csvWriter=new CSVWriter(new FileWriter(csvFile,true));
SessionData data=collector.getData();
data.write(csvWriter);
csvWriter.close();
System.out.println("String_Node_Str" + csvFile);
}
 catch (IOException e) {
log.error(String.format("String_Node_Str",fileName),e);
e.printStackTrace();
}
System.exit(0);
}
 else {
item=gui.getItemQueue().remove();
gui.switchImage(item.getImgFile());
gui.getTimer().start();
}
}
}

Fixed version (ground truth):
public void execute(int action){
  boolean hit=false;
switch (action) {
case ATTENDING:
    break;
case INDEPENDENT:
  collector.addResponse(item,gui.getAttending().isSelected(),RespType.INDEPENDANT);
hit=true;
break;
case VERBAL:
collector.addResponse(item,gui.getAttending().isSelected(),RespType.VERBAL);
hit=true;
break;
case MODELING:
collector.addResponse(item,gui.getAttending().isSelected(),RespType.MODEL);
hit=true;
break;
case NO_ANSWER:
collector.addResponse(item,gui.getAttending().isSelected(),RespType.NONE);
hit=true;
break;
case QUIT:
System.exit(0);
break;
case TIMER:
timer();
break;
case OPEN:
gui.openSession();
break;
case OPEN_HTTP:
gui.openHttpSession();
break;
}
if (hit) {
if (gui.getItemQueue().size() == 0) {
String fileName=System.getProperty("String_Node_Str") + "String_Node_Str";
try {
File csvFile=new File(fileName);
CSVWriter csvWriter=new CSVWriter(new FileWriter(csvFile,true));
SessionData data=collector.getData();
data.write(csvWriter);
csvWriter.close();
System.out.println("String_Node_Str" + csvFile);
}
 catch (IOException e) {
log.error(String.format("String_Node_Str",fileName),e);
e.printStackTrace();
}
gui.backToStartScreen();
}
 else {
item=gui.getItemQueue().remove();
gui.switchImage(item.getImgFile());
gui.getTimer().start();
}
}
}
Program: 180445
Project: 180445
Buggy source:
public void backToStartScreen(){
  centerButton.setIcon(iiSmilingFace);
  refreshGui();
  disableButtons();
}

Fixed version (ground truth):
public void backToStartScreen(){
  frame.setTitle(frameTitle);
  centerButton.setIcon(iiSmilingFace);
  refreshGui();
  disableButtons();
}
Program: 180446
Project: 180446
Buggy source:
public void setupTimer(){
  timer=new Timer(session.getTimeDelayAnswer() * 1000,timerAction);
  timer.setInitialDelay(session.getTimeDelayPrompt() * 1000);
  timer.setRepeats(true);
  timer.start();
}

Fixed version (ground truth):
public void setupTimer(){
  if (null != timer) {
    timer.stop();
  }
  timer=new Timer(session.getTimeDelayAnswer() * 1000,timerAction);
  timer.setInitialDelay(session.getTimeDelayPrompt() * 1000);
  timer.setRepeats(true);
  timer.start();
}
Program: 180447
Project: 180447
Buggy source:
private void displayClickToBegin(){
  centerButton.setEnabled(true);
  centerButton.setIcon(iiSmilingFaceClickToBegin);
  centerButton.setText("String_Node_Str");
  centerButton.invalidate();
  refreshGui();
}

Fixed version (ground truth):
private void displayClickToBegin(){
  centerButton.setEnabled(true);
  centerButton.addActionListener(this);
  centerButton.setIcon(iiSmilingFaceClickToBegin);
  centerButton.setText("String_Node_Str");
  centerButton.invalidate();
  refreshGui();
}
Program: 180448
Project: 180448
Buggy source:
public void execute(int action){
  boolean hit=false;
switch (action) {
case ATTENDING:
    break;
case INDEPENDENT:
  collector.addResponse(item,gui.getAttending().isSelected(),RespType.INDEPENDANT);
hit=true;
break;
case VERBAL:
collector.addResponse(item,gui.getAttending().isSelected(),RespType.VERBAL);
hit=true;
break;
case MODELING:
collector.addResponse(item,gui.getAttending().isSelected(),RespType.MODEL);
hit=true;
break;
case NO_ANSWER:
collector.addResponse(item,gui.getAttending().isSelected(),RespType.NONE);
hit=true;
break;
case QUIT:
System.exit(0);
break;
case TIMER:
timer();
break;
case OPEN:
gui.openSession();
break;
case OPEN_HTTP:
gui.openHttpSession();
break;
}
if (hit) {
if (gui.getItemQueue().size() == 0) {
String fileName=System.getProperty("String_Node_Str") + "String_Node_Str";
try {
File csvFile=new File(fileName);
CSVWriter csvWriter=new CSVWriter(new FileWriter(csvFile,true));
SessionData data=collector.getData();
data.write(csvWriter);
csvWriter.close();
System.out.println("String_Node_Str" + csvFile);
}
 catch (IOException e) {
log.error(String.format("String_Node_Str",fileName),e);
e.printStackTrace();
}
gui.backToStartScreen();
}
 else {
item=gui.getItemQueue().remove();
gui.switchImage(item.getImgFile());
gui.getTimer().start();
}
}
}

Fixed version (ground truth):
public void execute(int action){
  boolean hit=false;
switch (action) {
case ATTENDING:
    break;
case INDEPENDENT:
  collector.addResponse(item,gui.getAttending().isSelected(),RespType.INDEPENDANT);
hit=true;
break;
case VERBAL:
collector.addResponse(item,gui.getAttending().isSelected(),RespType.VERBAL);
hit=true;
break;
case MODELING:
collector.addResponse(item,gui.getAttending().isSelected(),RespType.MODEL);
hit=true;
break;
case NO_ANSWER:
collector.addResponse(item,gui.getAttending().isSelected(),RespType.NONE);
hit=true;
break;
case QUIT:
System.exit(0);
break;
case TIMER:
timer();
break;
case OPEN:
gui.openSession();
break;
case OPEN_HTTP:
gui.openHttpSession();
break;
}
if (hit) {
gui.getTimer().stop();
if (gui.getItemQueue().size() == 0) {
String fileName=System.getProperty("String_Node_Str") + "String_Node_Str";
try {
File csvFile=new File(fileName);
CSVWriter csvWriter=new CSVWriter(new FileWriter(csvFile,true));
SessionData data=collector.getData();
data.write(csvWriter);
csvWriter.close();
System.out.println("String_Node_Str" + csvFile);
}
 catch (IOException e) {
log.error(String.format("String_Node_Str",fileName),e);
e.printStackTrace();
}
gui.backToStartScreen();
gui.getTimer().stop();
}
 else {
item=gui.getItemQueue().remove();
gui.switchImage(item.getImgFile());
gui.getTimer().start();
}
}
}
Program: 180450
Project: 180450
Buggy source:
public void useNewSession(){
  centerButton.removeActionListener(this);
  clickToStartButton.setEnabled(false);
  clickToStartButton.setForeground(Color.white);
  if (null != session) {
    CategoryItem[] copy=Arrays.copyOf(session.getItems(),session.getItems().length);
    for (int i=0; i < session.getShuffleCount(); ++i) {
      Shuffler.shuffle(copy);
    }
    itemQueue=new ConcurrentLinkedQueue<CategoryItem>();
    for (    CategoryItem item : copy) {
      itemQueue.add(item);
    }
    mediator.setSession(session);
    setupCenterButton();
    setFrameTitle();
    refreshGui();
    setupTimer();
    enableButtons();
  }
}

Fixed version (ground truth):
public void useNewSession(){
  if (bDebounce) {
    return;
  }
  bDebounce=true;
  centerButton.removeActionListener(this);
  clickToStartButton.setEnabled(false);
  clickToStartButton.setForeground(Color.white);
  if (null != session) {
    CategoryItem[] copy=Arrays.copyOf(session.getItems(),session.getItems().length);
    for (int i=0; i < session.getShuffleCount(); ++i) {
      Shuffler.shuffle(copy);
    }
    itemQueue=new ConcurrentLinkedQueue<CategoryItem>();
    for (    CategoryItem item : copy) {
      itemQueue.add(item);
    }
    itemQueue.add(copy[copy.length - 1]);
    totalItemCount=itemQueue.size() - 1;
    mediator.setSession(session);
    setupCenterButton();
    setFrameTitle();
    refreshGui();
    setupTimer();
    enableButtons();
  }
}
Program: 180451
Project: 180451
Buggy source:
private void setFrameTitle(){
  frame.setTitle(frameTitle + String.format("String_Node_Str",itemQueue.size() + 1,session.getItems().length));
}

Fixed version (ground truth):
private void setFrameTitle(){
  frame.setTitle(frameTitle + String.format("String_Node_Str",shownItemCount++,totalItemCount));
}
Program: 180452
Project: 180452
Buggy source:
public void actionPerformed(ActionEvent e){
  if (clickToStartButton == e.getSource()) {
    useNewSession();
  }
 else   if (BROWSE_SESSION_DATA_FILE.equals(e.getActionCommand())) {
    chooseSessionDataFile();
  }
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent e){
  if ((clickToStartButton == e.getSource()) || (centerButton == e.getSource())) {
    useNewSession();
  }
 else   if (BROWSE_SESSION_DATA_FILE.equals(e.getActionCommand())) {
    chooseSessionDataFile();
  }
}
Program: 180453
Project: 180453
Buggy source:
public void openHttpSession(){
  String[] possibilities={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  if (null != codeBaseUrl) {
    possibilities=readPossiblitiesFromUrl(codeBaseUrl,"String_Node_Str");
  }
  String s=(String)JOptionPane.showInputDialog(frame,"String_Node_Str" + "String_Node_Str","String_Node_Str",JOptionPane.PLAIN_MESSAGE,null,possibilities,"String_Node_Str");
  System.out.println("String_Node_Str" + s);
  unpackToTempDirectory(s);
}

Fixed version (ground truth):
public void openHttpSession(){
  bDebounce=false;
  String[] possibilities={"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  if (null != codeBaseUrl) {
    possibilities=readPossiblitiesFromUrl(codeBaseUrl,"String_Node_Str");
  }
  String s=(String)JOptionPane.showInputDialog(frame,"String_Node_Str" + "String_Node_Str","String_Node_Str",JOptionPane.PLAIN_MESSAGE,null,possibilities,"String_Node_Str");
  System.out.println("String_Node_Str" + s);
  unpackToTempDirectory(s);
}
Program: 180454
Project: 180454
Buggy source:
private void displayClickToBegin(){
  centerButton.setEnabled(true);
  centerButton.setIcon(iiSmilingFaceClickToBegin);
  centerButton.invalidate();
  clickToStartButton.setEnabled(true);
  clickToStartButton.setForeground(Color.red);
  refreshGui();
}

Fixed version (ground truth):
private void displayClickToBegin(){
  centerButton.setEnabled(true);
  centerButton.addActionListener(this);
  centerButton.setIcon(iiSmilingFaceClickToBegin);
  centerButton.invalidate();
  clickToStartButton.setEnabled(true);
  clickToStartButton.setForeground(Color.red);
  refreshGui();
}
Program: 180455
Project: 180455
Buggy source:
public void openSession(){
  File file;
  JFileChooser chooser=new JFileChooser(new File("String_Node_Str"));
  int returnVal=chooser.showOpenDialog(frame);
  if (returnVal == JFileChooser.APPROVE_OPTION) {
    file=chooser.getSelectedFile();
    try {
      readSessionFile(file);
    }
 catch (    Exception e) {
      JOptionPane.showMessageDialog(frame,String.format("String_Node_Str",file,e));
      e.printStackTrace();
    }
  }
  displayClickToBegin();
}

Fixed version (ground truth):
public void openSession(){
  bDebounce=false;
  File file;
  JFileChooser chooser=new JFileChooser(new File("String_Node_Str"));
  int returnVal=chooser.showOpenDialog(frame);
  if (returnVal == JFileChooser.APPROVE_OPTION) {
    file=chooser.getSelectedFile();
    try {
      readSessionFile(file);
    }
 catch (    Exception e) {
      JOptionPane.showMessageDialog(frame,String.format("String_Node_Str",file,e));
      e.printStackTrace();
    }
  }
  displayClickToBegin();
}
Program: 180458
Project: 180458
Buggy source:
private MacAddress readMacFromDevice(final String port,final DeviceType deviceType) throws Exception {
  final Connection connection=connectionFactory.create(deviceType);
  connection.connect(port);
  if (!connection.isConnected()) {
    throw new Exception("String_Node_Str" + port + "String_Node_Str");
  }
  try {
    final Device device=deviceFactory.create(deviceType,connection);
    final ReadMacAddressOperation readMacAddressOperation=device.createReadMacAddressOperation();
    MacAddress macAddress=readMacAddressOperation.execute(new RootProgressManager(new Monitor(){
      private int lastProgress=-1;
      @Override public void onProgressChange(      final float fraction){
        int newProgress=(int)Math.floor(fraction * 100);
        if (lastProgress < newProgress) {
          lastProgress=newProgress;
          log.debug("String_Node_Str",newProgress);
        }
      }
    }
));
    if (use16BitMode) {
      macAddress=macAddress.to16BitMacAddress();
    }
    return macAddress;
  }
  finally {
    Closeables.closeQuietly(connection);
  }
}

Fixed version (ground truth):
private MacAddress readMacFromDevice(final String port,final DeviceType deviceType) throws Exception {
  final Connection connection=connectionFactory.create(deviceType);
  try {
    connection.connect(port);
  }
 catch (  Exception e) {
    throw new Exception("String_Node_Str" + port + "String_Node_Str"+ e.getMessage());
  }
  if (!connection.isConnected()) {
    throw new Exception("String_Node_Str" + port + "String_Node_Str");
  }
  try {
    final Device device=deviceFactory.create(deviceType,connection);
    final ReadMacAddressOperation readMacAddressOperation=device.createReadMacAddressOperation();
    MacAddress macAddress=readMacAddressOperation.execute(new RootProgressManager(new Monitor(){
      private int lastProgress=-1;
      @Override public void onProgressChange(      final float fraction){
        int newProgress=(int)Math.floor(fraction * 100);
        if (lastProgress < newProgress) {
          lastProgress=newProgress;
          log.debug("String_Node_Str",newProgress);
        }
      }
    }
));
    if (use16BitMode) {
      macAddress=macAddress.to16BitMacAddress();
    }
    return macAddress;
  }
  finally {
    Closeables.closeQuietly(connection);
  }
}
Program: 180459
Project: 180459
Buggy source:
@Override public void actionPerformed(ActionEvent ae){
  Transformer<P2PVertex,Shape> shapeTransformer=getRenderContext().getVertexShapeTransformer();
  if (shapeTransformer.getClass().equals(P2PVertexShapeTransformer.class)) {
    P2PVertexShapeTransformer<P2PVertex,P2PConnection> scalableTransformer=(P2PVertexShapeTransformer<P2PVertex,P2PConnection>)shapeTransformer;
    if (((JCheckBox)ae.getSource()).isSelected()) {
      scalableTransformer.setScaling(true);
    }
 else {
      scalableTransformer.setScaling(false);
    }
  }
  repaint();
}

Fixed version (ground truth):
@Override public void actionPerformed(ActionEvent ae){
  setScaling(((JCheckBox)ae.getSource()).isSelected());
}
Program: 180460
Project: 180460
Buggy source:
public void setCollapsedPeerAndDocumentView(){
  setName("String_Node_Str");
  getRenderContext().setVertexFillPaintTransformer(new P2PVertexFillPaintTransformer(getPickedVertexState()));
  getRenderContext().setVertexIncludePredicate(new ExclusiveVertexInOtherGraphPredicate(graph.getDynamicGraph(),PeerDocumentVertex.class));
  setSpecialTransformers(VertexShapeType.ELLIPSE,VertexShapeType.PENTAGON,VertexShapeType.RECTANGLE,EdgeShapeType.QUAD_CURVE,EdgeShapeType.CUBIC_CURVE,EdgeShapeType.LINE,EdgeShapeType.LINE);
  repaint();
}

Fixed version (ground truth):
public void setCollapsedPeerAndDocumentView(){
  setName("String_Node_Str");
  getRenderContext().setVertexFillPaintTransformer(new P2PVertexFillPaintTransformer(getPickedVertexState()));
  getRenderContext().setVertexIncludePredicate(new ExclusiveVertexInOtherGraphPredicate(graph.getDynamicGraph(),PeerDocumentVertex.class));
  setSpecialTransformers(VertexShapeType.ELLIPSE,VertexShapeType.PENTAGON,VertexShapeType.RECTANGLE,EdgeShapeType.QUAD_CURVE,EdgeShapeType.CUBIC_CURVE,EdgeShapeType.LINE,EdgeShapeType.LINE);
  setScaling();
  repaint();
}
Program: 180461
Project: 180461
Buggy source:
public void setCollapsedPeerView(){
  setName("String_Node_Str");
  getRenderContext().setVertexFillPaintTransformer(new P2PVertexFillPaintTransformer(getPickedVertexState()));
  getRenderContext().setVertexIncludePredicate(new ExclusiveVertexInOtherGraphPredicate(graph.getDynamicGraph(),DocumentVertex.class));
  setSpecialTransformers(VertexShapeType.ELLIPSE,VertexShapeType.PENTAGON,VertexShapeType.RECTANGLE,EdgeShapeType.QUAD_CURVE,EdgeShapeType.CUBIC_CURVE,EdgeShapeType.LINE,EdgeShapeType.LINE);
  repaint();
}

Fixed version (ground truth):
public void setCollapsedPeerView(){
  setName("String_Node_Str");
  getRenderContext().setVertexFillPaintTransformer(new P2PVertexFillPaintTransformer(getPickedVertexState()));
  getRenderContext().setVertexIncludePredicate(new ExclusiveVertexInOtherGraphPredicate(graph.getDynamicGraph(),DocumentVertex.class));
  setSpecialTransformers(VertexShapeType.ELLIPSE,VertexShapeType.PENTAGON,VertexShapeType.RECTANGLE,EdgeShapeType.QUAD_CURVE,EdgeShapeType.CUBIC_CURVE,EdgeShapeType.LINE,EdgeShapeType.LINE);
  setScaling();
  repaint();
}
Program: 180462
Project: 180462
Buggy source:
public void setCollapsedDocumentView(){
  setName("String_Node_Str");
  getRenderContext().setVertexFillPaintTransformer(new P2PVertexFillPaintTransformer(getPickedVertexState(),Color.RED,Color.YELLOW,Color.MAGENTA,Color.RED,Color.RED,Color.BLUE));
  getRenderContext().setVertexShapeTransformer(new P2PVertexShapeTransformer<P2PVertex,P2PConnection>(graph.getReferenceGraph(),VertexShapeType.ELLIPSE,VertexShapeType.PENTAGON,VertexShapeType.ELLIPSE,P2PVertexShapeTransformer.PEER_SIZE,P2PVertexShapeTransformer.DOC_SIZE,P2PVertexShapeTransformer.PEER_SIZE));
  getRenderContext().setEdgeShapeTransformer(new P2PEdgeShapeTransformer(EdgeShapeType.QUAD_CURVE,EdgeShapeType.CUBIC_CURVE,EdgeShapeType.LINE,EdgeShapeType.LINE));
  getRenderContext().setVertexIncludePredicate(new ExclusiveVertexInOtherGraphPredicate(graph.getDynamicGraph(),PeerVertex.class));
  repaint();
}

Fixed version (ground truth):
public void setCollapsedDocumentView(){
  setName("String_Node_Str");
  getRenderContext().setVertexFillPaintTransformer(new P2PVertexFillPaintTransformer(getPickedVertexState(),Color.RED,Color.YELLOW,Color.MAGENTA,Color.RED,Color.RED,Color.BLUE));
  getRenderContext().setVertexShapeTransformer(new P2PVertexShapeTransformer<P2PVertex,P2PConnection>(graph.getReferenceGraph(),VertexShapeType.ELLIPSE,VertexShapeType.PENTAGON,VertexShapeType.ELLIPSE,P2PVertexShapeTransformer.PEER_SIZE,P2PVertexShapeTransformer.DOC_SIZE,P2PVertexShapeTransformer.PEER_SIZE));
  getRenderContext().setEdgeShapeTransformer(new P2PEdgeShapeTransformer(EdgeShapeType.QUAD_CURVE,EdgeShapeType.CUBIC_CURVE,EdgeShapeType.LINE,EdgeShapeType.LINE));
  getRenderContext().setVertexIncludePredicate(new ExclusiveVertexInOtherGraphPredicate(graph.getDynamicGraph(),PeerVertex.class));
  setScaling();
  repaint();
}
Program: 180464
Project: 180464
Buggy source:
public void setFullView(){
  setName("String_Node_Str");
  getRenderContext().setVertexFillPaintTransformer(new P2PVertexFillPaintTransformer(getPickedVertexState()));
  getRenderContext().setVertexIncludePredicate(new VertexIsInTheOtherGraphPredicate(graph.getDynamicGraph()));
  setSpecialTransformers(VertexShapeType.ELLIPSE,VertexShapeType.PENTAGON,VertexShapeType.RECTANGLE,EdgeShapeType.QUAD_CURVE,EdgeShapeType.CUBIC_CURVE,EdgeShapeType.LINE,EdgeShapeType.LINE);
  repaint();
}

Fixed version (ground truth):
public void setFullView(){
  setName("String_Node_Str");
  getRenderContext().setVertexFillPaintTransformer(new P2PVertexFillPaintTransformer(getPickedVertexState()));
  getRenderContext().setVertexIncludePredicate(new VertexIsInTheOtherGraphPredicate(graph.getDynamicGraph()));
  setSpecialTransformers(VertexShapeType.ELLIPSE,VertexShapeType.PENTAGON,VertexShapeType.RECTANGLE,EdgeShapeType.QUAD_CURVE,EdgeShapeType.CUBIC_CURVE,EdgeShapeType.LINE,EdgeShapeType.LINE);
  setScaling();
  repaint();
}
Program: 180466
Project: 180466
Buggy source:
/** 
 * Shows the popup menu on the current viewer
 */
public void showPopupMenu(int x,int y){
  setEnabled(true);
  PersonalizedVisualizationViewer currentViewer=applet.getCurrentViewer();
  if (!currentViewer.getName().equals("String_Node_Str")) {
    remove(balloonLayout);
    remove(treeLayout);
  }
 else {
    add(balloonLayout);
    add(treeLayout);
  }
  show(currentViewer,x,y);
}

Fixed version (ground truth):
/** 
 * Shows the popup menu on the current viewer
 */
public void showPopupMenu(int x,int y){
  setEnabled(true);
  PersonalizedVisualizationViewer currentViewer=applet.getCurrentViewer();
  if (!currentViewer.getName().equals("String_Node_Str")) {
    remove(treeSeparator);
    remove(balloonLayout);
    remove(treeLayout);
    remove(radialTreeLayout);
  }
 else {
    add(treeSeparator);
    add(balloonLayout);
    add(treeLayout);
    add(radialTreeLayout);
  }
  show(currentViewer,x,y);
}