nus-yam/ex-repair huggingface dataset:
Program: 32506
Project: 32506
Buggy source:
private void createCustomObjects(){
  softButtons=new ArrayList<SoftButton>(2);
  SoftButton button=new SoftButton();
  button.setType(SoftButtonType.SBT_TEXT);
  button.setIsHighlighted(false);
  button.setSoftButtonID(100);
  button.setText("String_Node_Str");
  button.setSystemAction(SystemAction.DEFAULT_ACTION);
  softButtons.add(button);
  button=new SoftButton();
  button.setType(SoftButtonType.SBT_BOTH);
  button.setIsHighlighted(false);
  button.setSoftButtonID(100);
  button.setText("String_Node_Str");
  button.setSystemAction(SystemAction.STEAL_FOCUS);
  softButtons.add(button);
  button=new SoftButton();
  button.setText(SOFT_BUTTON_TEXT);
  button.setIsHighlighted(SOFT_BUTTON_HIGHLIGHTED);
  Image buttonImage=new Image();
  buttonImage.setImageType(ImageType.DYNAMIC);
  buttonImage.setValue("String_Node_Str");
  button.setImage(buttonImage);
  softButtons.add(button);
  IMAGE_1.setValue("String_Node_Str");
  IMAGE_1.setImageType(ImageType.DYNAMIC);
  IMAGE_2.setValue("String_Node_Str");
  IMAGE_2.setImageType(ImageType.STATIC);
}

Fixed version (ground truth):
private void createCustomObjects(){
  softButtons=new ArrayList<SoftButton>(3);
  SoftButton button=new SoftButton();
  button.setType(SoftButtonType.SBT_TEXT);
  button.setIsHighlighted(false);
  button.setSoftButtonID(100);
  button.setText("String_Node_Str");
  button.setSystemAction(SystemAction.DEFAULT_ACTION);
  softButtons.add(button);
  button=new SoftButton();
  button.setType(SoftButtonType.SBT_BOTH);
  button.setIsHighlighted(false);
  button.setSoftButtonID(101);
  button.setText("String_Node_Str");
  button.setSystemAction(SystemAction.STEAL_FOCUS);
  softButtons.add(button);
  button=new SoftButton();
  button.setText(SOFT_BUTTON_TEXT);
  button.setIsHighlighted(SOFT_BUTTON_HIGHLIGHTED);
  Image buttonImage=new Image();
  buttonImage.setImageType(ImageType.DYNAMIC);
  buttonImage.setValue("String_Node_Str");
  button.setImage(buttonImage);
  softButtons.add(button);
  IMAGE_1.setValue("String_Node_Str");
  IMAGE_1.setImageType(ImageType.DYNAMIC);
  IMAGE_2.setValue("String_Node_Str");
  IMAGE_2.setImageType(ImageType.STATIC);
}
Program: 32508
Project: 32508
Buggy source:
public void createCustomObjects(){
  didResults=new ArrayList<DIDResult>(2);
  DIDResult item1=new DIDResult();
  item1.setData("String_Node_Str");
  item1.setResultCode(VehicleDataResultCode.SUCCESS);
  DIDResult item2=new DIDResult();
  item1.setData("String_Node_Str");
  item1.setResultCode(VehicleDataResultCode.IGNORED);
  didResults.add(item1);
  didResults.add(item2);
}

Fixed version (ground truth):
public void createCustomObjects(){
  didResults=new ArrayList<DIDResult>(2);
  DIDResult item1=new DIDResult();
  item1.setData("String_Node_Str");
  item1.setResultCode(VehicleDataResultCode.SUCCESS);
  DIDResult item2=new DIDResult();
  item2.setData("String_Node_Str");
  item2.setResultCode(VehicleDataResultCode.IGNORED);
  didResults.add(item1);
  didResults.add(item2);
}
Program: 32510
Project: 32510
Buggy source:
@Override protected JSONObject getExpectedParameters(int sdlVersion){
  JSONObject result=new JSONObject();
  JSONObject presetBank=new JSONObject();
  try {
    presetBank.put(PresetBankCapabilities.KEY_ON_SCREEN_PRESETS_AVAILABLE,PRESET_BANK_CAPABILITIES.onScreenPresetsAvailable());
    result.put(SetDisplayLayoutResponse.KEY_DISPLAY_CAPABILITIES,DISPLAY_CAPABILITIES.serializeJSON());
    result.put(SetDisplayLayoutResponse.KEY_PRESET_BANK_CAPABILITIES,presetBank);
    result.put(SetDisplayLayoutResponse.KEY_BUTTON_CAPABILITIES,JsonUtils.createJsonArray(BUTTON_CAPABILITIES_LIST));
    result.put(SetDisplayLayoutResponse.KEY_SOFT_BUTTON_CAPABILITIES,JsonUtils.createJsonArray(SOFT_BUTTON_CAPABILITIES_LIST));
  }
 catch (  JSONException e) {
  }
  return result;
}

Fixed version (ground truth):
@Override protected JSONObject getExpectedParameters(int sdlVersion){
  JSONObject result=new JSONObject();
  JSONObject presetBank=new JSONObject();
  try {
    presetBank.put(PresetBankCapabilities.KEY_ON_SCREEN_PRESETS_AVAILABLE,PRESET_BANK_CAPABILITIES.onScreenPresetsAvailable());
    result.put(SetDisplayLayoutResponse.KEY_DISPLAY_CAPABILITIES,DISPLAY_CAPABILITIES.serializeJSON());
    result.put(SetDisplayLayoutResponse.KEY_PRESET_BANK_CAPABILITIES,presetBank);
    JSONObject buttonCapabilitiesObj=new JSONObject();
    JSONArray buttonCapabilitiesArray=new JSONArray();
    buttonCapabilitiesObj.put(ButtonCapabilities.KEY_LONG_PRESS_AVAILABLE,true);
    buttonCapabilitiesObj.put(ButtonCapabilities.KEY_SHORT_PRESS_AVAILABLE,false);
    buttonCapabilitiesObj.put(ButtonCapabilities.KEY_UP_DOWN_AVAILABLE,true);
    buttonCapabilitiesArray.put(buttonCapabilitiesObj);
    result.put(SetDisplayLayoutResponse.KEY_BUTTON_CAPABILITIES,buttonCapabilitiesArray);
    JSONObject softButtonCapabilitiesObj=new JSONObject();
    JSONArray softButtonCapabilitiesArray=new JSONArray();
    softButtonCapabilitiesObj.put(SoftButtonCapabilities.KEY_UP_DOWN_AVAILABLE,true);
    softButtonCapabilitiesObj.put(SoftButtonCapabilities.KEY_SHORT_PRESS_AVAILABLE,true);
    softButtonCapabilitiesObj.put(SoftButtonCapabilities.KEY_LONG_PRESS_AVAILABLE,false);
    softButtonCapabilitiesObj.put(SoftButtonCapabilities.KEY_IMAGE_SUPPORTED,false);
    softButtonCapabilitiesArray.put(softButtonCapabilitiesObj);
    result.put(SetDisplayLayoutResponse.KEY_SOFT_BUTTON_CAPABILITIES,softButtonCapabilitiesArray);
  }
 catch (  JSONException e) {
  }
  return result;
}
Program: 32511
Project: 32511
Buggy source:
public static JSONArray createJsonArrayOfJsonNames(List<? extends Enum<?>> parameterList,int sdlVersion) throws JSONException {
  JSONArray result=new JSONArray();
  for (  Enum<?> name : parameterList) {
    result.put(name.name());
  }
  return result;
}

Fixed version (ground truth):
public static JSONArray createJsonArrayOfJsonNames(List<? extends Enum<?>> parameterList,int sdlVersion) throws JSONException {
  JSONArray result=new JSONArray();
  for (  Enum<?> name : parameterList) {
    result.put(name);
  }
  return result;
}
Program: 32512
Project: 32512
Buggy source:
@Override public String toString(){
  StringBuilder builder=new StringBuilder();
  builder.append("String_Node_Str");
  builder.append("String_Node_Str" + version);
  builder.append("String_Node_Str" + compression);
  builder.append("String_Node_Str" + frameType);
  builder.append("String_Node_Str" + serviceType);
  builder.append("String_Node_Str" + frameInfo);
  builder.append("String_Node_Str" + sessionId);
  builder.append("String_Node_Str" + dataSize);
  builder.append("String_Node_Str" + messageId);
  builder.append("String_Node_Str");
  return builder.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  StringBuilder builder=new StringBuilder();
  builder.append("String_Node_Str");
  builder.append("String_Node_Str" + version);
  builder.append("String_Node_Str" + compression);
  builder.append("String_Node_Str" + frameType);
  builder.append("String_Node_Str" + serviceType);
  builder.append("String_Node_Str" + frameInfo);
  builder.append("String_Node_Str" + sessionId);
  builder.append("String_Node_Str" + dataSize);
  if (version > 1) {
    builder.append("String_Node_Str" + messageId);
  }
  builder.append("String_Node_Str");
  return builder.toString();
}
Program: 32514
Project: 32514
Buggy source:
public FileType getImageTypeSupported(){
  Object obj=store.get(KEY_IMAGE_TYPE_SUPPORTED);
  if (obj instanceof FileType) {
    return (FileType)obj;
  }
 else   if (obj instanceof String) {
    FileType theCode=null;
    try {
      theCode=FileType.valueForString((String)obj);
    }
 catch (    Exception e) {
      DebugTool.logError("String_Node_Str" + getClass().getSimpleName() + "String_Node_Str"+ KEY_IMAGE_TYPE_SUPPORTED,e);
    }
    return theCode;
  }
  return null;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public List<FileType> getImageTypeSupported(){
  if (store.get(KEY_IMAGE_TYPE_SUPPORTED) instanceof List<?>) {
    List<?> list=(List<?>)store.get(KEY_IMAGE_TYPE_SUPPORTED);
    if (list != null && list.size() > 0) {
      Object obj=list.get(0);
      if (obj instanceof FileType) {
        return (List<FileType>)list;
      }
 else       if (obj instanceof String) {
        List<FileType> newList=new ArrayList<FileType>();
        for (        Object hashObj : list) {
          String strFormat=(String)hashObj;
          FileType theCode=null;
          try {
            theCode=FileType.valueForString(strFormat);
          }
 catch (          Exception e) {
            DebugTool.logError("String_Node_Str" + getClass().getSimpleName() + "String_Node_Str"+ KEY_IMAGE_TYPE_SUPPORTED,e);
          }
          if (theCode != null) {
            newList.add(theCode);
          }
        }
        return newList;
      }
    }
  }
  return null;
}
Program: 32515
Project: 32515
Buggy source:
public LayoutMode getInteractionLayout(){
  Object obj=parameters.get(KEY_INTERACTION_LAYOUT);
  if (obj instanceof DisplayType) {
    return (LayoutMode)obj;
  }
 else   if (obj instanceof String) {
    LayoutMode theCode=null;
    try {
      theCode=LayoutMode.valueForString((String)obj);
    }
 catch (    Exception e) {
      DebugTool.logError("String_Node_Str" + getClass().getSimpleName() + "String_Node_Str"+ KEY_INTERACTION_LAYOUT,e);
    }
    return theCode;
  }
  return null;
}

Fixed version (ground truth):
public LayoutMode getInteractionLayout(){
  Object obj=parameters.get(KEY_INTERACTION_LAYOUT);
  if (obj instanceof LayoutMode) {
    return (LayoutMode)obj;
  }
 else   if (obj instanceof String) {
    LayoutMode theCode=null;
    try {
      theCode=LayoutMode.valueForString((String)obj);
    }
 catch (    Exception e) {
      DebugTool.logError("String_Node_Str" + getClass().getSimpleName() + "String_Node_Str"+ KEY_INTERACTION_LAYOUT,e);
    }
    return theCode;
  }
  return null;
}
Program: 32516
Project: 32516
Buggy source:
@SuppressWarnings("String_Node_Str") public KeyboardProperties getKeyboardProperties(){
  Object obj=parameters.get(KEY_KEYBOARD_PROPERTIES);
  if (obj instanceof Image) {
    return (KeyboardProperties)obj;
  }
 else   if (obj instanceof Hashtable) {
    try {
      return new KeyboardProperties((Hashtable<String,Object>)obj);
    }
 catch (    Exception e) {
      DebugTool.logError("String_Node_Str" + getClass().getSimpleName() + "String_Node_Str"+ KEY_KEYBOARD_PROPERTIES,e);
    }
  }
  return null;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public KeyboardProperties getKeyboardProperties(){
  Object obj=parameters.get(KEY_KEYBOARD_PROPERTIES);
  if (obj instanceof KeyboardProperties) {
    return (KeyboardProperties)obj;
  }
 else   if (obj instanceof Hashtable) {
    try {
      return new KeyboardProperties((Hashtable<String,Object>)obj);
    }
 catch (    Exception e) {
      DebugTool.logError("String_Node_Str" + getClass().getSimpleName() + "String_Node_Str"+ KEY_KEYBOARD_PROPERTIES,e);
    }
  }
  return null;
}
Program: 32517
Project: 32517
Buggy source:
public void setImageTypeSupported(FileType imageTypeSupported){
  if (imageTypeSupported != null) {
    store.put(KEY_IMAGE_TYPE_SUPPORTED,imageTypeSupported);
  }
 else {
    store.remove(KEY_IMAGE_TYPE_SUPPORTED);
  }
}

Fixed version (ground truth):
public void setImageTypeSupported(List<FileType> imageTypeSupported){
  if (imageTypeSupported != null) {
    store.put(KEY_IMAGE_TYPE_SUPPORTED,imageTypeSupported);
  }
 else {
    store.remove(KEY_IMAGE_TYPE_SUPPORTED);
  }
}
Program: 32518
Project: 32518
Buggy source:
public FileType getImageTypeSupported(){
  Object obj=store.get(KEY_IMAGE_TYPE_SUPPORTED);
  if (obj instanceof FileType) {
    return (FileType)obj;
  }
 else   if (obj instanceof String) {
    FileType theCode=null;
    try {
      theCode=FileType.valueForString((String)obj);
    }
 catch (    Exception e) {
      DebugTool.logError("String_Node_Str" + getClass().getSimpleName() + "String_Node_Str"+ KEY_IMAGE_TYPE_SUPPORTED,e);
    }
    return theCode;
  }
  return null;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public List<FileType> getImageTypeSupported(){
  if (store.get(KEY_IMAGE_TYPE_SUPPORTED) instanceof List<?>) {
    List<?> list=(List<?>)store.get(KEY_IMAGE_TYPE_SUPPORTED);
    if (list != null && list.size() > 0) {
      Object obj=list.get(0);
      if (obj instanceof FileType) {
        return (List<FileType>)list;
      }
 else       if (obj instanceof String) {
        List<FileType> newList=new ArrayList<FileType>();
        for (        Object hashObj : list) {
          String strFormat=(String)hashObj;
          FileType theCode=null;
          try {
            theCode=FileType.valueForString(strFormat);
          }
 catch (          Exception e) {
            DebugTool.logError("String_Node_Str" + getClass().getSimpleName() + "String_Node_Str"+ KEY_IMAGE_TYPE_SUPPORTED,e);
          }
          if (theCode != null) {
            newList.add(theCode);
          }
        }
        return newList;
      }
    }
  }
  return null;
}
Program: 32519
Project: 32519
Buggy source:
public LayoutMode getInteractionLayout(){
  Object obj=parameters.get(KEY_INTERACTION_LAYOUT);
  if (obj instanceof DisplayType) {
    return (LayoutMode)obj;
  }
 else   if (obj instanceof String) {
    LayoutMode theCode=null;
    try {
      theCode=LayoutMode.valueForString((String)obj);
    }
 catch (    Exception e) {
      DebugTool.logError("String_Node_Str" + getClass().getSimpleName() + "String_Node_Str"+ KEY_INTERACTION_LAYOUT,e);
    }
    return theCode;
  }
  return null;
}

Fixed version (ground truth):
public LayoutMode getInteractionLayout(){
  Object obj=parameters.get(KEY_INTERACTION_LAYOUT);
  if (obj instanceof LayoutMode) {
    return (LayoutMode)obj;
  }
 else   if (obj instanceof String) {
    LayoutMode theCode=null;
    try {
      theCode=LayoutMode.valueForString((String)obj);
    }
 catch (    Exception e) {
      DebugTool.logError("String_Node_Str" + getClass().getSimpleName() + "String_Node_Str"+ KEY_INTERACTION_LAYOUT,e);
    }
    return theCode;
  }
  return null;
}
Program: 32520
Project: 32520
Buggy source:
@SuppressWarnings("String_Node_Str") public KeyboardProperties getKeyboardProperties(){
  Object obj=parameters.get(KEY_KEYBOARD_PROPERTIES);
  if (obj instanceof Image) {
    return (KeyboardProperties)obj;
  }
 else   if (obj instanceof Hashtable) {
    try {
      return new KeyboardProperties((Hashtable<String,Object>)obj);
    }
 catch (    Exception e) {
      DebugTool.logError("String_Node_Str" + getClass().getSimpleName() + "String_Node_Str"+ KEY_KEYBOARD_PROPERTIES,e);
    }
  }
  return null;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public KeyboardProperties getKeyboardProperties(){
  Object obj=parameters.get(KEY_KEYBOARD_PROPERTIES);
  if (obj instanceof KeyboardProperties) {
    return (KeyboardProperties)obj;
  }
 else   if (obj instanceof Hashtable) {
    try {
      return new KeyboardProperties((Hashtable<String,Object>)obj);
    }
 catch (    Exception e) {
      DebugTool.logError("String_Node_Str" + getClass().getSimpleName() + "String_Node_Str"+ KEY_KEYBOARD_PROPERTIES,e);
    }
  }
  return null;
}
Program: 32521
Project: 32521
Buggy source:
public void setPowerModeQualificationStatus(Names powerModeQualificationStatus){
  if (powerModeQualificationStatus != null) {
    store.put(Names.powerModeQualificationStatus,powerModeQualificationStatus);
  }
 else {
    store.remove(Names.powerModeQualificationStatus);
  }
}

Fixed version (ground truth):
public void setPowerModeQualificationStatus(PowerModeQualificationStatus powerModeQualificationStatus){
  if (powerModeQualificationStatus != null) {
    store.put(Names.powerModeQualificationStatus,powerModeQualificationStatus);
  }
 else {
    store.remove(Names.powerModeQualificationStatus);
  }
}
Program: 32522
Project: 32522
Buggy source:
public void setImageFields(Vector<TextField> imageFields){
  if (imageFields != null) {
    store.put(Names.imageFields,imageFields);
  }
 else {
    store.remove(Names.imageFields);
  }
}

Fixed version (ground truth):
public void setImageFields(Vector<ImageField> imageFields){
  if (imageFields != null) {
    store.put(Names.imageFields,imageFields);
  }
 else {
    store.remove(Names.imageFields);
  }
}
Program: 32523
Project: 32523
Buggy source:
public Vector<TextField> getImageFields(){
  if (store.get(Names.imageFields) instanceof Vector<?>) {
    Vector<?> list=(Vector<?>)store.get(Names.imageFields);
    if (list != null && list.size() > 0) {
      Object obj=list.get(0);
      if (obj instanceof TextField) {
        return (Vector<TextField>)list;
      }
 else       if (obj instanceof Hashtable) {
        Vector<TextField> newList=new Vector<TextField>();
        for (        Object hashObj : list) {
          newList.add(new TextField((Hashtable)hashObj));
        }
        return newList;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
public Vector<ImageField> getImageFields(){
  if (store.get(Names.imageFields) instanceof Vector<?>) {
    Vector<?> list=(Vector<?>)store.get(Names.imageFields);
    if (list != null && list.size() > 0) {
      Object obj=list.get(0);
      if (obj instanceof ImageField) {
        return (Vector<ImageField>)list;
      }
 else       if (obj instanceof Hashtable) {
        Vector<ImageField> newList=new Vector<ImageField>();
        for (        Object hashObj : list) {
          newList.add(new ImageField((Hashtable)hashObj));
        }
        return newList;
      }
    }
  }
  return null;
}
Program: 32524
Project: 32524
Buggy source:
public Image setSecondaryGraphic(){
  Object obj=parameters.get(Names.secondaryGraphic);
  if (obj instanceof Image) {
    return (Image)obj;
  }
 else   if (obj instanceof Hashtable) {
    try {
      return new Image((Hashtable)obj);
    }
 catch (    Exception e) {
      DebugTool.logError("String_Node_Str" + getClass().getSimpleName() + "String_Node_Str"+ Names.secondaryGraphic,e);
    }
  }
  return null;
}

Fixed version (ground truth):
public void setSecondaryGraphic(Image secondaryGraphic){
  if (secondaryGraphic != null) {
    parameters.put(Names.secondaryGraphic,secondaryGraphic);
  }
 else {
    parameters.remove(Names.secondaryGraphic);
  }
}
Program: 32525
Project: 32525
Buggy source:
private static void initPopupMenu(JPopupMenu p){
  for (  JComponent c : Arrays.asList(new JMenuItem("String_Node_Str"),new JMenuItem("String_Node_Str"),new JMenuItem("String_Node_Str"),new JSeparator(),new JMenuItem(new AbstractAction("String_Node_Str"){
    @Override public void actionPerformed(    ActionEvent e){
      JMenuItem m=(JMenuItem)e.getSource();
      JPopupMenu pop=(JPopupMenu)SwingUtilities.getUnwrappedParent(m);
      Component w=SwingUtilities.getRoot(pop.getInvoker());
      if (w instanceof Window) {
        ((Window)w).dispose();
      }
    }
  }
))) {
    c.setOpaque(true);
    p.add(c);
  }
}

Fixed version (ground truth):
private static void initPopupMenu(JPopupMenu p){
  for (  String s : Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str")) {
    p.add(s + "String_Node_Str");
  }
  p.addSeparator();
  p.add("String_Node_Str").addActionListener(e -> {
    JMenuItem m=(JMenuItem)e.getSource();
    JPopupMenu pop=(JPopupMenu)SwingUtilities.getUnwrappedParent(m);
    Component w=SwingUtilities.getRoot(pop.getInvoker());
    if (w instanceof Window) {
      ((Window)w).dispose();
    }
  }
);
}
Program: 32526
Project: 32526
Buggy source:
@Override public Component getTreeCellEditorComponent(JTree tree,Object value,boolean selected,boolean expanded,boolean leaf,int row){
  JLabel l=(JLabel)renderer.getTreeCellRendererComponent(tree,value,true,expanded,leaf,row,true);
  l.setFont(tree.getFont());
  if (value instanceof DefaultMutableTreeNode) {
    checkBox.setEnabled(tree.isEnabled());
    checkBox.setFont(tree.getFont());
    Object userObject=((DefaultMutableTreeNode)value).getUserObject();
    if (userObject instanceof CheckBoxNode) {
      CheckBoxNode node=(CheckBoxNode)userObject;
      if (node.status == Status.INDETERMINATE) {
        checkBox.setIcon(new IndeterminateIcon());
      }
 else {
        checkBox.setIcon(null);
      }
      l.setIcon(fileSystemView.getSystemIcon(file));
      l.setText(fileSystemView.getSystemDisplayName(file));
      checkBox.setSelected(node.status == Status.SELECTED);
      file=node.file;
    }
    panel.add(l);
    return panel;
  }
  return l;
}

Fixed version (ground truth):
@Override public Component getTreeCellEditorComponent(JTree tree,Object value,boolean selected,boolean expanded,boolean leaf,int row){
  JLabel l=(JLabel)renderer.getTreeCellRendererComponent(tree,value,true,expanded,leaf,row,true);
  l.setFont(tree.getFont());
  if (value instanceof DefaultMutableTreeNode) {
    checkBox.setEnabled(tree.isEnabled());
    checkBox.setFont(tree.getFont());
    Object userObject=((DefaultMutableTreeNode)value).getUserObject();
    if (userObject instanceof CheckBoxNode) {
      CheckBoxNode node=(CheckBoxNode)userObject;
      if (node.status == Status.INDETERMINATE) {
        checkBox.setIcon(new IndeterminateIcon());
      }
 else {
        checkBox.setIcon(null);
      }
      file=node.file;
      l.setIcon(fileSystemView.getSystemIcon(file));
      l.setText(fileSystemView.getSystemDisplayName(file));
      checkBox.setSelected(node.status == Status.SELECTED);
    }
    panel.add(l);
    return panel;
  }
  return l;
}
Program: 32527
Project: 32527
Buggy source:
public MainPanel(){
}

Fixed version (ground truth):
public MainPanel(){
  super(new BorderLayout());
  table.setRowSorter(sorter);
  clearButton.addActionListener(e -> sorter.setSortKeys(null));
  add(makeRadioPane(),BorderLayout.NORTH);
  add(clearButton,BorderLayout.SOUTH);
  add(new JScrollPane(table));
  setPreferredSize(new Dimension(320,240));
}
Program: 32529
Project: 32529
Buggy source:
@Override public Component getTableCellRendererComponent(JTable table,Object value,boolean isSelected,boolean hasFocus,int row,int column){
  TableCellRenderer r=t.getTableHeader().getDefaultRenderer();
  JLabel l=(JLabel)r.getTableCellRendererComponent(table,value,isSelected,hasFocus,row,column);
  RowSorter<? extends TableModel> rs=table.getRowSorter();
  if (rs instanceof DefaultRowSorter) {
    l.setForeground(((DefaultRowSorter<? extends TableModel,?>)rs).isSortable(t.convertColumnIndexToModel(col)) ? Color.BLACK : Color.GRAY);
  }
  return l;
}

Fixed version (ground truth):
@Override public Component getTableCellRendererComponent(JTable table,Object value,boolean isSelected,boolean hasFocus,int row,int column){
  TableCellRenderer r=table.getTableHeader().getDefaultRenderer();
  JLabel l=(JLabel)r.getTableCellRendererComponent(table,value,isSelected,hasFocus,row,column);
  RowSorter<? extends TableModel> rs=table.getRowSorter();
  if (rs instanceof DefaultRowSorter) {
    l.setForeground(((DefaultRowSorter<? extends TableModel,?>)rs).isSortable(table.convertColumnIndexToModel(column)) ? Color.BLACK : Color.GRAY);
  }
  return l;
}
Program: 32530
Project: 32530
Buggy source:
private JTable makeDnDTable(){
  JTable t=new JTable(new DefaultTableModel(data,columnNames){
    @Override public Class<?> getColumnClass(    int column){
      return getValueAt(0,column).getClass();
    }
  }
);
  t.getSelectionModel().setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
  t.setTransferHandler(handler);
  t.setDropMode(DropMode.INSERT_ROWS);
  t.setDragEnabled(true);
  t.setFillsViewportHeight(true);
  ActionMap map=t.getActionMap();
  AbstractAction dummy=new AbstractAction(){
    @Override public void actionPerformed(    ActionEvent e){
    }
  }
;
  map.put(TransferHandler.getCutAction().getValue(Action.NAME),dummy);
  map.put(TransferHandler.getCopyAction().getValue(Action.NAME),dummy);
  map.put(TransferHandler.getPasteAction().getValue(Action.NAME),dummy);
  return t;
}

Fixed version (ground truth):
private JTable makeDnDTable(){
  JTable t=new JTable(new DefaultTableModel(data,columnNames){
    @Override public Class<?> getColumnClass(    int column){
      return getValueAt(0,column).getClass();
    }
  }
);
  t.getSelectionModel().setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
  t.setTransferHandler(handler);
  t.setDropMode(DropMode.INSERT_ROWS);
  t.setDragEnabled(true);
  t.setFillsViewportHeight(true);
  t.setAutoCreateRowSorter(true);
  ActionMap map=t.getActionMap();
  AbstractAction dummy=new AbstractAction(){
    @Override public void actionPerformed(    ActionEvent e){
    }
  }
;
  map.put(TransferHandler.getCutAction().getValue(Action.NAME),dummy);
  map.put(TransferHandler.getCopyAction().getValue(Action.NAME),dummy);
  map.put(TransferHandler.getPasteAction().getValue(Action.NAME),dummy);
  return t;
}
Program: 32531
Project: 32531
Buggy source:
@Override public void actionPerformed(ActionEvent e){
  tree.setModel(new DefaultTreeModel(check.isSelected() ? sortTree(makeTreeRoot()) : root));
  expandAll(tree);
}

Fixed version (ground truth):
@Override public void actionPerformed(ActionEvent e){
  if (((JCheckBox)e.getSource()).isSelected()) {
    compare_count=swap_count=0;
    DefaultMutableTreeNode r=deepCopyTree(root,(DefaultMutableTreeNode)root.clone());
    sortTree3(r);
    System.out.format("String_Node_Str",compare_count);
    tree.setModel(new DefaultTreeModel(r));
  }
 else {
    tree.setModel(new DefaultTreeModel(root));
  }
  expandAll(tree);
}
Program: 32532
Project: 32532
Buggy source:
public MainPanel(){
  super(new BorderLayout());
  check.setHorizontalAlignment(SwingConstants.RIGHT);
  check.setAction(new AbstractAction("String_Node_Str"){
    @Override public void actionPerformed(    ActionEvent e){
      tree.setModel(new DefaultTreeModel(check.isSelected() ? sortTree(makeTreeRoot()) : root));
      expandAll(tree);
    }
  }
);
  add(check,BorderLayout.SOUTH);
  add(makeTitledPanel("String_Node_Str",tree));
  expandAll(tree);
  setPreferredSize(new Dimension(320,200));
}

Fixed version (ground truth):
public MainPanel(){
  super(new BorderLayout());
  JPanel box=new JPanel(new GridLayout(2,2));
  box.add(new JCheckBox(new AbstractAction("String_Node_Str"){
    @Override public void actionPerformed(    ActionEvent e){
      if (((JCheckBox)e.getSource()).isSelected()) {
        compare_count=swap_count=0;
        DefaultMutableTreeNode r=deepCopyTree(root,(DefaultMutableTreeNode)root.clone());
        sortTree0(r);
        System.out.format("String_Node_Str",compare_count,swap_count);
        tree.setModel(new DefaultTreeModel(r));
      }
 else {
        tree.setModel(new DefaultTreeModel(root));
      }
      expandAll(tree);
    }
  }
));
  box.add(new JCheckBox(new AbstractAction("String_Node_Str"){
    @Override public void actionPerformed(    ActionEvent e){
      if (((JCheckBox)e.getSource()).isSelected()) {
        compare_count=swap_count=0;
        DefaultMutableTreeNode r=deepCopyTree(root,(DefaultMutableTreeNode)root.clone());
        sortTree1(r);
        System.out.format("String_Node_Str",compare_count,swap_count);
        tree.setModel(new DefaultTreeModel(r));
      }
 else {
        tree.setModel(new DefaultTreeModel(root));
      }
      expandAll(tree);
    }
  }
));
  box.add(new JCheckBox(new AbstractAction("String_Node_Str"){
    @Override public void actionPerformed(    ActionEvent e){
      if (((JCheckBox)e.getSource()).isSelected()) {
        compare_count=swap_count=0;
        DefaultMutableTreeNode r=deepCopyTree(root,(DefaultMutableTreeNode)root.clone());
        sortTree2(r);
        System.out.format("String_Node_Str",compare_count,swap_count);
        tree.setModel(new DefaultTreeModel(r));
      }
 else {
        tree.setModel(new DefaultTreeModel(root));
      }
      expandAll(tree);
    }
  }
));
  box.add(new JCheckBox(new AbstractAction("String_Node_Str"){
    @Override public void actionPerformed(    ActionEvent e){
      if (((JCheckBox)e.getSource()).isSelected()) {
        compare_count=swap_count=0;
        DefaultMutableTreeNode r=deepCopyTree(root,(DefaultMutableTreeNode)root.clone());
        sortTree3(r);
        System.out.format("String_Node_Str",compare_count);
        tree.setModel(new DefaultTreeModel(r));
      }
 else {
        tree.setModel(new DefaultTreeModel(root));
      }
      expandAll(tree);
    }
  }
));
  add(box,BorderLayout.SOUTH);
  add(makeTitledPanel("String_Node_Str",tree));
  expandAll(tree);
  setPreferredSize(new Dimension(320,240));
}
Program: 32533
Project: 32533
Buggy source:
private static DefaultMutableTreeNode makeTreeRoot(){
  DefaultMutableTreeNode root=new DefaultMutableTreeNode("String_Node_Str");
  DefaultMutableTreeNode set1=new DefaultMutableTreeNode("String_Node_Str");
  DefaultMutableTreeNode set2=new DefaultMutableTreeNode("String_Node_Str");
  DefaultMutableTreeNode set3=new DefaultMutableTreeNode("String_Node_Str");
  set1.add(new DefaultMutableTreeNode("String_Node_Str"));
  set1.add(new DefaultMutableTreeNode("String_Node_Str"));
  set1.add(new DefaultMutableTreeNode("String_Node_Str"));
  set2.add(new DefaultMutableTreeNode("String_Node_Str"));
  set2.add(new DefaultMutableTreeNode("String_Node_Str"));
  set3.add(new DefaultMutableTreeNode("String_Node_Str"));
  set3.add(new DefaultMutableTreeNode("String_Node_Str"));
  set3.add(new DefaultMutableTreeNode("String_Node_Str"));
  root.add(set3);
  root.add(set1);
  root.add(set2);
  return root;
}

Fixed version (ground truth):
private static DefaultMutableTreeNode makeTreeRoot(){
  DefaultMutableTreeNode root=new DefaultMutableTreeNode("String_Node_Str");
  DefaultMutableTreeNode set1=new DefaultMutableTreeNode("String_Node_Str");
  DefaultMutableTreeNode set2=new DefaultMutableTreeNode("String_Node_Str");
  DefaultMutableTreeNode set3=new DefaultMutableTreeNode("String_Node_Str");
  DefaultMutableTreeNode set4=new DefaultMutableTreeNode("String_Node_Str");
  set1.add(new DefaultMutableTreeNode("String_Node_Str"));
  set1.add(new DefaultMutableTreeNode("String_Node_Str"));
  set1.add(new DefaultMutableTreeNode("String_Node_Str"));
  set1.add(set4);
  set1.add(new DefaultMutableTreeNode("String_Node_Str"));
  set1.add(new DefaultMutableTreeNode("String_Node_Str"));
  set2.add(new DefaultMutableTreeNode("String_Node_Str"));
  set2.add(new DefaultMutableTreeNode("String_Node_Str"));
  set3.add(new DefaultMutableTreeNode("String_Node_Str"));
  set3.add(new DefaultMutableTreeNode("String_Node_Str"));
  set3.add(new DefaultMutableTreeNode("String_Node_Str"));
  set4.add(new DefaultMutableTreeNode("String_Node_Str"));
  set4.add(new DefaultMutableTreeNode("String_Node_Str"));
  set4.add(new DefaultMutableTreeNode("String_Node_Str"));
  set4.add(new DefaultMutableTreeNode("String_Node_Str"));
  root.add(new DefaultMutableTreeNode("String_Node_Str"));
  root.add(set3);
  root.add(new DefaultMutableTreeNode("String_Node_Str"));
  root.add(set1);
  root.add(set2);
  root.add(new DefaultMutableTreeNode("String_Node_Str"));
  root.add(new DefaultMutableTreeNode("String_Node_Str"));
  return root;
}
Program: 32534
Project: 32534
Buggy source:
public MainPanel(){
  super(new BorderLayout());
  String[] columnNames={"String_Node_Str","String_Node_Str","String_Node_Str"};
  DefaultTableModel model=new DefaultTableModel(null,columnNames){
    @Override public Class<?> getColumnClass(    int column){
switch (column) {
case 0:
        return Integer.class;
case 2:
      return Boolean.class;
default :
    return String.class;
}
}
}
;
model.addTableModelListener(new TableModelListener(){
@Override public void tableChanged(TableModelEvent e){
DefaultTableModel model=(DefaultTableModel)e.getSource();
editor.setVisible(model.getRowCount() == 0);
}
}
);
JTable table=new JTable(model);
table.setAutoCreateRowSorter(true);
table.setFillsViewportHeight(true);
table.setComponentPopupMenu(new TablePopupMenu());
table.setLayout(new GridBagLayout());
String str="String_Node_Str";
JEditorPane editor=new JEditorPane("String_Node_Str",str);
editor.setOpaque(false);
editor.setEditable(false);
editor.putClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES,Boolean.TRUE);
editor.addHyperlinkListener(new HyperlinkListener(){
@Override public void hyperlinkUpdate(HyperlinkEvent e){
if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
  java.awt.Toolkit.getDefaultToolkit().beep();
}
}
}
);
table.add(editor);
add(new JScrollPane(table));
setPreferredSize(new Dimension(320,240));
}

Fixed version (ground truth):
public MainPanel(){
  super(new BorderLayout());
  String str="String_Node_Str";
  final JEditorPane editor=new JEditorPane("String_Node_Str",str);
  editor.setOpaque(false);
  editor.setEditable(false);
  editor.putClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES,Boolean.TRUE);
  editor.addHyperlinkListener(new HyperlinkListener(){
    @Override public void hyperlinkUpdate(    HyperlinkEvent e){
      if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
        java.awt.Toolkit.getDefaultToolkit().beep();
      }
    }
  }
);
  String[] columnNames={"String_Node_Str","String_Node_Str","String_Node_Str"};
  DefaultTableModel model=new DefaultTableModel(null,columnNames){
    @Override public Class<?> getColumnClass(    int column){
switch (column) {
case 0:
        return Integer.class;
case 2:
      return Boolean.class;
default :
    return String.class;
}
}
}
;
model.addTableModelListener(new TableModelListener(){
@Override public void tableChanged(TableModelEvent e){
DefaultTableModel model=(DefaultTableModel)e.getSource();
editor.setVisible(model.getRowCount() == 0);
}
}
);
JTable table=new JTable(model);
table.setAutoCreateRowSorter(true);
table.setFillsViewportHeight(true);
table.setComponentPopupMenu(new TablePopupMenu());
table.setLayout(new GridBagLayout());
table.add(editor);
add(new JScrollPane(table));
setPreferredSize(new Dimension(320,240));
}
Program: 32535
Project: 32535
Buggy source:
private void updateAllChildrenUserObject(DefaultTreeModel model,DefaultMutableTreeNode root,boolean isSelected){
  java.util.Enumeration breadth=root.breadthFirstEnumeration();
  while (breadth.hasMoreElements()) {
    DefaultMutableTreeNode node=(DefaultMutableTreeNode)breadth.nextElement();
    if (root == node) {
      continue;
    }
    CheckBoxNode check=(CheckBoxNode)node.getUserObject();
    node.setUserObject(new CheckBoxNode(check.str,isSelected));
    model.nodeChanged(node);
  }
}

Fixed version (ground truth):
private void updateAllChildrenUserObject(DefaultMutableTreeNode root,Status status){
  java.util.Enumeration breadth=root.breadthFirstEnumeration();
  while (breadth.hasMoreElements()) {
    DefaultMutableTreeNode node=(DefaultMutableTreeNode)breadth.nextElement();
    if (root == node) {
      continue;
    }
    CheckBoxNode check=(CheckBoxNode)node.getUserObject();
    node.setUserObject(new CheckBoxNode(check.label,status));
  }
}
Program: 32536
Project: 32536
Buggy source:
@Override public Component getTreeCellRendererComponent(JTree tree,Object value,boolean selected,boolean expanded,boolean leaf,int row,boolean hasFocus){
  this.tree=tree;
  JLabel l=(JLabel)renderer.getTreeCellRendererComponent(tree,value,selected,expanded,leaf,row,hasFocus);
  l.setFont(tree.getFont());
  if (value != null && value instanceof DefaultMutableTreeNode) {
    this.setEnabled(tree.isEnabled());
    this.setFont(tree.getFont());
    Object userObject=((DefaultMutableTreeNode)value).getUserObject();
    if (userObject != null && userObject instanceof CheckBoxNode) {
      CheckBoxNode node=(CheckBoxNode)userObject;
      if (!node.selected && node.indeterminate) {
        setIcon(new IndeterminateIcon());
      }
 else {
        setIcon(null);
      }
      l.setText(node.str);
      setSelected(node.selected);
    }
    panel.add(l);
    return panel;
  }
  return l;
}

Fixed version (ground truth):
@Override public Component getTreeCellRendererComponent(JTree tree,Object value,boolean selected,boolean expanded,boolean leaf,int row,boolean hasFocus){
  this.tree=tree;
  JLabel l=(JLabel)renderer.getTreeCellRendererComponent(tree,value,selected,expanded,leaf,row,hasFocus);
  l.setFont(tree.getFont());
  if (value != null && value instanceof DefaultMutableTreeNode) {
    this.setEnabled(tree.isEnabled());
    this.setFont(tree.getFont());
    Object userObject=((DefaultMutableTreeNode)value).getUserObject();
    if (userObject != null && userObject instanceof CheckBoxNode) {
      CheckBoxNode node=(CheckBoxNode)userObject;
      if (node.status == Status.INDETERMINATE) {
        setIcon(new IndeterminateIcon());
      }
 else {
        setIcon(null);
      }
      l.setText(node.label);
      setSelected(node.status == Status.SELECTED);
    }
    panel.add(l);
    return panel;
  }
  return l;
}
Program: 32537
Project: 32537
Buggy source:
public CheckBoxNode(String str,boolean selected){
  this.str=str;
  this.selected=selected;
  this.indeterminate=false;
}

Fixed version (ground truth):
public CheckBoxNode(String label,Status status){
  this.label=label;
  this.status=status;
}
Program: 32538
Project: 32538
Buggy source:
@Override public Object getCellEditorValue(){
  return new CheckBoxNode(str,isSelected());
}

Fixed version (ground truth):
@Override public Object getCellEditorValue(){
  return new CheckBoxNode(str,isSelected() ? Status.SELECTED : Status.DESELECTED);
}
Program: 32539
Project: 32539
Buggy source:
@Override public void treeNodesChanged(TreeModelEvent e){
  if (adjusting)   return;
  adjusting=true;
  TreePath parent=e.getTreePath();
  Object[] children=e.getChildren();
  DefaultTreeModel model=(DefaultTreeModel)e.getSource();
  DefaultMutableTreeNode node;
  CheckBoxNode c;
  if (children != null && children.length == 1) {
    node=(DefaultMutableTreeNode)children[0];
    c=(CheckBoxNode)node.getUserObject();
    updateParentUserObject(model,(DefaultMutableTreeNode)parent.getLastPathComponent());
  }
 else {
    node=(DefaultMutableTreeNode)model.getRoot();
    c=(CheckBoxNode)node.getUserObject();
  }
  updateAllChildrenUserObject(model,node,c.selected);
  adjusting=false;
}

Fixed version (ground truth):
@Override public void treeNodesChanged(TreeModelEvent e){
  if (adjusting)   return;
  adjusting=true;
  TreePath parent=e.getTreePath();
  Object[] children=e.getChildren();
  DefaultTreeModel model=(DefaultTreeModel)e.getSource();
  DefaultMutableTreeNode node;
  CheckBoxNode c;
  if (children != null && children.length == 1) {
    node=(DefaultMutableTreeNode)children[0];
    c=(CheckBoxNode)node.getUserObject();
    DefaultMutableTreeNode n=(DefaultMutableTreeNode)parent.getLastPathComponent();
    while (n != null) {
      updateParentUserObject(n);
      DefaultMutableTreeNode tmp=(DefaultMutableTreeNode)n.getParent();
      if (tmp == null) {
        break;
      }
 else {
        n=tmp;
      }
    }
    model.nodeChanged(n);
  }
 else {
    node=(DefaultMutableTreeNode)model.getRoot();
    c=(CheckBoxNode)node.getUserObject();
  }
  updateAllChildrenUserObject(node,c.status);
  model.nodeChanged(node);
  adjusting=false;
}
Program: 32540
Project: 32540
Buggy source:
private void updateParentUserObject(DefaultTreeModel model,DefaultMutableTreeNode parent){
  CheckBoxNode check=(CheckBoxNode)parent.getUserObject();
  int selectedCount=0;
  java.util.Enumeration children=parent.children();
  while (children.hasMoreElements()) {
    DefaultMutableTreeNode node=(DefaultMutableTreeNode)children.nextElement();
    CheckBoxNode cbn=(CheckBoxNode)node.getUserObject();
    if (cbn.selected)     selectedCount++;
  }
  if (selectedCount == 0) {
    parent.setUserObject(new CheckBoxNode(check.str,false));
  }
 else   if (selectedCount == parent.getChildCount()) {
    parent.setUserObject(new CheckBoxNode(check.str,true));
  }
 else {
    parent.setUserObject(new CheckBoxNode(check.str));
  }
  model.nodeChanged(parent);
}

Fixed version (ground truth):
private void updateParentUserObject(DefaultMutableTreeNode parent){
  String label=((CheckBoxNode)parent.getUserObject()).label;
  int selectedCount=0;
  int indeterminateCount=0;
  java.util.Enumeration children=parent.children();
  while (children.hasMoreElements()) {
    DefaultMutableTreeNode node=(DefaultMutableTreeNode)children.nextElement();
    CheckBoxNode check=(CheckBoxNode)node.getUserObject();
    if (check.status == Status.INDETERMINATE) {
      indeterminateCount++;
      break;
    }
    if (check.status == Status.SELECTED)     selectedCount++;
  }
  if (indeterminateCount > 0) {
    parent.setUserObject(new CheckBoxNode(label));
  }
 else   if (selectedCount == 0) {
    parent.setUserObject(new CheckBoxNode(label,Status.DESELECTED));
  }
 else   if (selectedCount == parent.getChildCount()) {
    parent.setUserObject(new CheckBoxNode(label,Status.SELECTED));
  }
 else {
    parent.setUserObject(new CheckBoxNode(label));
  }
}
Program: 32541
Project: 32541
Buggy source:
@Override public Component getTreeCellEditorComponent(JTree tree,Object value,boolean isSelected,boolean expanded,boolean leaf,int row){
  JLabel l=(JLabel)renderer.getTreeCellRendererComponent(tree,value,true,expanded,leaf,row,true);
  l.setFont(tree.getFont());
  if (value != null && value instanceof DefaultMutableTreeNode) {
    this.setEnabled(tree.isEnabled());
    this.setFont(tree.getFont());
    Object userObject=((DefaultMutableTreeNode)value).getUserObject();
    if (userObject != null && userObject instanceof CheckBoxNode) {
      CheckBoxNode node=(CheckBoxNode)userObject;
      if (!node.selected && node.indeterminate) {
        setIcon(new IndeterminateIcon());
      }
 else {
        setIcon(null);
      }
      l.setText(node.str);
      setSelected(node.selected);
      str=node.str;
    }
    panel.add(l);
    return panel;
  }
  return l;
}

Fixed version (ground truth):
@Override public Component getTreeCellEditorComponent(JTree tree,Object value,boolean isSelected,boolean expanded,boolean leaf,int row){
  JLabel l=(JLabel)renderer.getTreeCellRendererComponent(tree,value,true,expanded,leaf,row,true);
  l.setFont(tree.getFont());
  if (value != null && value instanceof DefaultMutableTreeNode) {
    this.setEnabled(tree.isEnabled());
    this.setFont(tree.getFont());
    Object userObject=((DefaultMutableTreeNode)value).getUserObject();
    if (userObject != null && userObject instanceof CheckBoxNode) {
      CheckBoxNode node=(CheckBoxNode)userObject;
      if (node.status == Status.INDETERMINATE) {
        setIcon(new IndeterminateIcon());
      }
 else {
        setIcon(null);
      }
      l.setText(node.label);
      setSelected(node.status == Status.SELECTED);
      str=node.label;
    }
    panel.add(l);
    return panel;
  }
  return l;
}
Program: 32543
Project: 32543
Buggy source:
@Override public String toString(){
  return str;
}

Fixed version (ground truth):
@Override public String toString(){
  return label;
}
Program: 32544
Project: 32544
Buggy source:
public static void main(String args[]){
  System.out.println(reverseWordOrder("String_Node_Str"));
  if (isPalindrome("String_Node_Str")) {
    System.out.println("String_Node_Str");
  }
 else {
    System.out.println("String_Node_Str");
  }
  if (facebook2(new int[]{1,12,11,3,4})) {
    System.out.println("String_Node_Str");
  }
 else {
    System.out.println("String_Node_Str");
  }
}

Fixed version (ground truth):
public static void main(String args[]){
  System.out.println(reverseWordOrder("String_Node_Str"));
  if (isPalindrome("String_Node_Str")) {
    System.out.println("String_Node_Str");
  }
 else {
    System.out.println("String_Node_Str");
  }
  if (facebook2(new int[]{1,12,11,3,4})) {
    System.out.println("String_Node_Str");
  }
 else {
    System.out.println("String_Node_Str");
  }
  int a[][]=new int[][]{{1,2,3,4},{5,6,7,8},{9,10,0,11},{12,13,14,15}};
  replaceWith0(a);
}
Program: 32545
Project: 32545
Buggy source:
/** 
 * Creates, writes and closes a new object with a given content. This is equivalent to calling   {@link #createOrReplace(GcsFilename,GcsFileOptions)}and then   {@link GcsOutputChannel#write(ByteBuffer)} and {@link GcsOutputChannel#close()}but will try to minimize the underlying RPC calls.
 */
void createOrReplace(GcsFilename filename,GcsFileOptions options,ByteBuffer src) throws IOException ;

Fixed version (ground truth):
/** 
 * Creates, writes, and closes a new object with a given content. This is equivalent to calling   {@link #createOrReplace(GcsFilename,GcsFileOptions)}, then   {@link GcsOutputChannel#write(ByteBuffer)}, and finally   {@link GcsOutputChannel#close()}, but will try to minimize the underlying RPC calls.
 */
void createOrReplace(GcsFilename filename,GcsFileOptions options,ByteBuffer src) throws IOException ;
Program: 32546
Project: 32546
Buggy source:
/** 
 * Same as openReadChannel but buffers data in memory and prefetches it before it is required to attempt to avoid blocking on every read call. If some data is already available locally (prefetched), but not enough to fill the dst buffer, the returned channel might fill only part of it, to avoid blocking.
 */
GcsInputChannel openPrefetchingReadChannel(GcsFilename filename,long startPosition,int blockSizeBytes);

Fixed version (ground truth):
/** 
 * Same as   {@code openReadChannel}, but buffers data in memory and prefetches it before it is required to avoid blocking on most read calls. If some data is already available locally (prefetched), but not enough to fill the dst buffer, the returned channel might fill only part of it, to avoid blocking. If no data is available locally, reading from the returned channel will block.
 */
GcsInputChannel openPrefetchingReadChannel(GcsFilename filename,long startPosition,int blockSizeBytes);
Program: 32547
Project: 32547
Buggy source:
/** 
 * Returns true if deleted, false if not found.
 */
boolean delete(GcsFilename filename) throws IOException ;

Fixed version (ground truth):
/** 
 * Deletes a file.
 * @return true if deleted, false if not found.
 */
boolean delete(GcsFilename filename) throws IOException ;
Program: 32548
Project: 32548
Buggy source:
@Override public void doGet(HttpServletRequest req,HttpServletResponse resp) throws IOException {
  resp.setContentType("String_Node_Str");
  resp.getWriter().println("String_Node_Str");
  GcsService gcsService=GcsServiceFactory.createGcsService();
  GcsFilename filename=new GcsFilename(BUCKETNAME,FILENAME);
  GcsFileOptions options=new GcsFileOptions.Builder().mimeType("String_Node_Str").acl("String_Node_Str").addUserMetadata("String_Node_Str","String_Node_Str").build();
  GcsOutputChannel writeChannel=gcsService.createOrReplace(filename,options);
  PrintWriter out=new PrintWriter(Channels.newWriter(writeChannel,"String_Node_Str"));
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.flush();
  writeChannel.waitForOutstandingWrites();
  writeChannel.write(ByteBuffer.wrap("String_Node_Str".getBytes()));
  writeChannel.close();
  resp.getWriter().println("String_Node_Str");
  GcsInputChannel readChannel=gcsService.openReadChannel(filename,0);
  BufferedReader reader=new BufferedReader(Channels.newReader(readChannel,"String_Node_Str"));
  String line;
  while ((line=reader.readLine()) != null) {
    resp.getWriter().println("String_Node_Str" + line);
  }
  readChannel.close();
}

Fixed version (ground truth):
@Override public void doGet(HttpServletRequest req,HttpServletResponse resp) throws IOException {
  resp.setContentType("String_Node_Str");
  resp.getWriter().println("String_Node_Str");
  GcsService gcsService=GcsServiceFactory.createGcsService();
  GcsFilename filename=new GcsFilename(BUCKETNAME,FILENAME);
  GcsFileOptions options=new GcsFileOptions.Builder().mimeType("String_Node_Str").acl("String_Node_Str").addUserMetadata("String_Node_Str","String_Node_Str").build();
  GcsOutputChannel writeChannel=gcsService.createOrReplace(filename,options);
  PrintWriter writer=new PrintWriter(Channels.newWriter(writeChannel,"String_Node_Str"));
  writer.println("String_Node_Str");
  writer.println("String_Node_Str");
  writer.flush();
  writeChannel.waitForOutstandingWrites();
  writeChannel.write(ByteBuffer.wrap("String_Node_Str".getBytes("String_Node_Str")));
  writeChannel.close();
  resp.getWriter().println("String_Node_Str");
  GcsInputChannel readChannel=null;
  BufferedReader reader=null;
  try {
    readChannel=gcsService.openReadChannel(filename,0);
    reader=new BufferedReader(Channels.newReader(readChannel,"String_Node_Str"));
    String line;
    while ((line=reader.readLine()) != null) {
      resp.getWriter().println("String_Node_Str" + line);
    }
  }
  finally {
    if (reader != null) {
      reader.close();
    }
  }
}