nus-yam/ex-repair huggingface dataset:
Program: 7149
Project: 7149
Buggy source:
public void onClick(View button){
  if (!button.isEnabled())   return;
switch (button.getId()) {
case R.id.recordButton:
    mRemainingTimeCalculator.reset();
  if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
    mSampleInterrupted=true;
    mErrorUiMessage=getResources().getString(R.string.insert_sd_card);
    updateUi();
  }
 else   if (!mRemainingTimeCalculator.diskSpaceAvailable()) {
    mSampleInterrupted=true;
    mErrorUiMessage=getResources().getString(R.string.storage_is_full);
    updateUi();
  }
 else {
    stopAudioPlayback();
    if (AUDIO_AMR.equals(mRequestedType)) {
      mRemainingTimeCalculator.setBitRate(BITRATE_AMR);
      mRecorder.startRecording(MediaRecorder.OutputFormat.AMR_NB,"String_Node_Str");
    }
 else     if (AUDIO_3GPP.equals(mRequestedType)) {
      mRemainingTimeCalculator.setBitRate(BITRATE_3GPP);
      mRecorder.startRecording(MediaRecorder.OutputFormat.THREE_GPP,"String_Node_Str");
    }
 else {
      throw new IllegalArgumentException("String_Node_Str");
    }
    if (mMaxFileSize != -1) {
      mRemainingTimeCalculator.setFileSizeLimit(mRecorder.sampleFile(),mMaxFileSize);
    }
  }
break;
case R.id.playButton:
mRecorder.startPlayback();
break;
case R.id.stopButton:
mRecorder.stop();
break;
case R.id.acceptButton:
mRecorder.stop();
saveSample();
finish();
break;
case R.id.discardButton:
mRecorder.delete();
finish();
break;
}
}

Fixed version (ground truth):
public void onClick(View button){
  if (!button.isEnabled())   return;
switch (button.getId()) {
case R.id.recordButton:
    mRemainingTimeCalculator.reset();
  if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
    mSampleInterrupted=true;
    mErrorUiMessage=getResources().getString(R.string.insert_sd_card);
    updateUi();
  }
 else   if (!mRemainingTimeCalculator.diskSpaceAvailable()) {
    mSampleInterrupted=true;
    mErrorUiMessage=getResources().getString(R.string.storage_is_full);
    updateUi();
  }
 else {
    stopAudioPlayback();
    if (AUDIO_AMR.equals(mRequestedType)) {
      mRemainingTimeCalculator.setBitRate(BITRATE_AMR);
      mRecorder.startRecording(MediaRecorder.OutputFormat.AMR_NB,"String_Node_Str",this);
    }
 else     if (AUDIO_3GPP.equals(mRequestedType)) {
      mRemainingTimeCalculator.setBitRate(BITRATE_3GPP);
      mRecorder.startRecording(MediaRecorder.OutputFormat.THREE_GPP,"String_Node_Str",this);
    }
 else {
      throw new IllegalArgumentException("String_Node_Str");
    }
    if (mMaxFileSize != -1) {
      mRemainingTimeCalculator.setFileSizeLimit(mRecorder.sampleFile(),mMaxFileSize);
    }
  }
break;
case R.id.playButton:
mRecorder.startPlayback();
break;
case R.id.stopButton:
mRecorder.stop();
break;
case R.id.acceptButton:
mRecorder.stop();
saveSample();
finish();
break;
case R.id.discardButton:
mRecorder.delete();
finish();
break;
}
}
Program: 7150
Project: 7150
Buggy source:
public void onError(int error){
  Resources res=getResources();
  String message=null;
switch (error) {
case Recorder.SDCARD_ACCESS_ERROR:
    message=res.getString(R.string.error_sdcard_access);
  break;
case Recorder.INTERNAL_ERROR:
message=res.getString(R.string.error_app_internal);
break;
}
if (message != null) {
new AlertDialog.Builder(this).setTitle(R.string.app_name).setMessage(message).setPositiveButton(R.string.button_ok,null).setCancelable(false).show();
}
}

Fixed version (ground truth):
public void onError(int error){
  Resources res=getResources();
  String message=null;
switch (error) {
case Recorder.SDCARD_ACCESS_ERROR:
    message=res.getString(R.string.error_sdcard_access);
  break;
case Recorder.IN_CALL_RECORD_ERROR:
case Recorder.INTERNAL_ERROR:
message=res.getString(R.string.error_app_internal);
break;
}
if (message != null) {
new AlertDialog.Builder(this).setTitle(R.string.app_name).setMessage(message).setPositiveButton(R.string.button_ok,null).setCancelable(false).show();
}
}
Program: 7151
Project: 7151
Buggy source:
public void startRecording(int outputfileformat,String extension){
  stop();
  if (mSampleFile == null) {
    File sampleDir=Environment.getExternalStorageDirectory();
    if (!sampleDir.canWrite())     sampleDir=new File("String_Node_Str");
    try {
      mSampleFile=File.createTempFile(SAMPLE_PREFIX,extension,sampleDir);
    }
 catch (    IOException e) {
      setError(SDCARD_ACCESS_ERROR);
      return;
    }
  }
  mRecorder=new MediaRecorder();
  mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
  mRecorder.setOutputFormat(outputfileformat);
  mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
  mRecorder.setOutputFile(mSampleFile.getAbsolutePath());
  try {
    mRecorder.prepare();
  }
 catch (  IOException exception) {
    setError(INTERNAL_ERROR);
    mRecorder.reset();
    mRecorder.release();
    mRecorder=null;
    return;
  }
  mRecorder.start();
  mSampleStart=System.currentTimeMillis();
  setState(RECORDING_STATE);
}

Fixed version (ground truth):
public void startRecording(int outputfileformat,String extension,Context context){
  stop();
  if (mSampleFile == null) {
    File sampleDir=Environment.getExternalStorageDirectory();
    if (!sampleDir.canWrite())     sampleDir=new File("String_Node_Str");
    try {
      mSampleFile=File.createTempFile(SAMPLE_PREFIX,extension,sampleDir);
    }
 catch (    IOException e) {
      setError(SDCARD_ACCESS_ERROR);
      return;
    }
  }
  mRecorder=new MediaRecorder();
  mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
  mRecorder.setOutputFormat(outputfileformat);
  mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
  mRecorder.setOutputFile(mSampleFile.getAbsolutePath());
  try {
    mRecorder.prepare();
  }
 catch (  IOException exception) {
    setError(INTERNAL_ERROR);
    mRecorder.reset();
    mRecorder.release();
    mRecorder=null;
    return;
  }
  try {
    mRecorder.start();
  }
 catch (  RuntimeException exception) {
    AudioManager audioMngr=(AudioManager)context.getSystemService(Context.AUDIO_SERVICE);
    boolean isInCall=audioMngr.getMode() == AudioManager.MODE_IN_CALL;
    if (isInCall) {
      setError(IN_CALL_RECORD_ERROR);
    }
 else {
      setError(INTERNAL_ERROR);
    }
    mRecorder.reset();
    mRecorder.release();
    mRecorder=null;
    return;
  }
  mSampleStart=System.currentTimeMillis();
  setState(RECORDING_STATE);
}
Program: 7152
Project: 7152
Buggy source:
public void onClick(View button){
  if (!button.isEnabled())   return;
switch (button.getId()) {
case R.id.recordButton:
    mRemainingTimeCalculator.reset();
  if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
    mSampleInterrupted=true;
    mErrorUiMessage=getResources().getString(R.string.insert_sd_card);
    updateUi();
  }
 else   if (!mRemainingTimeCalculator.diskSpaceAvailable()) {
    mSampleInterrupted=true;
    mErrorUiMessage=getResources().getString(R.string.storage_is_full);
    updateUi();
  }
 else {
    stopAudioPlayback();
    if (AUDIO_AMR.equals(mRequestedType)) {
      mRemainingTimeCalculator.setBitRate(BITRATE_AMR);
      mRecorder.startRecording(MediaRecorder.OutputFormat.AMR_NB,"String_Node_Str");
    }
 else     if (AUDIO_3GPP.equals(mRequestedType)) {
      mRemainingTimeCalculator.setBitRate(BITRATE_3GPP);
      mRecorder.startRecording(MediaRecorder.OutputFormat.THREE_GPP,"String_Node_Str");
    }
 else {
      throw new IllegalArgumentException("String_Node_Str");
    }
    if (mMaxFileSize != -1) {
      mRemainingTimeCalculator.setFileSizeLimit(mRecorder.sampleFile(),mMaxFileSize);
    }
  }
break;
case R.id.playButton:
mRecorder.startPlayback();
break;
case R.id.stopButton:
mRecorder.stop();
break;
case R.id.acceptButton:
mRecorder.stop();
saveSample();
finish();
break;
case R.id.discardButton:
mRecorder.delete();
finish();
break;
}
}

Fixed version (ground truth):
public void onClick(View button){
  if (!button.isEnabled())   return;
switch (button.getId()) {
case R.id.recordButton:
    mRemainingTimeCalculator.reset();
  if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
    mSampleInterrupted=true;
    mErrorUiMessage=getResources().getString(R.string.insert_sd_card);
    updateUi();
  }
 else   if (!mRemainingTimeCalculator.diskSpaceAvailable()) {
    mSampleInterrupted=true;
    mErrorUiMessage=getResources().getString(R.string.storage_is_full);
    updateUi();
  }
 else {
    stopAudioPlayback();
    if (AUDIO_AMR.equals(mRequestedType)) {
      mRemainingTimeCalculator.setBitRate(BITRATE_AMR);
      mRecorder.startRecording(MediaRecorder.OutputFormat.AMR_NB,"String_Node_Str",this);
    }
 else     if (AUDIO_3GPP.equals(mRequestedType)) {
      mRemainingTimeCalculator.setBitRate(BITRATE_3GPP);
      mRecorder.startRecording(MediaRecorder.OutputFormat.THREE_GPP,"String_Node_Str",this);
    }
 else {
      throw new IllegalArgumentException("String_Node_Str");
    }
    if (mMaxFileSize != -1) {
      mRemainingTimeCalculator.setFileSizeLimit(mRecorder.sampleFile(),mMaxFileSize);
    }
  }
break;
case R.id.playButton:
mRecorder.startPlayback();
break;
case R.id.stopButton:
mRecorder.stop();
break;
case R.id.acceptButton:
mRecorder.stop();
saveSample();
finish();
break;
case R.id.discardButton:
mRecorder.delete();
finish();
break;
}
}
Program: 7153
Project: 7153
Buggy source:
public void onError(int error){
  Resources res=getResources();
  String message=null;
switch (error) {
case Recorder.SDCARD_ACCESS_ERROR:
    message=res.getString(R.string.error_sdcard_access);
  break;
case Recorder.INTERNAL_ERROR:
message=res.getString(R.string.error_app_internal);
break;
}
if (message != null) {
new AlertDialog.Builder(this).setTitle(R.string.app_name).setMessage(message).setPositiveButton(R.string.button_ok,null).setCancelable(false).show();
}
}

Fixed version (ground truth):
public void onError(int error){
  Resources res=getResources();
  String message=null;
switch (error) {
case Recorder.SDCARD_ACCESS_ERROR:
    message=res.getString(R.string.error_sdcard_access);
  break;
case Recorder.IN_CALL_RECORD_ERROR:
case Recorder.INTERNAL_ERROR:
message=res.getString(R.string.error_app_internal);
break;
}
if (message != null) {
new AlertDialog.Builder(this).setTitle(R.string.app_name).setMessage(message).setPositiveButton(R.string.button_ok,null).setCancelable(false).show();
}
}
Program: 7154
Project: 7154
Buggy source:
public PagingCellTablePanel(CellTable<T> table,AbstractPager pager){
  this.table=table;
  this.pager=pager;
  Binder binder=GWT.create(Binder.class);
  initWidget(binder.createAndBindUi(this));
  body.setWidget(table);
  footer.setWidget(pager);
  pager.setDisplay(table);
  noDataAvailable=new Label(UIConstants.INSTANCE.noDataAvailable());
  noDataAvailable.addStyleName(UIClientBundle.INSTANCE.getUICssResource().noData());
  table.setEmptyTableWidget(noDataAvailable);
}

Fixed version (ground truth):
public PagingCellTablePanel(CellTable<T> table,AbstractPager pager){
  UIClientBundle.INSTANCE.getUICssResource().ensureInjected();
  this.table=table;
  this.pager=pager;
  Binder binder=GWT.create(Binder.class);
  initWidget(binder.createAndBindUi(this));
  body.setWidget(table);
  footer.setWidget(pager);
  pager.setDisplay(table);
  noDataAvailable=new Label(UIConstants.INSTANCE.noDataAvailable());
  noDataAvailable.addStyleName(UIClientBundle.INSTANCE.getUICssResource().noData());
  table.setEmptyTableWidget(noDataAvailable);
}
Program: 7155
Project: 7155
Buggy source:
@Override protected void dispatch(Handler<T> handler){
  handler.onRemoteChange(this);
}

Fixed version (ground truth):
@Override protected void dispatch(Handler<T> handler){
  if (handler == null) {
    return;
  }
  handler.onRemoteChange(this);
}
Program: 7156
Project: 7156
Buggy source:
public void show(final String message){
  super.show(message);
  this.currentMessage=message;
  Scheduler.get().scheduleFixedDelay(new RepeatingCommand(){
    @Override public boolean execute(){
      if (message.equals(currentMessage)) {
        Window.alert("String_Node_Str");
        hideNow();
      }
      return false;
    }
  }
,HIDE_DELAY);
}

Fixed version (ground truth):
public void show(final String message){
  super.show(message);
  this.currentMessage=message;
  Scheduler.get().scheduleFixedDelay(new RepeatingCommand(){
    @Override public boolean execute(){
      if (message.equals(currentMessage)) {
        hideNow();
      }
      return false;
    }
  }
,HIDE_DELAY);
}
Program: 7157
Project: 7157
Buggy source:
@Override public boolean execute(){
  if (message.equals(currentMessage)) {
    Window.alert("String_Node_Str");
    hideNow();
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean execute(){
  if (message.equals(currentMessage)) {
    hideNow();
  }
  return false;
}
Program: 7158
Project: 7158
Buggy source:
/** 
 * Default constructor.
 */
public Notifier(){
  css.ensureInjected();
  addStyleName(css.notifications());
  setAnimationDuration(500);
}

Fixed version (ground truth):
/** 
 * Default constructor.
 */
public Notifier(){
  css.ensureInjected();
  addStyleName(css.notifications());
}
Program: 7159
Project: 7159
Buggy source:
@Override public void onProxyChange(EntityProxyChange<T> event){
  if (event.getWriteOperation() == WriteOperation.PERSIST) {
    logger.fine("String_Node_Str" + event.getWriteOperation().toString() + "String_Node_Str"+ entityClass.getName()+ "String_Node_Str");
    reload();
  }
}

Fixed version (ground truth):
@Override public void onProxyChange(EntityProxyChange<T> event){
  if (event.getWriteOperation() == WriteOperation.PERSIST || event.getWriteOperation() == WriteOperation.UPDATE) {
    logger.fine("String_Node_Str" + event.getWriteOperation().toString() + "String_Node_Str"+ entityClass.getName()+ "String_Node_Str");
    reload();
  }
}
Program: 7160
Project: 7160
Buggy source:
public void initialize(final CellTable<T> table,RequestFactory requestFactory,EventBus eventBus){
  this.table=table;
  requestFactory.initialize(eventBus);
  Binder binder=GWT.create(Binder.class);
  initWidget(binder.createAndBindUi(this));
  body.setWidget(table);
  footer.setWidget(pager);
  toolbar.setVisible(false);
  initializePagination(pager);
  initializeSorting();
  EntityProxyChange.registerForProxyType(eventBus,entityClass,new EntityProxyChange.Handler<T>(){
    @Override public void onProxyChange(    EntityProxyChange<T> event){
      if (event.getWriteOperation() == WriteOperation.PERSIST) {
        logger.fine("String_Node_Str" + event.getWriteOperation().toString() + "String_Node_Str"+ entityClass.getName()+ "String_Node_Str");
        reload();
      }
    }
  }
);
  noDataAvailable=new Label(UIConstants.INSTANCE.noDataAvailable());
  noDataAvailable.addStyleName(UIClientBundle.INSTANCE.getUICssResource().noData());
}

Fixed version (ground truth):
public void initialize(final CellTable<T> table,RequestFactory requestFactory,EventBus eventBus){
  this.table=table;
  requestFactory.initialize(eventBus);
  Binder binder=GWT.create(Binder.class);
  initWidget(binder.createAndBindUi(this));
  body.setWidget(table);
  footer.setWidget(pager);
  toolbar.setVisible(false);
  initializePagination(pager);
  initializeSorting();
  EntityProxyChange.registerForProxyType(eventBus,entityClass,new EntityProxyChange.Handler<T>(){
    @Override public void onProxyChange(    EntityProxyChange<T> event){
      if (event.getWriteOperation() == WriteOperation.PERSIST || event.getWriteOperation() == WriteOperation.UPDATE) {
        logger.fine("String_Node_Str" + event.getWriteOperation().toString() + "String_Node_Str"+ entityClass.getName()+ "String_Node_Str");
        reload();
      }
    }
  }
);
  noDataAvailable=new Label(UIConstants.INSTANCE.noDataAvailable());
  noDataAvailable.addStyleName(UIClientBundle.INSTANCE.getUICssResource().noData());
}
Program: 7161
Project: 7161
Buggy source:
@Override public Date getValue(){
  String value=textbox.getValue();
  if (value == null || value.isEmpty()) {
    return null;
  }
  try {
    Date d=format.parse(value);
    LOG.finer("String_Node_Str" + value);
    return d;
  }
 catch (  Exception e) {
    LOG.warning("String_Node_Str" + value);
    return null;
  }
}

Fixed version (ground truth):
@Override public Date getValue(){
  String value=textbox.getValue();
  if (value == null || value.isEmpty()) {
    return null;
  }
  try {
    Date d=format.parse(value);
    return d;
  }
 catch (  Exception e) {
    LOG.warning("String_Node_Str" + value);
    return null;
  }
}
Program: 7162
Project: 7162
Buggy source:
/** 
 * Get a Date in the browser local time.
 * @return The browser local time specified by user.
 */
@Override public Date getValue(){
  Date day=date.getValue();
  if (day == null) {
    return null;
  }
  Date time=this.time.getValue();
  if (time == null) {
    return day;
  }
  LOG.finer("String_Node_Str" + time.getTime());
  long timeMillis=time.getTime() % (24 * 60 * 60* 1000);
  int offsetMillis=new Date().getTimezoneOffset() * 60 * 1000;
  if (timeMillis < offsetMillis) {
    timeMillis+=24 * 60 * 60* 1000 - offsetMillis;
  }
  LOG.finer("String_Node_Str" + timeMillis);
  Date d=new Date(day.getTime() + timeMillis);
  return d;
}

Fixed version (ground truth):
/** 
 * Get a Date in the browser local time.
 * @return The browser local time specified by user.
 */
@Override public Date getValue(){
  Date day=date.getValue();
  if (day == null) {
    return null;
  }
  Date time=this.time.getValue();
  if (time == null) {
    return day;
  }
  LOG.finer("String_Node_Str" + time.getTime());
  long timeMillis=time.getTime() % (24 * 60 * 60* 1000);
  int offsetMillis=new Date().getTimezoneOffset() * 60 * 1000;
  int dayMillis=24 * 60 * 60* 1000;
  if (timeMillis < offsetMillis) {
    timeMillis+=dayMillis;
  }
 else   if (timeMillis + offsetMillis > dayMillis) {
    timeMillis-=dayMillis;
  }
  timeMillis-=offsetMillis;
  LOG.finer("String_Node_Str" + timeMillis);
  Date d=new Date(day.getTime() + timeMillis);
  return d;
}
Program: 7163
Project: 7163
Buggy source:
@Override public Date getValue(){
  Date day=date.getValue();
  Date time=this.time.getValue();
  if (time == null) {
    return day;
  }
  long timeMillis=time.getTime() % (24 * 60 * 60* 1000);
  Date d=new Date(day.getTime() + timeMillis);
  return d;
}

Fixed version (ground truth):
/** 
 * Get a Date in the browser local time.
 * @return The browser local time specified by user.
 */
@Override public Date getValue(){
  Date day=date.getValue();
  if (day == null) {
    return null;
  }
  Date time=this.time.getValue();
  if (time == null) {
    return day;
  }
  LOG.finer("String_Node_Str" + time.getTime());
  long timeMillis=time.getTime() % (24 * 60 * 60* 1000);
  int offsetMillis=new Date().getTimezoneOffset() * 60 * 1000;
  if (timeMillis < offsetMillis) {
    timeMillis+=24 * 60 * 60* 1000 - offsetMillis;
  }
  LOG.finer("String_Node_Str" + timeMillis);
  Date d=new Date(day.getTime() + timeMillis);
  return d;
}
Program: 7164
Project: 7164
Buggy source:
@Override public void onModuleLoad(){
  demoEditorPanel();
}

Fixed version (ground truth):
@Override public void onModuleLoad(){
  demoCellTableDialog();
  demoEditorPanel();
}
Program: 7165
Project: 7165
Buggy source:
public AbstractCellTable<T> getTable(){
  return table;
}

Fixed version (ground truth):
public HasSorting<T> getTable(){
  return table;
}
Program: 7166
Project: 7166
Buggy source:
public PagingCellTablePanel(AbstractCellTable<T> table,AbstractPager pager){
  UIClientBundle.INSTANCE.getUICssResource().ensureInjected();
  this.table=table;
  this.pager=pager;
  Binder binder=GWT.create(Binder.class);
  initWidget(binder.createAndBindUi(this));
  body.setWidget(table);
  footer.setWidget(pager);
  pager.setDisplay(table);
  noDataAvailable=new Label(UIConstants.INSTANCE.noDataAvailable());
  noDataAvailable.addStyleName(UIClientBundle.INSTANCE.getUICssResource().noData());
  table.setEmptyTableWidget(noDataAvailable);
}

Fixed version (ground truth):
public PagingCellTablePanel(CellTable<T> table,AbstractPager pager){
  UIClientBundle.INSTANCE.getUICssResource().ensureInjected();
  this.table=table;
  this.pager=pager;
  Binder binder=GWT.create(Binder.class);
  initWidget(binder.createAndBindUi(this));
  body.setWidget(table);
  footer.setWidget(pager);
  pager.setDisplay(table);
  noDataAvailable=new Label(UIConstants.INSTANCE.noDataAvailable());
  noDataAvailable.addStyleName(UIClientBundle.INSTANCE.getUICssResource().noData());
  table.setEmptyTableWidget(noDataAvailable);
}
Program: 7167
Project: 7167
Buggy source:
@Override public Set<T> getValue(){
  Set<T> results=new HashSet<T>();
  for (int i=0; i < getItemCount(); i++) {
    if (isItemSelected(i)) {
      results.add(values.get(getValue(i)));
    }
  }
  lazySelectValues=null;
  LOG.fine("String_Node_Str" + results.toString());
  return results;
}

Fixed version (ground truth):
@Override public Set<T> getValue(){
  Set<T> results=new HashSet<T>();
  for (int i=0; i < getItemCount(); i++) {
    if (isItemSelected(i)) {
      results.add(values.get(getValue(i)));
    }
  }
  if (getItemCount() == 0 && lazySelectValues != null) {
    return lazySelectValues;
  }
  lazySelectValues=null;
  return results;
}
Program: 7168
Project: 7168
Buggy source:
/** 
 * Convert this value to a simple String. Should be unique per item given.
 * @param item
 * @return
 */
protected String valueOf(T item){
  if (item == null) {
    return "String_Node_Str";
  }
  return "String_Node_Str" + item.hashCode();
}

Fixed version (ground truth):
/** 
 * Convert this value to a simple String. Should be unique per item given.
 * @param item
 * @return
 */
protected String valueOf(T item){
  if (item == null) {
    return "String_Node_Str";
  }
  return item.toString();
}
Program: 7169
Project: 7169
Buggy source:
/** 
 * The default implementation will display, but not consume, received errors whose   {@link EditorError#getEditor() getEditor()} method returns theEditor passed into  {@link #setEditor}.
 * @param errors a List of  {@link EditorError} instances
 */
public void showErrors(List<EditorError> errors){
  StringBuilder sb=new StringBuilder();
  for (  EditorError error : errors) {
    if (error.getEditor().equals(editor)) {
      sb.append("String_Node_Str").append(error.getMessage());
    }
  }
  if (sb.length() == 0) {
    errorLabel.setInnerText("String_Node_Str");
    errorLabel.getStyle().setDisplay(Display.NONE);
    return;
  }
  errorLabel.setInnerText(sb.substring(1));
  errorLabel.getStyle().setDisplay(Display.INLINE_BLOCK);
}

Fixed version (ground truth):
/** 
 * The default implementation will display, but not consume, received errors whose   {@link EditorError#getEditor() getEditor()} method returns theEditor passed into  {@link #setEditor}.
 * @param errors a List of  {@link EditorError} instances
 */
public void showErrors(List<EditorError> errors){
  StringBuilder sb=new StringBuilder();
  for (  EditorError error : errors) {
    if (error.getEditor().equals(editor)) {
      sb.append("String_Node_Str").append(error.getMessage());
    }
  }
  if (sb.length() == 0) {
    errorLabel.setInnerText("String_Node_Str");
    errorLabel.getStyle().setDisplay(Display.NONE);
    return;
  }
  errorLabel.setInnerText(sb.substring(1));
  errorLabel.getStyle().setDisplay(Display.INLINE_BLOCK);
  addStyleName("String_Node_Str");
}
Program: 7170
Project: 7170
Buggy source:
public MigrationDifference(Release release,Integer currentMigration,Integer targetMigration){
  this.release=release;
  this.currentMigration=currentMigration == null ? 0 : currentMigration;
  this.targetMigration=targetMigration == null ? release.getMaxScriptNumber() : targetMigration;
}

Fixed version (ground truth):
public MigrationDifference(Release release,Integer currentMigration,Integer targetMigration){
  this.release=release;
  this.currentMigration=currentMigration == null ? 0 : currentMigration;
  this.targetMigration=targetMigration == null ? release.getMaxScriptNumber() : targetMigration;
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + release.getNumber() + "String_Node_Str"+ currentMigration+ "String_Node_Str"+ targetMigration);
  }
}
Program: 7171
Project: 7171
Buggy source:
private MigrationDifference createDifference(int current,int target,int... scriptNumbers){
  Release release=new Mock.Release(1,scriptNumbers);
  return new MigrationDifference(release,current,target);
}

Fixed version (ground truth):
private MigrationDifference createDifference(Integer current,Integer target,int... scriptNumbers){
  Release release=new Mock.Release(1,scriptNumbers);
  return new MigrationDifference(release,current,target);
}
Program: 7172
Project: 7172
Buggy source:
private Table massageTableForOracle(Table table){
  if (hasAutomaticPrimaryKey(table)) {
    table.getPrimaryKeyColumns()[0].setAutoIncrement(false);
  }
  return table;
}

Fixed version (ground truth):
private static Table massageTableForOracle(Table table){
  Table massaged=cloneTable(table);
  if (hasAutomaticPrimaryKey(massaged)) {
    massaged.getPrimaryKeyColumns()[0].setAutoIncrement(false);
  }
  return table;
}
Program: 7173
Project: 7173
Buggy source:
private boolean hasAutomaticPrimaryKey(Table table){
  if (table.getPrimaryKeyColumns().length == 1) {
    Column pk=table.getPrimaryKeyColumns()[0];
    return pk.isAutoIncrement();
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
private static boolean hasAutomaticPrimaryKey(Table table){
  if (table.getPrimaryKeyColumns().length == 1) {
    Column pk=table.getPrimaryKeyColumns()[0];
    return pk.isAutoIncrement();
  }
 else {
    return false;
  }
}
Program: 7174
Project: 7174
Buggy source:
private static Table massageTableForOracle(Table table){
  Table massaged=cloneTable(table);
  if (hasAutomaticPrimaryKey(massaged)) {
    massaged.getPrimaryKeyColumns()[0].setAutoIncrement(false);
  }
  return table;
}

Fixed version (ground truth):
static Table massageTableForOracle(Table table){
  Table massaged=cloneTable(table);
  if (hasAutomaticPrimaryKey(massaged)) {
    massaged.getPrimaryKeyColumns()[0].setAutoIncrement(false);
  }
  return massaged;
}
Program: 7175
Project: 7175
Buggy source:
private static Table cloneTable(Table table){
  Table massaged;
  try {
    massaged=(Table)table.clone();
    while (massaged.getColumnCount() > 0) {
      massaged.removeColumn(0);
    }
    for (    Column column : table.getColumns()) {
      massaged.addColumn((Column)column.clone());
    }
  }
 catch (  CloneNotSupportedException e) {
    throw new Error("String_Node_Str",e);
  }
  return massaged;
}

Fixed version (ground truth):
private static Table cloneTable(Table table){
  Table clone;
  try {
    clone=(Table)table.clone();
    while (clone.getColumnCount() > 0) {
      clone.removeColumn(0);
    }
    for (    Column column : table.getColumns()) {
      clone.addColumn((Column)column.clone());
    }
  }
 catch (  CloneNotSupportedException e) {
    throw new Error("String_Node_Str",e);
  }
  return clone;
}
Program: 7176
Project: 7176
Buggy source:
public void draw(Graphics g){
  ((Graphics2D)g).setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
  for (int i=0; i < MAX_FINGER_BLOBS; i++) {
    Finger f=blobs[i];
    if (f != null)     bloblist.add(f);
    for (    Finger blob : bloblist) {
      if (blob != null && blob.getState() == FingerState.PRESSED) {
        int x=(int)(width * (blob.getX()));
        int y=(int)(height * (1 - blob.getY()));
        int xsize=(int)(10 * blob.getSize() * (blob.getMajorAxis() / 2));
        int ysize=(int)(10 * blob.getSize() * (blob.getMinorAxis() / 2));
        int ang=blob.getAngle();
        Color pitchcolor=new Color((int)Math.floor((x / 800.0) * 255),255 - (int)Math.floor((y / 600.0) * 255),0);
        g.setColor(pitchcolor);
        Ellipse2D ellipse=new Ellipse2D.Float(0,0,xsize,ysize);
        AffineTransform at=AffineTransform.getTranslateInstance(0,0);
        at.translate(x - xsize / 2,y - ysize / 2);
        at.rotate((Math.PI / 180) * -ang,xsize / 2,ysize / 2);
        ((Graphics2D)g).fill(at.createTransformedShape(ellipse));
        g.setColor(Color.DARK_GRAY);
      }
    }
    if (bloblist.size() > 10)     bloblist.remove(0);
  }
}

Fixed version (ground truth):
public void draw(Graphics g){
  ((Graphics2D)g).setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
  for (int i=0; i < MAX_FINGER_BLOBS; i++) {
    Finger f=blobs[i];
    if (f != null)     bloblist.add(f);
    for (    Finger blob : bloblist) {
      if (blob != null && blob.getState() == FingerState.PRESSED) {
        int x=(int)(width * (blob.getX()));
        int y=(int)(height * (1 - blob.getY()));
        int xsize=(int)(10 * blob.getSize() * (blob.getMajorAxis() / 2));
        int ysize=(int)(10 * blob.getSize() * (blob.getMinorAxis() / 2));
        int ang=blob.getAngle();
        if (x > 0 && y > 0) {
          Color pitchcolor=new Color((int)Math.floor((x / 800.0) * 255),255 - (int)Math.floor((y / 600.0) * 255),0);
          g.setColor(pitchcolor);
          Ellipse2D ellipse=new Ellipse2D.Float(0,0,xsize,ysize);
          AffineTransform at=AffineTransform.getTranslateInstance(0,0);
          at.translate(x - xsize / 2,y - ysize / 2);
          at.rotate((Math.PI / 180) * -ang,xsize / 2,ysize / 2);
          ((Graphics2D)g).fill(at.createTransformedShape(ellipse));
          g.setColor(Color.DARK_GRAY);
        }
      }
    }
    if (bloblist.size() > 10)     bloblist.remove(0);
  }
}
Program: 7177
Project: 7177
Buggy source:
public void changeInstrument(int id){
  if (init)   filter.input.disconnect();
  CURRENT_INSTRUMENT.stop();
switch (id) {
case KaossTest.INSTRUMENT_SINE:
    CURRENT_INSTRUMENT=SINE;
  break;
case KaossTest.INSTRUMENT_TRIANGLE:
CURRENT_INSTRUMENT=TRIANGLE;
CURRENT_INSTRUMENT.resetEnvelope();
break;
case KaossTest.INSTRUMENT_SQUARE:
CURRENT_INSTRUMENT=SQUARE;
break;
case KaossTest.INSTRUMENT_REDNOISE:
CURRENT_INSTRUMENT=REDNOISE;
break;
case KaossTest.INSTRUMENT_SAWTOOTH:
CURRENT_INSTRUMENT=SAWTOOTH;
break;
case KaossTest.INSTRUMENT_SINGINGSAW:
CURRENT_INSTRUMENT=SINGINGSAW;
break;
case KaossTest.INSTRUMENT_CUOMO:
CURRENT_INSTRUMENT=CUOMO;
break;
case KaossTest.INSTRUMENT_GONG:
CURRENT_INSTRUMENT=GONG;
break;
case KaossTest.INSTRUMENT_MESSIER:
CURRENT_INSTRUMENT=MESSIER;
break;
case KaossTest.INSTRUMENT_SQUOISE:
CURRENT_INSTRUMENT=SQUOISE;
break;
}
SynthMixer instrumentMix=CURRENT_INSTRUMENT.getMixer();
instrumentMix.start();
updateLFO();
if (init) instrumentMix.connectOutput(0,filter.input,0);
}

Fixed version (ground truth):
public void changeInstrument(int id){
  if (init)   inputAdder.inputA.disconnect();
  CURRENT_INSTRUMENT.stop();
switch (id) {
case KaossTest.INSTRUMENT_SINE:
    CURRENT_INSTRUMENT=SINE;
  break;
case KaossTest.INSTRUMENT_TRIANGLE:
CURRENT_INSTRUMENT=TRIANGLE;
CURRENT_INSTRUMENT.resetEnvelope();
break;
case KaossTest.INSTRUMENT_SQUARE:
CURRENT_INSTRUMENT=SQUARE;
break;
case KaossTest.INSTRUMENT_REDNOISE:
CURRENT_INSTRUMENT=REDNOISE;
break;
case KaossTest.INSTRUMENT_SAWTOOTH:
CURRENT_INSTRUMENT=SAWTOOTH;
break;
case KaossTest.INSTRUMENT_SINGINGSAW:
CURRENT_INSTRUMENT=SINGINGSAW;
break;
case KaossTest.INSTRUMENT_CUOMO:
CURRENT_INSTRUMENT=CUOMO;
break;
case KaossTest.INSTRUMENT_GONG:
CURRENT_INSTRUMENT=GONG;
break;
case KaossTest.INSTRUMENT_MESSIER:
CURRENT_INSTRUMENT=MESSIER;
break;
case KaossTest.INSTRUMENT_SQUOISE:
CURRENT_INSTRUMENT=SQUOISE;
break;
}
SynthMixer instrumentMix=CURRENT_INSTRUMENT.getMixer();
instrumentMix.start();
updateLFO();
if (init) instrumentMix.connectOutput(0,inputAdder.inputA,0);
}
Program: 7178
Project: 7178
Buggy source:
public void updatePan(double pan){
  controller.pan(pan);
  display.updatePanKnob(pan);
}

Fixed version (ground truth):
public void updatePan(double pan){
  controller.pan(pan);
  if (display != null)   display.updatePanKnob(pan);
}
Program: 7179
Project: 7179
Buggy source:
public void updateModDepth(int depth){
  controller.updateModDepth(depth);
  display.updateDepthKnob(depth);
}

Fixed version (ground truth):
public void updateModDepth(int depth){
  controller.updateModDepth(depth);
  if (display != null)   display.updateDepthKnob(depth);
}
Program: 7180
Project: 7180
Buggy source:
public void updateModRate(int rate){
  controller.updateModRate(rate);
  display.updateRateKnob(rate);
}

Fixed version (ground truth):
public void updateModRate(int rate){
  controller.updateModRate(rate);
  if (display != null)   display.updateRateKnob(rate);
}
Program: 7181
Project: 7181
Buggy source:
public void updateFrequency(int y){
  controller.changeFrequency(y);
  display.updatePitchKnob(y);
}

Fixed version (ground truth):
public void updateFrequency(int y){
  controller.changeFrequency(y);
  if (display != null)   display.updatePitchKnob(y);
}
Program: 7182
Project: 7182
Buggy source:
public void updateLowpass(int lowpass){
  controller.lowpass(lowpass);
  display.updateLoKnob(lowpass);
}

Fixed version (ground truth):
public void updateLowpass(int lowpass){
  controller.lowpass(lowpass);
  if (display != null)   display.updateLoKnob(lowpass);
}
Program: 7183
Project: 7183
Buggy source:
public void run(){
  while (true) {
    surfaceUpdate();
    repaint();
    try {
      Thread.sleep(UPDATE_PERIOD);
    }
 catch (    InterruptedException ex) {
    }
  }
}

Fixed version (ground truth):
public void run(){
  while (true) {
    requestFocus();
    requestFocusInWindow();
    surfaceUpdate();
    repaint();
    try {
      Thread.sleep(UPDATE_PERIOD);
    }
 catch (    InterruptedException ex) {
    }
  }
}
Program: 7184
Project: 7184
Buggy source:
public void updatePanKnob(double pan){
  panKnob.setValue((float)(pan + 1.0));
}

Fixed version (ground truth):
public void updatePanKnob(double pan){
  panKnob.setValue((float)(pan + 1.0) / 2.0f);
}
Program: 7185
Project: 7185
Buggy source:
public void surfaceStart(){
  fingers=new Fingers(SURFACE_WIDTH,SURFACE_HEIGHT);
  Thread surfaceThread=new Thread(){
    public void run(){
      while (true) {
        surfaceUpdate();
        repaint();
        try {
          Thread.sleep(UPDATE_PERIOD);
        }
 catch (        InterruptedException ex) {
        }
      }
    }
  }
;
  surfaceThread.start();
}

Fixed version (ground truth):
public void surfaceStart(){
  fingers=new Fingers(SURFACE_WIDTH,SURFACE_HEIGHT);
  Thread surfaceThread=new Thread(){
    public void run(){
      while (true) {
        requestFocus();
        requestFocusInWindow();
        surfaceUpdate();
        repaint();
        try {
          Thread.sleep(UPDATE_PERIOD);
        }
 catch (        InterruptedException ex) {
        }
      }
    }
  }
;
  surfaceThread.start();
}
Program: 7186
Project: 7186
Buggy source:
public SwingTest(KaossTest kaoss,SynthScope scope){
  this.kaoss=kaoss;
  this.setFocusable(true);
  this.addKeyListener(this);
  container=new JPanel();
  container.setPreferredSize(new Dimension(SURFACE_WIDTH + 250,SURFACE_HEIGHT + 400));
  container.setLayout(new BorderLayout());
  makeControls();
  content=new JPanel();
  content.setPreferredSize(new Dimension(SURFACE_WIDTH,SURFACE_HEIGHT + 400));
  content.setLayout(new BorderLayout());
  surface=new SurfaceCanvas();
  surface.setPreferredSize(new Dimension(SURFACE_WIDTH,SURFACE_HEIGHT));
  surface.setBackground(bgColor);
  content.add(surface,BorderLayout.CENTER);
  newScope(scope);
  container.add(content,BorderLayout.CENTER);
  container.add(controls,BorderLayout.WEST);
  this.setContentPane(container);
  this.setDefaultCloseOperation(EXIT_ON_CLOSE);
  this.pack();
  this.setTitle("String_Node_Str");
  this.setVisible(true);
  surfaceStart();
}

Fixed version (ground truth):
public SwingTest(KaossTest kaoss,SynthScope scope){
  this.kaoss=kaoss;
  this.setFocusable(true);
  this.addKeyListener(this);
  container=new JPanel();
  container.setPreferredSize(new Dimension(SURFACE_WIDTH + 250,SURFACE_HEIGHT + 450));
  container.setLayout(new BorderLayout());
  content=new JPanel();
  content.setPreferredSize(new Dimension(SURFACE_WIDTH,SURFACE_HEIGHT + 450));
  content.setLayout(new BorderLayout());
  extraControls=new JPanel();
  extraControls.setPreferredSize(new Dimension(0,50));
  extraControls.setLayout(new BoxLayout(extraControls,BoxLayout.X_AXIS));
  extraControls.setBackground(bgColor);
  makeControls();
  surface=new SurfaceCanvas();
  surface.setPreferredSize(new Dimension(SURFACE_WIDTH,SURFACE_HEIGHT));
  surface.setBackground(bgColor);
  content.add(surface,BorderLayout.CENTER);
  newScope(scope);
  container.add(content,BorderLayout.CENTER);
  container.add(controls,BorderLayout.WEST);
  content.add(extraControls,BorderLayout.SOUTH);
  this.setContentPane(container);
  this.setDefaultCloseOperation(EXIT_ON_CLOSE);
  this.pack();
  this.setTitle("String_Node_Str");
  this.setVisible(true);
  surfaceStart();
}
Program: 7187
Project: 7187
Buggy source:
public void keyPressed(KeyEvent e){
  System.out.println("String_Node_Str" + Synth.getObjectCount());
  int code=e.getKeyCode();
switch (code) {
case KeyEvent.VK_N:
    kaoss.changeScale(Instrument.minorScale);
  break;
case KeyEvent.VK_M:
kaoss.changeScale(Instrument.majorScale);
break;
case KeyEvent.VK_C:
kaoss.changeScale(Instrument.chromaticScale);
break;
case KeyEvent.VK_B:
kaoss.changeScale(Instrument.minorBluesScale);
break;
case KeyEvent.VK_D:
kaoss.toggleDelay();
break;
case KeyEvent.VK_R:
kaoss.toggleReverb();
break;
case KeyEvent.VK_S:
kaoss.sauceBoss();
break;
case KeyEvent.VK_UP:
kaoss.changePitch(1);
break;
case KeyEvent.VK_DOWN:
kaoss.changePitch(-1);
break;
default :
int id=Character.getNumericValue(e.getKeyChar());
if (id > -1) {
kaoss.changeInstrument(id);
updateControls(id);
}
}
System.out.println("String_Node_Str" + Synth.getObjectCount());
}

Fixed version (ground truth):
public void keyPressed(KeyEvent e){
  System.out.println("String_Node_Str" + Synth.getObjectCount());
  int code=e.getKeyCode();
switch (code) {
case KeyEvent.VK_N:
    kaoss.changeScale(Instrument.minorScale);
  for (  JLabel label : scaleLabels)   label.setForeground(scaleText);
minorLabel.setForeground(scaleSelText);
break;
case KeyEvent.VK_M:
kaoss.changeScale(Instrument.majorScale);
for (JLabel label : scaleLabels) label.setForeground(scaleText);
majorLabel.setForeground(scaleSelText);
break;
case KeyEvent.VK_C:
kaoss.changeScale(Instrument.chromaticScale);
for (JLabel label : scaleLabels) label.setForeground(scaleText);
chromaticLabel.setForeground(scaleSelText);
break;
case KeyEvent.VK_B:
kaoss.changeScale(Instrument.minorBluesScale);
for (JLabel label : scaleLabels) label.setForeground(scaleText);
bluesLabel.setForeground(scaleSelText);
break;
case KeyEvent.VK_D:
kaoss.toggleDelay();
fxEnabled=!fxEnabled;
if (fxEnabled) delayLabel.setForeground(effectSelText);
 else delayLabel.setForeground(effectText);
break;
case KeyEvent.VK_R:
kaoss.toggleReverb();
reverbEnabled=!reverbEnabled;
if (reverbEnabled) reverbLabel.setForeground(effectSelText);
 else reverbLabel.setForeground(effectText);
break;
case KeyEvent.VK_S:
kaoss.sauceBoss();
break;
case KeyEvent.VK_UP:
kaoss.changePitch(1);
break;
case KeyEvent.VK_DOWN:
kaoss.changePitch(-1);
break;
default :
int id=Character.getNumericValue(e.getKeyChar());
if (id > -1) {
kaoss.changeInstrument(id);
updateControls(id);
}
}
System.out.println("String_Node_Str" + Synth.getObjectCount());
}
Program: 7189
Project: 7189
Buggy source:
public void draw(Graphics g){
  ((Graphics2D)g).setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
  for (int i=0; i < MAX_FINGER_BLOBS; i++) {
    Finger f=blobs[i];
    if (f != null)     bloblist.add(f);
    for (    Finger blob : bloblist) {
      if (blob != null && blob.getState() == FingerState.PRESSED) {
        int x=(int)(width * (blob.getX()));
        int y=(int)(height * (1 - blob.getY()));
        int xsize=(int)(10 * blob.getSize() * (blob.getMajorAxis() / 2));
        int ysize=(int)(10 * blob.getSize() * (blob.getMinorAxis() / 2));
        int ang=blob.getAngle();
        if (x > 0 && y > 0) {
          Color pitchcolor=new Color((int)Math.floor((x / 800.0) * 255),255 - (int)Math.floor((y / 600.0) * 255),0);
          g.setColor(pitchcolor);
          Ellipse2D ellipse=new Ellipse2D.Float(0,0,xsize,ysize);
          AffineTransform at=AffineTransform.getTranslateInstance(0,0);
          at.translate(x - xsize / 2,y - ysize / 2);
          at.rotate((Math.PI / 180) * -ang,xsize / 2,ysize / 2);
          ((Graphics2D)g).fill(at.createTransformedShape(ellipse));
          g.setColor(Color.DARK_GRAY);
        }
      }
    }
    if (bloblist.size() > 10)     bloblist.remove(0);
  }
}

Fixed version (ground truth):
public void draw(Graphics g){
  ((Graphics2D)g).setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
  for (int i=0; i < MAX_FINGER_BLOBS; i++) {
    Finger f=blobs[i];
    if (f != null)     bloblist.add(f);
    for (    Finger blob : bloblist) {
      if (blob != null && blob.getState() == FingerState.PRESSED) {
        int x=(int)(width * (blob.getX()));
        int y=(int)(height * (1 - blob.getY()));
        int xsize=(int)(10 * blob.getSize() * (blob.getMajorAxis() / 2));
        int ysize=(int)(10 * blob.getSize() * (blob.getMinorAxis() / 2));
        int ang=blob.getAngle();
        if (x > 0 && y > 0 && x < SwingTest.SURFACE_WIDTH && y < SwingTest.SURFACE_HEIGHT) {
          Color pitchcolor=new Color((int)Math.floor((x / (float)SwingTest.SURFACE_WIDTH) * 255),255 - (int)Math.floor((y / (float)SwingTest.SURFACE_HEIGHT) * 255),0);
          g.setColor(pitchcolor);
          Ellipse2D ellipse=new Ellipse2D.Float(0,0,xsize,ysize);
          AffineTransform at=AffineTransform.getTranslateInstance(0,0);
          at.translate(x - xsize / 2,y - ysize / 2);
          at.rotate((Math.PI / 180) * -ang,xsize / 2,ysize / 2);
          ((Graphics2D)g).fill(at.createTransformedShape(ellipse));
          g.setColor(Color.DARK_GRAY);
        }
      }
    }
    if (bloblist.size() > 10)     bloblist.remove(0);
  }
}
Program: 7190
Project: 7190
Buggy source:
public void newScope(SynthScope scope){
  if (this.scope != null)   content.remove(this.scope);
  this.scope=scope;
  setupScope();
  content.add(this.scope,BorderLayout.SOUTH);
  content.validate();
}

Fixed version (ground truth):
public void newScope(SynthScope scope){
  if (this.scope != null)   content.remove(this.scope);
  this.scope=scope;
  setupScope();
  content.add(this.scope,BorderLayout.SOUTH);
  content.add(extraControls,BorderLayout.SOUTH);
  content.validate();
}
Program: 7191
Project: 7191
Buggy source:
public void changeInstrument(int id){
  if (init)   filter.input.disconnect();
switch (id) {
case KaossTest.INSTRUMENT_SINE:
    CURRENT_INSTRUMENT=SINE;
  break;
case KaossTest.INSTRUMENT_TRIANGLE:
CURRENT_INSTRUMENT=TRIANGLE;
break;
case KaossTest.INSTRUMENT_SQUARE:
CURRENT_INSTRUMENT=SQUARE;
break;
case KaossTest.INSTRUMENT_REDNOISE:
CURRENT_INSTRUMENT=REDNOISE;
break;
case KaossTest.INSTRUMENT_SAWTOOTH:
CURRENT_INSTRUMENT=SAWTOOTH;
break;
case KaossTest.INSTRUMENT_CUOMO:
CURRENT_INSTRUMENT=CUOMO;
break;
case KaossTest.INSTRUMENT_SINGINGSAW:
CURRENT_INSTRUMENT=SINGINGSAW;
break;
}
SynthMixer instrumentMix=CURRENT_INSTRUMENT.getMixer();
instrumentMix.start();
updateLFO();
if (init) instrumentMix.connectOutput(0,filter.input,0);
}

Fixed version (ground truth):
public void changeInstrument(int id){
  if (init)   filter.input.disconnect();
switch (id) {
case KaossTest.INSTRUMENT_SINE:
    CURRENT_INSTRUMENT=SINE;
  break;
case KaossTest.INSTRUMENT_TRIANGLE:
CURRENT_INSTRUMENT=TRIANGLE;
break;
case KaossTest.INSTRUMENT_SQUARE:
CURRENT_INSTRUMENT=SQUARE;
break;
case KaossTest.INSTRUMENT_REDNOISE:
CURRENT_INSTRUMENT=REDNOISE;
break;
case KaossTest.INSTRUMENT_SAWTOOTH:
CURRENT_INSTRUMENT=SAWTOOTH;
break;
case KaossTest.INSTRUMENT_SINGINGSAW:
CURRENT_INSTRUMENT=SINGINGSAW;
break;
case KaossTest.INSTRUMENT_CUOMO:
CURRENT_INSTRUMENT=CUOMO;
break;
}
SynthMixer instrumentMix=CURRENT_INSTRUMENT.getMixer();
instrumentMix.start();
updateLFO();
if (init) instrumentMix.connectOutput(0,filter.input,0);
}
Program: 7192
Project: 7192
Buggy source:
public int getInstrumentIdFromChar(char c){
  if (c == Character.forDigit(KaossTest.INSTRUMENT_SAWTOOTH,10))   return KaossTest.INSTRUMENT_SAWTOOTH;
 else   if (c == Character.forDigit(KaossTest.INSTRUMENT_SINE,10))   return KaossTest.INSTRUMENT_SINE;
 else   if (c == Character.forDigit(KaossTest.INSTRUMENT_TRIANGLE,10))   return KaossTest.INSTRUMENT_TRIANGLE;
 else   if (c == Character.forDigit(KaossTest.INSTRUMENT_SQUARE,10))   return KaossTest.INSTRUMENT_SQUARE;
 else   if (c == Character.forDigit(KaossTest.INSTRUMENT_REDNOISE,10))   return KaossTest.INSTRUMENT_REDNOISE;
 else   if (c == Character.forDigit(KaossTest.INSTRUMENT_CUOMO,10))   return KaossTest.INSTRUMENT_CUOMO;
 else   return KaossTest.INSTRUMENT_CUOMO;
}

Fixed version (ground truth):
public int getInstrumentIdFromChar(char c){
  if (c == Character.forDigit(KaossTest.INSTRUMENT_SINE,10))   return KaossTest.INSTRUMENT_SINE;
 else   if (c == Character.forDigit(KaossTest.INSTRUMENT_TRIANGLE,10))   return KaossTest.INSTRUMENT_TRIANGLE;
 else   if (c == Character.forDigit(KaossTest.INSTRUMENT_SQUARE,10))   return KaossTest.INSTRUMENT_SQUARE;
 else   if (c == Character.forDigit(KaossTest.INSTRUMENT_REDNOISE,10))   return KaossTest.INSTRUMENT_REDNOISE;
 else   if (c == Character.forDigit(KaossTest.INSTRUMENT_SAWTOOTH,10))   return KaossTest.INSTRUMENT_SAWTOOTH;
 else   if (c == Character.forDigit(KaossTest.INSTRUMENT_SINGINGSAW,10))   return KaossTest.INSTRUMENT_SINGINGSAW;
 else   if (c == Character.forDigit(KaossTest.INSTRUMENT_CUOMO,10))   return KaossTest.INSTRUMENT_CUOMO;
 else   return KaossTest.INSTRUMENT_CUOMO;
}
Program: 7193
Project: 7193
Buggy source:
public void onClick(View v){
switch (v.getId()) {
case R.id.backbutton:
    finish();
  break;
case R.id.homebutton:
Intent j=new Intent(this,TabWidget.class);
startActivity(j);
break;
}
}

Fixed version (ground truth):
public void onClick(View v){
switch (v.getId()) {
case R.id.backbutton:
    Intent i=new Intent(this,Marketplace.class);
  startActivity(i);
break;
case R.id.homebutton:
Intent j=new Intent(this,TabWidget.class);
startActivity(j);
break;
}
}
Program: 7194
Project: 7194
Buggy source:
public View getView(int position,View convertView,ViewGroup parent){
  View v;
  if (convertView == null) {
    LayoutInflater li=(LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    v=li.inflate(R.layout.icon,null);
    TextView tv=(TextView)v.findViewById(R.id.icon_text);
    tv.setText(robots[position]);
    ImageView iv=(ImageView)v.findViewById(R.id.icon_image);
    iv.setImageResource(mThumbIds[position]);
    TextView number=(TextView)v.findViewById(R.id.icon_number);
    number.setText(quantity[position]);
  }
 else {
    v=convertView;
  }
  return v;
}

Fixed version (ground truth):
public View getView(int position,View convertView,ViewGroup parent){
  this.setQuantity();
  View v;
  if (convertView == null) {
    LayoutInflater li=(LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    v=li.inflate(R.layout.icon,null);
    TextView tv=(TextView)v.findViewById(R.id.icon_text);
    tv.setText(robots[position]);
    ImageView iv=(ImageView)v.findViewById(R.id.icon_image);
    iv.setImageResource(mThumbIds[position]);
    TextView number=(TextView)v.findViewById(R.id.icon_number);
    number.setText(quantity[position]);
  }
 else {
    v=convertView;
  }
  return v;
}
Program: 7195
Project: 7195
Buggy source:
@Override public String toString(){
  return String.format("String_Node_Str",items.get(id),slot,amount,damage);
}

Fixed version (ground truth):
@Override public String toString(){
  if (items.get(id) != null) {
    return String.format("String_Node_Str",items.get(id),slot,amount,damage);
  }
 else {
    return String.format("String_Node_Str",id,slot,amount,damage);
  }
}
Program: 7196
Project: 7196
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.hosts);
  registerForContextMenu(getListView());
  startActivityForResult(new Intent(this,SplashActivity.class),SPLASH_REQUEST_REQ);
  initializeHostList();
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.hosts);
  registerForContextMenu(getListView());
  if (savedInstanceState == null || !savedInstanceState.getBoolean(INITIALIZED_KEY)) {
    startActivityForResult(new Intent(this,SplashActivity.class),SPLASH_REQUEST_REQ);
  }
  initializeHostList();
}