nus-yam/ex-repair huggingface dataset:
Program: 181051
Project: 181051
Buggy source:
private void update(){
  try {
    mMassStorage.setChecked(mMountService.getMassStorageEnabled());
  }
 catch (  RemoteException ex) {
  }
  String scanVolume=null;
  boolean scanning="String_Node_Str".equals(scanVolume);
  if (scanning) {
    setLayout(mScanningLayout);
  }
 else {
    String status=Environment.getExternalStorageState();
    boolean readOnly=false;
    if (status.equals(Environment.MEDIA_MOUNTED_READ_ONLY)) {
      status=Environment.MEDIA_MOUNTED;
      readOnly=true;
    }
    if (status.equals(Environment.MEDIA_MOUNTED)) {
      try {
        File path=Environment.getExternalStorageDirectory();
        StatFs stat=new StatFs(path.getPath());
        long blockSize=stat.getBlockSize();
        long totalBlocks=stat.getBlockCount();
        long availableBlocks=stat.getAvailableBlocks();
        mTotalSize.setText(formatSize(totalBlocks * blockSize));
        mUsedSize.setText(formatSize((totalBlocks - availableBlocks) * blockSize));
        mAvailableSize.setText(formatSize(availableBlocks * blockSize));
      }
 catch (      IllegalArgumentException e) {
        status=Environment.MEDIA_REMOVED;
      }
      mReadOnlyStatus.setVisibility(readOnly ? View.VISIBLE : View.GONE);
      setLayout(mMountedLayout);
    }
 else     if (status.equals(Environment.MEDIA_UNMOUNTED)) {
      setLayout(mUnmountedLayout);
    }
 else     if (status.equals(Environment.MEDIA_REMOVED)) {
      setLayout(mRemovedLayout);
    }
 else     if (status.equals(Environment.MEDIA_SHARED)) {
      setLayout(mSharedLayout);
    }
 else     if (status.equals(Environment.MEDIA_BAD_REMOVAL)) {
      setLayout(mBadRemovalLayout);
    }
  }
}

Fixed version (ground truth):
private void update(){
  try {
    mMassStorage.setChecked(mMountService.getMassStorageEnabled());
  }
 catch (  RemoteException ex) {
  }
  String status=Environment.getExternalStorageState();
  boolean readOnly=false;
  if (status.equals(Environment.MEDIA_MOUNTED_READ_ONLY)) {
    status=Environment.MEDIA_MOUNTED;
    readOnly=true;
  }
  if (status.equals(Environment.MEDIA_MOUNTED)) {
    try {
      File path=Environment.getExternalStorageDirectory();
      StatFs stat=new StatFs(path.getPath());
      long blockSize=stat.getBlockSize();
      long totalBlocks=stat.getBlockCount();
      long availableBlocks=stat.getAvailableBlocks();
      mTotalSize.setText(formatSize(totalBlocks * blockSize));
      mUsedSize.setText(formatSize((totalBlocks - availableBlocks) * blockSize));
      mAvailableSize.setText(formatSize(availableBlocks * blockSize));
    }
 catch (    IllegalArgumentException e) {
      status=Environment.MEDIA_REMOVED;
    }
    mReadOnlyStatus.setVisibility(readOnly ? View.VISIBLE : View.GONE);
    setLayout(mMountedLayout);
  }
 else   if (status.equals(Environment.MEDIA_UNMOUNTED)) {
    setLayout(mUnmountedLayout);
  }
 else   if (status.equals(Environment.MEDIA_REMOVED)) {
    setLayout(mRemovedLayout);
  }
 else   if (status.equals(Environment.MEDIA_SHARED)) {
    setLayout(mSharedLayout);
  }
 else   if (status.equals(Environment.MEDIA_BAD_REMOVAL)) {
    setLayout(mBadRemovalLayout);
  }
}
Program: 181052
Project: 181052
Buggy source:
public View getView(int position,View convertView,ViewGroup parent){
  AppViewHolder holder;
  if (convertView == null) {
    convertView=mInflater.inflate(R.layout.usage_stats_item,null);
    holder=new AppViewHolder();
    holder.pkgName=(TextView)convertView.findViewById(R.id.package_name);
    holder.launchCount=(TextView)convertView.findViewById(R.id.launch_count);
    holder.usageTime=(TextView)convertView.findViewById(R.id.usage_time);
    convertView.setTag(holder);
  }
 else {
    holder=(AppViewHolder)convertView.getTag();
  }
  PkgUsageStats pkgStats=mUsageStats.get(position);
  if (pkgStats != null) {
    CharSequence label=mAppLabelMap.get(pkgStats.packageName);
    holder.pkgName.setText(label);
    holder.launchCount.setText(String.valueOf(pkgStats.launchCount));
    holder.usageTime.setText(String.valueOf(pkgStats.usageTime) + "String_Node_Str");
  }
 else {
    Log.w(TAG,"String_Node_Str" + pkgStats.packageName);
  }
  return convertView;
}

Fixed version (ground truth):
public View getView(int position,View convertView,ViewGroup parent){
  AppViewHolder holder;
  if (convertView == null) {
    convertView=mInflater.inflate(R.layout.usage_stats_item,null);
    holder=new AppViewHolder();
    holder.pkgName=(TextView)convertView.findViewById(R.id.package_name);
    holder.launchCount=(TextView)convertView.findViewById(R.id.launch_count);
    holder.usageTime=(TextView)convertView.findViewById(R.id.usage_time);
    convertView.setTag(holder);
  }
 else {
    holder=(AppViewHolder)convertView.getTag();
  }
  PkgUsageStats pkgStats=mUsageStats.get(position);
  if (pkgStats != null) {
    CharSequence label=mAppLabelMap.get(pkgStats.packageName);
    holder.pkgName.setText(label);
    holder.launchCount.setText(String.valueOf(pkgStats.launchCount));
    holder.usageTime.setText(String.valueOf(pkgStats.usageTime) + "String_Node_Str");
  }
 else {
    Log.w(TAG,"String_Node_Str" + position);
  }
  return convertView;
}
Program: 181053
Project: 181053
Buggy source:
private List<HashMap> getZones(){
  List<HashMap> myData=new ArrayList<HashMap>();
  long date=Calendar.getInstance().getTimeInMillis();
  try {
    XmlResourceParser xrp=getResources().getXml(R.xml.timezones);
    while (xrp.next() != XmlResourceParser.START_TAG)     ;
    xrp.next();
    while (xrp.getEventType() != XmlResourceParser.END_TAG) {
      while (xrp.getEventType() != XmlResourceParser.START_TAG) {
        if (xrp.getEventType() == XmlResourceParser.END_DOCUMENT) {
          return myData;
        }
        xrp.next();
      }
      if (xrp.getName().equals(XMLTAG_TIMEZONE)) {
        String id=xrp.getAttributeValue(0);
        String displayName=xrp.nextText();
        addItem(myData,id,displayName,date);
      }
      while (xrp.getEventType() != XmlResourceParser.END_TAG) {
        xrp.next();
      }
      xrp.next();
    }
    xrp.close();
  }
 catch (  XmlPullParserException xppe) {
    Log.e(TAG,"String_Node_Str");
  }
catch (  java.io.IOException ioe) {
    Log.e(TAG,"String_Node_Str");
  }
  return myData;
}

Fixed version (ground truth):
private List<HashMap> getZones(){
  List<HashMap> myData=new ArrayList<HashMap>();
  long date=Calendar.getInstance().getTimeInMillis();
  try {
    XmlResourceParser xrp=getResources().getXml(R.xml.timezones);
    while (xrp.next() != XmlResourceParser.START_TAG)     continue;
    xrp.next();
    while (xrp.getEventType() != XmlResourceParser.END_TAG) {
      while (xrp.getEventType() != XmlResourceParser.START_TAG) {
        if (xrp.getEventType() == XmlResourceParser.END_DOCUMENT) {
          return myData;
        }
        xrp.next();
      }
      if (xrp.getName().equals(XMLTAG_TIMEZONE)) {
        String id=xrp.getAttributeValue(0);
        String displayName=xrp.nextText();
        addItem(myData,id,displayName,date);
      }
      while (xrp.getEventType() != XmlResourceParser.END_TAG) {
        xrp.next();
      }
      xrp.next();
    }
    xrp.close();
  }
 catch (  XmlPullParserException xppe) {
    Log.e(TAG,"String_Node_Str");
  }
catch (  java.io.IOException ioe) {
    Log.e(TAG,"String_Node_Str");
  }
  return myData;
}
Program: 181054
Project: 181054
Buggy source:
public void askDisconnect(){
  Context context=mLocalManager.getForegroundActivity();
  if (context == null) {
    disconnect();
    return;
  }
  Resources res=context.getResources();
  String name=getName();
  if (TextUtils.isEmpty(name)) {
    name=res.getString(R.string.bluetooth_device);
  }
  String message=res.getString(R.string.bluetooth_disconnect_blank,name);
  DialogInterface.OnClickListener disconnectListener=new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int which){
      disconnect();
    }
  }
;
  AlertDialog ad=new AlertDialog.Builder(context).setTitle(getName()).setMessage(message).setPositiveButton(android.R.string.ok,disconnectListener).setNegativeButton(android.R.string.cancel,null).show();
}

Fixed version (ground truth):
public void askDisconnect(){
  Context context=mLocalManager.getForegroundActivity();
  if (context == null) {
    disconnect();
    return;
  }
  Resources res=context.getResources();
  String name=getName();
  if (TextUtils.isEmpty(name)) {
    name=res.getString(R.string.bluetooth_device);
  }
  String message=res.getString(R.string.bluetooth_disconnect_blank,name);
  DialogInterface.OnClickListener disconnectListener=new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int which){
      disconnect();
    }
  }
;
  new AlertDialog.Builder(context).setTitle(getName()).setMessage(message).setPositiveButton(android.R.string.ok,disconnectListener).setNegativeButton(android.R.string.cancel,null).show();
}
Program: 181055
Project: 181055
Buggy source:
private void fillData(){
  BluetoothDevice manager=mLocalManager.getBluetoothManager();
  fetchName();
  fetchBtClass();
  mVisible=false;
  dispatchAttributesChanged();
}

Fixed version (ground truth):
private void fillData(){
  fetchName();
  fetchBtClass();
  mVisible=false;
  dispatchAttributesChanged();
}
Program: 181056
Project: 181056
Buggy source:
private void connectAndPreferAllProfiles(){
  if (!ensurePaired())   return;
  mIsConnectingErrorPossible=true;
  Context context=mLocalManager.getContext();
  for (  Profile profile : mProfiles) {
    LocalBluetoothProfileManager profileManager=LocalBluetoothProfileManager.getProfileManager(mLocalManager,profile);
    profileManager.setPreferred(mAddress,true);
    queueCommand(new BluetoothJob(BluetoothCommand.CONNECT,this,profile));
  }
}

Fixed version (ground truth):
private void connectAndPreferAllProfiles(){
  if (!ensurePaired())   return;
  mIsConnectingErrorPossible=true;
  for (  Profile profile : mProfiles) {
    LocalBluetoothProfileManager profileManager=LocalBluetoothProfileManager.getProfileManager(mLocalManager,profile);
    profileManager.setPreferred(mAddress,true);
    queueCommand(new BluetoothJob(BluetoothCommand.CONNECT,this,profile));
  }
}
Program: 181057
Project: 181057
Buggy source:
void updateTimes(){
  long at=SystemClock.uptimeMillis() / 1000;
  long ut=SystemClock.elapsedRealtime() / 1000;
  long st=ut - at;
  if (ut == 0) {
    ut=1;
  }
  mUptime.setSummary(convert(ut));
}

Fixed version (ground truth):
void updateTimes(){
  long at=SystemClock.uptimeMillis() / 1000;
  long ut=SystemClock.elapsedRealtime() / 1000;
  if (ut == 0) {
    ut=1;
  }
  mUptime.setSummary(convert(ut));
}
Program: 181058
Project: 181058
Buggy source:
@Override protected void onActivityResult(int requestCode,int resultCode,Intent data){
  if (resultCode != RESULT_OK) {
    return;
  }
  if (requestCode == REQUEST_PICK_BOOKMARK) {
    if (data == null) {
      Log.w(TAG,"String_Node_Str");
      return;
    }
    String title=data.getStringExtra(BookmarkPicker.EXTRA_TITLE);
    char shortcut=data.getCharExtra(BookmarkPicker.EXTRA_SHORTCUT,(char)0);
    updateShortcut(shortcut,data);
  }
 else {
    super.onActivityResult(requestCode,resultCode,data);
  }
}

Fixed version (ground truth):
@Override protected void onActivityResult(int requestCode,int resultCode,Intent data){
  if (resultCode != RESULT_OK) {
    return;
  }
  if (requestCode == REQUEST_PICK_BOOKMARK) {
    if (data == null) {
      Log.w(TAG,"String_Node_Str");
      return;
    }
    char shortcut=data.getCharExtra(BookmarkPicker.EXTRA_SHORTCUT,(char)0);
    updateShortcut(shortcut,data);
  }
 else {
    super.onActivityResult(requestCode,resultCode,data);
  }
}
Program: 181059
Project: 181059
Buggy source:
private void updatePasswordCaption(String security){
  if (mPasswordText != null && security != null && security.equals(AccessPointState.WEP)) {
    mPasswordText.setText(R.string.please_type_hex_key);
  }
 else {
    mPasswordText.setText(R.string.please_type_passphrase);
  }
}

Fixed version (ground truth):
private void updatePasswordCaption(String security){
  if (mPasswordText != null) {
    if (security != null && security.equals(AccessPointState.WEP)) {
      mPasswordText.setText(R.string.please_type_hex_key);
    }
 else {
      mPasswordText.setText(R.string.please_type_passphrase);
    }
  }
}
Program: 181060
Project: 181060
Buggy source:
public AccessPointPreference(WifiSettings wifiSettings,AccessPointState state){
  super(wifiSettings,null);
  mWifiSettings=wifiSettings;
  mState=state;
  setWidgetLayoutResource(R.layout.preference_widget_wifi_signal);
  state.setCallback(this);
  refresh();
}

Fixed version (ground truth):
public AccessPointPreference(WifiSettings wifiSettings,AccessPointState state){
  super(wifiSettings,null);
  mState=state;
  setWidgetLayoutResource(R.layout.preference_widget_wifi_signal);
  state.setCallback(this);
  refresh();
}
Program: 181061
Project: 181061
Buggy source:
private void refreshStatus(AccessPointState ap,NetworkInfo.DetailedState detailedState){
  final WifiInfo wifiInfo=mWifiManager.getConnectionInfo();
  if (detailedState == null) {
    detailedState=WifiInfo.getDetailedStateOf(wifiInfo.getSupplicantState());
  }
  if (ap == null && WifiStatus.isLiveConnection(detailedState)) {
    ap=findApLocked(wifiInfo.getNetworkId(),wifiInfo.getBSSID(),wifiInfo.getSSID(),null);
  }
  if (ap != null) {
    ap.blockRefresh();
    ap.updateFromWifiInfo(wifiInfo,detailedState);
    ap.setStatus(detailedState);
    ap.unblockRefresh();
  }
}

Fixed version (ground truth):
private void refreshStatus(AccessPointState ap,NetworkInfo.DetailedState detailedState){
  final WifiInfo wifiInfo=mWifiManager.getConnectionInfo();
  if (detailedState == null) {
    detailedState=WifiInfo.getDetailedStateOf(wifiInfo.getSupplicantState());
  }
  if (ap == null && WifiStatus.isLiveConnection(detailedState)) {
synchronized (this) {
      ap=findApLocked(wifiInfo.getNetworkId(),wifiInfo.getBSSID(),wifiInfo.getSSID(),null);
    }
  }
  if (ap != null) {
    ap.blockRefresh();
    ap.updateFromWifiInfo(wifiInfo,detailedState);
    ap.setStatus(detailedState);
    ap.unblockRefresh();
  }
}
Program: 181062
Project: 181062
Buggy source:
private AccessPointState getCurrentAp(){
  final WifiInfo wifiInfo=mWifiManager.getConnectionInfo();
  String ssid=wifiInfo.getSSID();
  if (ssid != null) {
    return findApLocked(wifiInfo.getNetworkId(),wifiInfo.getBSSID(),ssid,null);
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
private AccessPointState getCurrentAp(){
  final WifiInfo wifiInfo=mWifiManager.getConnectionInfo();
  String ssid=wifiInfo.getSSID();
  if (ssid != null) {
synchronized (this) {
      return findApLocked(wifiInfo.getNetworkId(),wifiInfo.getBSSID(),ssid,null);
    }
  }
 else {
    return null;
  }
}
Program: 181063
Project: 181063
Buggy source:
private void showDialog(Dialog dialog){
  if (mDialog != null) {
    mDialog.dismiss();
  }
  mDialog=dialog;
  dialog.setOnDismissListener(this);
  if (dialog != null) {
    dialog.show();
  }
}

Fixed version (ground truth):
private void showDialog(Dialog dialog){
  if (mDialog != null) {
    mDialog.dismiss();
  }
  mDialog=dialog;
  if (dialog != null) {
    dialog.setOnDismissListener(this);
    dialog.show();
  }
}
Program: 181064
Project: 181064
Buggy source:
private void syncBluetoothState(){
  setBluetoothStateInt(mManager.isEnabled() ? BluetoothDevice.BLUETOOTH_STATE_ON : BluetoothDevice.BLUETOOTH_STATE_OFF);
}

Fixed version (ground truth):
private void syncBluetoothState(){
  int bluetoothState;
  if (mManager != null) {
    bluetoothState=mManager.isEnabled() ? BluetoothDevice.BLUETOOTH_STATE_ON : BluetoothDevice.BLUETOOTH_STATE_OFF;
  }
 else {
    bluetoothState=BluetoothError.ERROR;
  }
  setBluetoothStateInt(bluetoothState);
}
Program: 181065
Project: 181065
Buggy source:
private void syncBluetoothState(){
  setBluetoothStateInt(mManager.isEnabled() ? BluetoothDevice.BLUETOOTH_STATE_ON : BluetoothDevice.BLUETOOTH_STATE_OFF);
}

Fixed version (ground truth):
private void syncBluetoothState(){
  int bluetoothState;
  if (mManager != null) {
    bluetoothState=mManager.isEnabled() ? BluetoothDevice.BLUETOOTH_STATE_ON : BluetoothDevice.BLUETOOTH_STATE_OFF;
  }
 else {
    bluetoothState=BluetoothError.ERROR;
  }
  setBluetoothStateInt(bluetoothState);
}
Program: 181066
Project: 181066
Buggy source:
/** 
 * Return the AudioFileFormat from the given InputStream. Implementation.
 * @param bitStream
 * @param baos
 * @param mediaLength
 * @return an AudioInputStream object based on the audio file data containedin the input stream.
 * @exception UnsupportedAudioFileException if the File does not point to a valid audio file data recognized by the system.
 * @exception IOException if an I/O exception occurs.
 */
protected AudioFileFormat getAudioFileFormat(InputStream bitStream,int mediaLength) throws UnsupportedAudioFileException, IOException {
  AudioFormat format;
  try {
    decoder=new FLACDecoder(bitStream);
    streamInfo=decoder.readStreamInfo();
    if (streamInfo == null) {
      if (DEBUG) {
        System.out.println("String_Node_Str");
      }
      throw new UnsupportedAudioFileException("String_Node_Str");
    }
    format=new FlacAudioFormat(streamInfo);
  }
 catch (  IOException ioe) {
    if (DEBUG) {
      System.out.println("String_Node_Str");
    }
    throw new UnsupportedAudioFileException(ioe.getMessage());
  }
  if (DEBUG) {
    System.out.println("String_Node_Str" + format);
  }
  return new AudioFileFormat(FlacFileFormatType.FLAC,format,AudioSystem.NOT_SPECIFIED);
}

Fixed version (ground truth):
/** 
 * Return the AudioFileFormat from the given InputStream. Implementation.
 * @param bitStream
 * @param mediaLength
 * @return an AudioInputStream object based on the audio file data containedin the input stream.
 * @exception UnsupportedAudioFileException if the File does not point to a valid audio file data recognized by the system.
 * @exception IOException if an I/O exception occurs.
 */
protected AudioFileFormat getAudioFileFormat(InputStream bitStream,int mediaLength) throws UnsupportedAudioFileException, IOException {
  AudioFormat format;
  try {
    decoder=new FLACDecoder(bitStream);
    streamInfo=decoder.readStreamInfo();
    if (streamInfo == null) {
      if (DEBUG) {
        System.out.println("String_Node_Str");
      }
      throw new UnsupportedAudioFileException("String_Node_Str");
    }
    format=new FlacAudioFormat(streamInfo);
  }
 catch (  IOException ioe) {
    if (DEBUG) {
      System.out.println("String_Node_Str");
    }
    final UnsupportedAudioFileException unsupportedAudioFileException=new UnsupportedAudioFileException(ioe.getMessage());
    unsupportedAudioFileException.initCause(ioe);
    throw unsupportedAudioFileException;
  }
  if (DEBUG) {
    System.out.println("String_Node_Str" + format);
  }
  return new AudioFileFormat(FlacFileFormatType.FLAC,format,AudioSystem.NOT_SPECIFIED);
}
Program: 181067
Project: 181067
Buggy source:
/** 
 * Constructor.
 */
public AbstractTestCase(String testName){
  super(testName);
}

Fixed version (ground truth):
protected AbstractTestCase(){
}
Program: 181068
Project: 181068
Buggy source:
/** 
 * Get test input file.
 * @param path Path to test input file.
 */
public String getTestFile(String path){
  return new File(basedir,path).getAbsolutePath();
}

Fixed version (ground truth):
/** 
 * Get test input file.
 * @param path Path to test input file.
 * @return file relative to basedir
 */
public String getTestFile(String path){
  return new File(basedir,path).getAbsolutePath();
}
Program: 181069
Project: 181069
Buggy source:
/** 
 * Read a block of bytes (aligned) without updating the CRC value.
 * @param val   The array to receive the bytes. If null, no bytes are returned
 * @param nvals The number of bytes to read
 * @throws IOException  Thrown if error reading input stream
 */
public void readByteBlockAlignedNoCRC(byte[] val,int nvals) throws IOException {
  while (nvals > 0) {
    int chunk=Math.min(nvals,putByte - getByte);
    if (chunk == 0) {
      readFromStream();
    }
 else {
      if (val != null)       System.arraycopy(buffer,getByte,val,0,chunk);
      nvals-=chunk;
      getByte+=chunk;
      availBits-=(chunk << BITS_PER_BLURB_LOG2);
      totalBitsRead+=(chunk << BITS_PER_BLURB_LOG2);
    }
  }
}

Fixed version (ground truth):
/** 
 * Read a block of bytes (aligned) without updating the CRC value.
 * @param val   The array to receive the bytes. If null, no bytes are returned
 * @param nvals The number of bytes to read
 * @throws IOException  Thrown if error reading input stream
 */
public void readByteBlockAlignedNoCRC(byte[] val,int nvals) throws IOException {
  int destlength=nvals;
  while (nvals > 0) {
    int chunk=Math.min(nvals,putByte - getByte);
    if (chunk == 0) {
      readFromStream();
    }
 else {
      if (val != null)       System.arraycopy(buffer,getByte,val,destlength - nvals,chunk);
      nvals-=chunk;
      getByte+=chunk;
      availBits-=(chunk << BITS_PER_BLURB_LOG2);
      totalBitsRead+=(chunk << BITS_PER_BLURB_LOG2);
    }
  }
}
Program: 181070
Project: 181070
Buggy source:
/** 
 * Process the StreamInfo block.
 * @param info the StreamInfo block
 * @see org.kc7bfi.jflac.PCMProcessor#processStreamInfo(org.kc7bfi.jflac.metadata.StreamInfo)
 */
public void processStreamInfo(StreamInfo streamInfo){
  try {
    fmt=new AudioFormat(streamInfo.sampleRate,streamInfo.bitsPerSample,streamInfo.channels,true,false);
    info=new DataLine.Info(SourceDataLine.class,fmt,AudioSystem.NOT_SPECIFIED);
    line=(SourceDataLine)AudioSystem.getLine(info);
    line.open(fmt,AudioSystem.NOT_SPECIFIED);
  }
 catch (  LineUnavailableException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * Process the StreamInfo block.
 * @param info the StreamInfo block
 * @see org.kc7bfi.jflac.PCMProcessor#processStreamInfo(org.kc7bfi.jflac.metadata.StreamInfo)
 */
public void processStreamInfo(StreamInfo streamInfo){
  try {
    fmt=new AudioFormat(streamInfo.sampleRate,streamInfo.bitsPerSample,streamInfo.channels,true,false);
    info=new DataLine.Info(SourceDataLine.class,fmt,AudioSystem.NOT_SPECIFIED);
    line=(SourceDataLine)AudioSystem.getLine(info);
    line.open(fmt,AudioSystem.NOT_SPECIFIED);
    line.start();
  }
 catch (  LineUnavailableException e) {
    e.printStackTrace();
  }
}
Program: 181071
Project: 181071
Buggy source:
/** 
 * Process the decoded PCM bytes.
 * @param pcm The decoded PCM data
 * @see org.kc7bfi.jflac.PCMProcessor#processPCM(org.kc7bfi.jflac.util.ByteSpace)
 */
public void processPCM(ByteSpace pcm){
  line.write(pcm.space,0,pcm.pos);
  if (prefill) {
    line.start();
    prefill=false;
  }
}

Fixed version (ground truth):
/** 
 * Process the decoded PCM bytes.
 * @param pcm The decoded PCM data
 * @see org.kc7bfi.jflac.PCMProcessor#processPCM(org.kc7bfi.jflac.util.ByteSpace)
 */
public void processPCM(ByteSpace pcm){
  line.write(pcm.space,0,pcm.pos);
}
Program: 181072
Project: 181072
Buggy source:
/** 
 * The main routine. <p>args[0] is the input file name
 * @param args  Command line arguments
 */
public static void main(String[] args){
  try {
    Player decoder=new Player();
    decoder.decode(args[0]);
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
catch (  LineUnavailableException e) {
    e.printStackTrace();
  }
  System.exit(0);
}

Fixed version (ground truth):
/** 
 * The main routine. <p>args[0] is the input file name
 * @param args  Command line arguments
 */
public static void main(String[] args){
  try {
    Player decoder=new Player();
    for (int i=0; i < args.length; i++)     decoder.decode(args[i]);
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
catch (  LineUnavailableException e) {
    e.printStackTrace();
  }
  System.exit(0);
}
Program: 181073
Project: 181073
Buggy source:
/** 
 * Constructor that takes in a board, player and genericMove
 * @param setting the current board
 * @param currentTurn the current Player
 * @param nextMove the next genericMove
 */
@Override public Iterator<StateImpl> iterator(){
  return null;
}

Fixed version (ground truth):
@Override public Iterator<StateImpl> iterator(){
  return null;
}
Program: 181074
Project: 181074
Buggy source:
/** 
 * Randomly choose which move to make
 */
public void randomMove(){
  Random generator=new Random();
  float f=generator.nextFloat() * 100;
  if ((int)f < 50 && currentTurn.wallCount() > 0) {
    wall();
    int wall=(int)generator.nextFloat() * wallBackerList.size() - 1;
    PlaceWall tmp=wallBackerList.get(wall);
    nextMove=tmp;
  }
 else {
    pawn();
    int move=(int)generator.nextFloat() * pawnBackerList.size() - 1;
    MovePawn tmp=pawnBackerList.get(move);
    nextMove=tmp;
  }
}

Fixed version (ground truth):
/** 
 * Randomly choose which move to make
 */
public void randomMove(){
  Random generator=new Random();
  float f=generator.nextFloat() * 100;
  if ((int)f < 50 && currentTurn.wallCount() > 0) {
    wall();
    float wall=generator.nextFloat() * (wallBackerList.size() - 1);
    PlaceWall tmp=wallBackerList.get((int)wall);
    nextMove=tmp;
  }
 else {
    pawn();
    float move=generator.nextFloat() * (pawnBackerList.size() - 1);
    MovePawn tmp=pawnBackerList.get((int)move);
    nextMove=tmp;
  }
}
Program: 181075
Project: 181075
Buggy source:
/** 
 * Constructor that takes in a board and player
 * @param setting the current board state
 * @param currentTurn the current player
 */
public RandomAI(Board setting,Player currentTurn){
  this.setting=setting;
  this.currentTurn=currentTurn;
  nextMove=null;
}

Fixed version (ground truth):
/** 
 * Constructor that takes in a board, player and genericMove
 * @param setting the current board
 * @param currentTurn the current Player
 * @param nextMove the next genericMove
 */
public RandomAI(Board setting,Player currentTurn,GenericMove nextMove){
  this.setting=setting;
  this.currentTurn=currentTurn;
  this.nextMove=nextMove;
}
Program: 181076
Project: 181076
Buggy source:
/** 
 * Undo a move of the current player (two if you are playing against the AI)
 */
public void undoMove();

Fixed version (ground truth):
/** 
 * Undo a move of the current player (two if you are playing against the AI)
 */
public boolean undoMove();
Program: 181077
Project: 181077
Buggy source:
/** 
 * Redo the move of the current player (two if you are playing against the AI)
 */
public void redoMove();

Fixed version (ground truth):
/** 
 * Redo the move of the current player (two if you are playing against the AI)
 */
public boolean redoMove();
Program: 181079
Project: 181079
Buggy source:
@Override public void undoMove(){
  if (undoMoves.size() >= 1) {
    if (current.getOpponent().isHuman() == false) {
      undoOnce();
      current=current.getOpponent();
      undoOnce();
    }
 else {
      undoOnce();
    }
  }
 else {
    System.out.println("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public boolean undoMove(){
  boolean retVal=false;
  if (undoMoves.size() - 1 > 1) {
    if (current.getOpponent().isHuman() == false) {
      undoOnce();
      current=current.getOpponent();
      undoOnce();
    }
 else {
      undoOnce();
    }
    retVal=true;
  }
 else {
    System.out.println("String_Node_Str");
  }
  return retVal;
}
Program: 181080
Project: 181080
Buggy source:
@Override public void redoMove(){
  if (redoMoves.size() >= 0) {
    if (current.getOpponent().isHuman() == false) {
      redoOnce();
      current=current.getOpponent();
      redoOnce();
    }
 else {
      redoOnce();
    }
  }
 else {
    System.out.println("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public boolean redoMove(){
  boolean retVal=false;
  System.out.println("String_Node_Str" + redoMoves);
  if (redoMoves.size() - 1 > 0) {
    if (current.getOpponent().isHuman() == false) {
      redoOnce();
      current=current.getOpponent();
      redoOnce();
    }
 else {
      redoOnce();
    }
    retVal=true;
  }
 else {
    System.out.println("String_Node_Str");
  }
  return retVal;
}
Program: 181081
Project: 181081
Buggy source:
public boolean pathToGoal(Pawn pawn){
  assert(pawns.contains(pawn));
  HashSet<Square> seen=new HashSet<Square>();
  int goalRow;
  if (pawn.getOwner().goalEnd() == Player.BOTTOM) {
    goalRow=0;
  }
 else {
    goalRow=Board.ROWS - 1;
  }
  return localPathToGoal(pawn.getSquare(),seen,goalRow);
}

Fixed version (ground truth):
public boolean pathToGoal(Pawn pawn){
  assert(pawns.contains(pawn));
  HashSet<Square> seen=new HashSet<Square>();
  int goalRow;
  if (pawn.getOwner().goalEnd() == Player.TOP) {
    goalRow=0;
  }
 else {
    goalRow=Board.ROWS - 1;
  }
  return localPathToGoal(pawn.getSquare(),seen,goalRow);
}
Program: 181082
Project: 181082
Buggy source:
public GenericMove parseMove(String move,Player current,Board board){
  int len=move.length();
  boolean validInput=len == 2 || len == 3;
  int col=-1;
  int row=-1;
  boolean type=GenericMove.PAWN;
  boolean dir=false;
  GenericMove result=null;
  ;
  col=charNum(move.charAt(0));
  if (validInput && col == -1) {
    validInput=false;
  }
 else   if (validInput) {
    row=parseInt(move.charAt(1)) - 1;
  }
  if (validInput && col == -1) {
    validInput=false;
  }
 else   if (validInput && len == 3) {
    type=GenericMove.WALL;
    char dirChar=move.charAt(2);
    if (dirChar == 'h') {
      dir=Wall.HORIZONTAL;
    }
 else     if (dirChar == 'v') {
      dir=Wall.VERTICAL;
    }
 else {
      validInput=false;
    }
  }
  if (validInput) {
    if (type == GenericMove.PAWN) {
      result=new MovePawnImpl(col,row,current,board);
      System.out.println(len);
    }
 else     if (type == GenericMove.WALL) {
      result=new PlaceWallImpl(col,row,dir,current,board);
    }
  }
  return result;
}

Fixed version (ground truth):
public GenericMove parseMove(String move,Player current,Board board){
  int len=move.length();
  boolean validInput=len == 2 || len == 3;
  int col=-1;
  int row=-1;
  boolean type=GenericMove.PAWN;
  boolean dir=false;
  GenericMove result=null;
  ;
  col=charNum(move.charAt(0));
  if (validInput && col == -1) {
    validInput=false;
  }
 else   if (validInput) {
    row=parseInt(move.charAt(1)) - 1;
  }
  if (validInput && col == -1) {
    validInput=false;
  }
 else   if (validInput && len == 3) {
    type=GenericMove.WALL;
    char dirChar=move.charAt(2);
    if (dirChar == 'h') {
      dir=Wall.HORIZONTAL;
    }
 else     if (dirChar == 'v') {
      dir=Wall.VERTICAL;
    }
 else {
      validInput=false;
    }
  }
  if (validInput) {
    if (type == GenericMove.PAWN) {
      result=new MovePawnImpl(col,row,current,board);
    }
 else     if (type == GenericMove.WALL) {
      result=new PlaceWallImpl(col,row,dir,current,board);
    }
  }
  return result;
}
Program: 181083
Project: 181083
Buggy source:
@Override public boolean isValid(){
  boolean valid=true;
  Wall test=new WallImpl(new SquareImpl(tentative.topLeft().getCol(),tentative.topLeft().getRow()),tentative.getDirection());
  boolean direction=tentative.getDirection();
  if (direction == Wall.HORIZONTAL) {
    direction=Wall.VERTICAL;
  }
 else {
    direction=Wall.HORIZONTAL;
  }
  Wall opposite=new WallImpl(new SquareImpl(tentative.topLeft().getCol(),tentative.topLeft().getRow()),direction);
  if (setting.getPawn(owner,setting).getOwner().wallCount() <= 0) {
    valid=false;
  }
  if (tentative.topLeft().getCol() < 0) {
    valid=false;
  }
 else   if (tentative.topLeft().getRow() < 0) {
    valid=false;
  }
 else   if (tentative.topLeft().getCol() > 7) {
    valid=false;
  }
 else   if (tentative.topLeft().getRow() > 7) {
    valid=false;
  }
 else   if (setting.containsWall(test) == true) {
    valid=false;
  }
 else   if (setting.containsWall(opposite) == true) {
    valid=false;
  }
 else {
    setting.addWall(tentative);
    System.out.println("String_Node_Str" + setting);
    if (setting.pathToGoal(setting.getPawn(owner,setting)) == false) {
      valid=false;
      System.out.println("String_Node_Str");
    }
 else     if (setting.pathToGoal(setting.getPawn(owner.getOpponent(),setting)) == false) {
      valid=false;
      System.out.println("String_Node_Str");
    }
    setting.removeWall(tentative);
  }
  if (owner.hasWon(setting) || owner.getOpponent().hasWon(setting)) {
    valid=false;
  }
  return valid;
}

Fixed version (ground truth):
@Override public boolean isValid(){
  boolean valid=true;
  Wall test=new WallImpl(new SquareImpl(tentative.topLeft().getCol(),tentative.topLeft().getRow()),tentative.getDirection());
  boolean direction=tentative.getDirection();
  if (direction == Wall.HORIZONTAL) {
    direction=Wall.VERTICAL;
  }
 else {
    direction=Wall.HORIZONTAL;
  }
  Wall opposite=new WallImpl(new SquareImpl(tentative.topLeft().getCol(),tentative.topLeft().getRow()),direction);
  if (setting.getPawn(owner,setting).getOwner().wallCount() <= 0) {
    valid=false;
  }
  if (tentative.topLeft().getCol() < 0) {
    valid=false;
  }
 else   if (tentative.topLeft().getRow() < 0) {
    valid=false;
  }
 else   if (tentative.topLeft().getCol() > 7) {
    valid=false;
  }
 else   if (tentative.topLeft().getRow() > 7) {
    valid=false;
  }
 else   if (setting.containsWall(test) == true) {
    valid=false;
  }
 else   if (setting.containsWall(opposite) == true) {
    valid=false;
  }
 else {
    setting.addWall(tentative);
    if (setting.pathToGoal(setting.getPawn(owner,setting)) == false) {
      valid=false;
    }
 else     if (setting.pathToGoal(setting.getPawn(owner.getOpponent(),setting)) == false) {
      valid=false;
    }
    setting.removeWall(tentative);
  }
  if (owner.hasWon(setting) || owner.getOpponent().hasWon(setting)) {
    valid=false;
  }
  return valid;
}
Program: 181085
Project: 181085
Buggy source:
public void logicalPlay(){
  Node pathP1=pathLength(currentTurn);
  int costP1=pathP1.getCost();
  Node pathP2=pathLength(currentTurn.getOpponent());
  int costP2=pathP2.getCost();
  if (costP1 < costP2) {
    nextMove=new MovePawnImpl(pathP1.getSquare().getCol(),pathP1.getSquare().getRow(),currentTurn,setting);
  }
 else {
    if (setting.getPawn(currentTurn,setting).getOwner().wallCount() <= 0) {
      nextMove=new MovePawnImpl(pathP1.getSquare().getCol(),pathP1.getSquare().getRow(),currentTurn,setting);
    }
 else {
      if (wallMove() == false) {
        nextMove=new MovePawnImpl(pathP1.getSquare().getCol(),pathP1.getSquare().getRow(),currentTurn,setting);
      }
    }
  }
  findPathTaken(pathP1);
}

Fixed version (ground truth):
public void logicalPlay(){
  Node pathP1=pathLength(currentTurn);
  int costP1=pathP1.getCost();
  System.out.println("String_Node_Str" + costP1);
  Node pathP2=pathLength(currentTurn.getOpponent());
  int costP2=pathP2.getCost();
  System.out.println("String_Node_Str" + costP2);
  if (costP1 < costP2) {
    System.out.println("String_Node_Str");
    nextMove=new MovePawnImpl(pathP1.getSquare().getCol(),pathP1.getSquare().getRow(),currentTurn,setting);
  }
 else {
    System.out.println("String_Node_Str");
    if (setting.getPawn(currentTurn,setting).getOwner().wallCount() <= 0) {
      nextMove=new MovePawnImpl(pathP1.getSquare().getCol(),pathP1.getSquare().getRow(),currentTurn,setting);
    }
 else {
      System.out.println("String_Node_Str");
      if (wallMove() == false) {
        nextMove=new MovePawnImpl(pathP1.getSquare().getCol(),pathP1.getSquare().getRow(),currentTurn,setting);
      }
    }
  }
  findPathTaken(pathP1);
}
Program: 181086
Project: 181086
Buggy source:
private boolean wallMove(){
  Player p2=currentTurn.getOpponent();
  Square tmp=setting.getPawn(p2,setting).getSquare();
  Square rightS=new SquareImpl(tmp.getCol() - 1,tmp.getRow());
  PlaceWallImpl next=null;
  boolean exit=false;
  boolean retVal=true;
  if ((next=new PlaceWallImpl(tmp.getCol(),tmp.getRow(),Wall.HORIZONTAL,currentTurn,setting)).isValid()) {
    nextMove=next;
  }
 else   if ((next=new PlaceWallImpl(tmp.getCol(),tmp.getRow(),Wall.VERTICAL,currentTurn,setting)).isValid()) {
    nextMove=next;
  }
 else   if ((next=new PlaceWallImpl(rightS.getCol(),rightS.getRow(),Wall.HORIZONTAL,currentTurn,setting)).isValid()) {
    nextMove=next;
  }
 else {
    for (int i=tmp.getCol() - 3; i < tmp.getCol() + 3 && exit == false; i++) {
      for (int j=tmp.getRow() - 3; j < tmp.getRow() + 3 && exit == false; j++) {
        tmp=new SquareImpl(i,j);
        if ((next=new PlaceWallImpl(tmp.getCol(),tmp.getRow(),Wall.HORIZONTAL,currentTurn,setting)).isValid()) {
          nextMove=next;
          exit=true;
        }
 else         if ((next=new PlaceWallImpl(tmp.getCol(),tmp.getRow(),Wall.VERTICAL,currentTurn,setting)).isValid()) {
          nextMove=next;
          exit=true;
        }
      }
    }
  }
  if (nextMove == null) {
    retVal=false;
  }
  return retVal;
}

Fixed version (ground truth):
private boolean wallMove(){
  Player p2=currentTurn.getOpponent();
  Square tmp=setting.getPawn(p2,setting).getSquare();
  Square rightS=new SquareImpl(tmp.getCol() - 1,tmp.getRow());
  PlaceWallImpl next=null;
  boolean exit=false;
  boolean retVal=true;
  if ((next=new PlaceWallImpl(tmp.getCol(),tmp.getRow() - 1,Wall.HORIZONTAL,currentTurn,setting)).isValid()) {
    nextMove=next;
  }
 else   if ((next=new PlaceWallImpl(tmp.getCol(),tmp.getRow(),Wall.VERTICAL,currentTurn,setting)).isValid()) {
    nextMove=next;
  }
 else   if ((next=new PlaceWallImpl(rightS.getCol() - 1,rightS.getRow(),Wall.VERTICAL,currentTurn,setting)).isValid()) {
    nextMove=next;
  }
 else {
    for (int i=tmp.getCol() - 3; i < tmp.getCol() + 3 && exit == false; i++) {
      for (int j=tmp.getRow() - 3; j < tmp.getRow() + 3 && exit == false; j++) {
        tmp=new SquareImpl(i,j);
        if ((next=new PlaceWallImpl(tmp.getCol(),tmp.getRow(),Wall.HORIZONTAL,currentTurn,setting)).isValid()) {
          nextMove=next;
          exit=true;
        }
 else         if ((next=new PlaceWallImpl(tmp.getCol(),tmp.getRow(),Wall.VERTICAL,currentTurn,setting)).isValid()) {
          nextMove=next;
          exit=true;
        }
      }
    }
  }
  if (nextMove == null) {
    retVal=false;
  }
  return retVal;
}
Program: 181087
Project: 181087
Buggy source:
@Override public boolean isValid(){
  boolean valid=true;
  Wall test=new WallImpl(new SquareImpl(tentative.topLeft().getCol(),tentative.topLeft().getRow()),tentative.getDirection());
  boolean direction=tentative.getDirection();
  if (direction == Wall.HORIZONTAL) {
    direction=Wall.VERTICAL;
  }
 else {
    direction=Wall.HORIZONTAL;
  }
  Wall opposite=new WallImpl(new SquareImpl(tentative.topLeft().getCol(),tentative.topLeft().getRow()),direction);
  if (setting.getPawn(owner,setting).getOwner().wallCount() <= 0) {
    valid=false;
  }
  if (tentative.topLeft().getCol() < 0) {
    valid=false;
  }
 else   if (tentative.topLeft().getRow() < 0) {
    valid=false;
  }
 else   if (tentative.topLeft().getCol() > 8) {
    valid=false;
  }
 else   if (tentative.topLeft().getRow() > 8) {
    valid=false;
  }
 else   if (setting.containsWall(test) == true) {
    valid=false;
  }
 else   if (setting.containsWall(opposite) == true) {
    valid=false;
  }
 else {
    setting.addWall(tentative);
    if (setting.pathToGoal(setting.getPawn(owner,setting)) == false) {
      valid=false;
    }
 else     if (setting.pathToGoal(setting.getPawn(owner.getOpponent(),setting)) == false) {
      valid=false;
    }
    setting.removeWall(tentative);
  }
  return valid;
}

Fixed version (ground truth):
@Override public boolean isValid(){
  boolean valid=true;
  Wall test=new WallImpl(new SquareImpl(tentative.topLeft().getCol(),tentative.topLeft().getRow()),tentative.getDirection());
  boolean direction=tentative.getDirection();
  if (direction == Wall.HORIZONTAL) {
    direction=Wall.VERTICAL;
  }
 else {
    direction=Wall.HORIZONTAL;
  }
  Wall opposite=new WallImpl(new SquareImpl(tentative.topLeft().getCol(),tentative.topLeft().getRow()),direction);
  if (setting.getPawn(owner,setting).getOwner().wallCount() <= 0) {
    valid=false;
  }
  if (tentative.topLeft().getCol() < 0) {
    valid=false;
  }
 else   if (tentative.topLeft().getRow() < 0) {
    valid=false;
  }
 else   if (tentative.topLeft().getRow() > 7) {
    valid=false;
  }
 else   if (tentative.topLeft().getCol() > 7) {
    valid=false;
  }
 else   if (tentative.topLeft().getRow() > 7) {
    valid=false;
  }
 else   if (setting.containsWall(test) == true) {
    valid=false;
  }
 else   if (setting.containsWall(opposite) == true) {
    valid=false;
  }
 else {
    setting.addWall(tentative);
    if (setting.pathToGoal(setting.getPawn(owner,setting)) == false) {
      valid=false;
    }
 else     if (setting.pathToGoal(setting.getPawn(owner.getOpponent(),setting)) == false) {
      valid=false;
    }
    setting.removeWall(tentative);
  }
  return valid;
}
Program: 181088
Project: 181088
Buggy source:
/** 
 * Searches for a path from a pawn to said pawn's goal.
 * @param pawn the pawn from which to search for a path to a goal
 * @return True iff there is a path from the pawn to its goal
 */
public boolean pathToGoal(Pawn pawn){
  assert(pawns.contains(pawn));
  HashSet<Square> seen=new HashSet<Square>(ROWS * COLS);
  int goalRow;
  if (pawn.getOwner().goalEnd() == Player.BOTTOM) {
    goalRow=0;
  }
 else {
    goalRow=Board.ROWS - 1;
  }
  return localPathToGoal(pawn.getSquare(),seen,goalRow);
}

Fixed version (ground truth):
/** 
 * Searches for a path from a pawn to said pawn's goal.
 * @param pawn the pawn from which to search for a path to a goal
 * @return True iff there is a path from the pawn to its goal
 */
public boolean pathToGoal(Pawn pawn){
  assert(pawns.contains(pawn));
  HashSet<Square> seen=new HashSet<Square>();
  int goalRow;
  if (pawn.getOwner().goalEnd() == Player.BOTTOM) {
    goalRow=0;
  }
 else {
    goalRow=Board.ROWS - 1;
  }
  return localPathToGoal(pawn.getSquare(),seen,goalRow);
}
Program: 181089
Project: 181089
Buggy source:
/** 
 * This is a helper function used by pathToGoal. It recursively checks neighbors until it finds a goal or all connected squares are searched.
 * @param current The square currently being visited
 * @param seen A hash set of squares that have been visited
 * @param goalRow The number of the row that we are trying to get to
 * @return True iff there is a path from current to the goal row
 */
private boolean localPathToGoal(Square current,HashSet<Square> seen,int goalRow){
  int row=current.getRow();
  int col=current.getCol();
  boolean found=(row == goalRow);
  if (!found) {
    seen.add(current);
    Square left=possibleSquare(col - 1,row);
    Square right=possibleSquare(col + 1,row);
    Square up=possibleSquare(col,row + 1);
    Square down=possibleSquare(col,row - 1);
    if (left != null && !seen.contains(left) && !wallBetween(current,left)) {
      found=localPathToGoal(left,seen,goalRow);
    }
    if (!found && right != null && !seen.contains(right) && !wallBetween(current,right)) {
      found=localPathToGoal(right,seen,goalRow);
    }
    if (!found && up != null && !seen.contains(up) && !wallBetween(current,up)) {
      found=localPathToGoal(up,seen,goalRow);
    }
    if (!found && down != null && !seen.contains(down) && !wallBetween(current,down)) {
      found=localPathToGoal(down,seen,goalRow);
    }
  }
  return found;
}

Fixed version (ground truth):
/** 
 * This is a helper function used by pathToGoal. It recursively checks neighbors until it finds a goal or all connected squares are searched.
 * @param current The square currently being visited
 * @param seen A hash set of squares that have been visited
 * @param goalRow The number of the row that we are trying to get to
 * @return True iff there is a path from current to the goal row
 */
private boolean localPathToGoal(Square current,HashSet<Square> seen,int goalRow){
  int row=current.getRow();
  int col=current.getCol();
  boolean found=(row == goalRow);
  if (!found) {
    seen.add(current);
    Square left=possibleSquare(col - 1,row);
    Square right=possibleSquare(col + 1,row);
    Square up=possibleSquare(col,row + 1);
    Square down=possibleSquare(col,row - 1);
    for (    Square s : seen) {
      System.out.print(s + "String_Node_Str");
    }
    System.out.println("String_Node_Str");
    if (left != null && !seen.contains(left) && !wallBetween(current,left)) {
      found=localPathToGoal(left,seen,goalRow);
    }
    boolean test=seen.contains(right);
    if (!found && right != null && !seen.contains(right) && !wallBetween(current,right)) {
      found=localPathToGoal(right,seen,goalRow);
    }
    if (!found && up != null && !seen.contains(up) && !wallBetween(current,up)) {
      found=localPathToGoal(up,seen,goalRow);
    }
    if (!found && down != null && !seen.contains(down) && !wallBetween(current,down)) {
      found=localPathToGoal(down,seen,goalRow);
    }
  }
  return found;
}
Program: 181090
Project: 181090
Buggy source:
/** 
 * Two squares are equal if they have the same row and column
 * @param s the Square being compared with this square
 * @return True iff the two squares are equal
 */
public boolean equals(Square s){
  return this.getRow() == s.getRow() && this.getCol() == s.getCol();
}

Fixed version (ground truth):
/** 
 * Two squares are equal if they have the same row and column
 * @param s the Square being compared with this square
 * @return True iff the two squares are equal
 */
@Override public boolean equals(Object o){
  Square s=(Square)o;
  return this.getRow() == s.getRow() && this.getCol() == s.getCol();
}
Program: 181092
Project: 181092
Buggy source:
@Override public void play(){
}

Fixed version (ground truth):
@Override public void play(){
  Player current=players._1();
  Pair<Pawn> pawns=new PairImpl<Pawn>(new PawnImpl(new SquareImpl(4,8),players._1()),new PawnImpl(new SquareImpl(4,0),players._2()));
  Board gameBoard=new BoardImpl(pawns);
  MoveParser parser=new MoveParserImpl();
  GenericMove nextMove;
  while (!isOver()) {
    System.out.println(gameBoard.toString());
    if (current.equals(players._1())) {
      System.out.println("String_Node_Str" + current.getName() + "String_Node_Str");
    }
 else {
      System.out.println("String_Node_Str" + current.getName() + "String_Node_Str");
    }
    nextMove=parser.scanMove(current,gameBoard);
    if (nextMove == null) {
      System.out.println("String_Node_Str");
    }
 else {
      moves.add(nextMove);
      if (nextMove.isValid()) {
        nextMove.makeMove();
        current=current.getOpponent();
      }
 else {
        System.out.println("String_Node_Str");
      }
    }
  }
}