nus-yam/ex-repair huggingface dataset:
Program: 152552
Project: 152552
Buggy source:
/** 
 * Inserts an item in the data table
 * @param values the values for the new row
 * @return the row ID of the newly created row
 */
private long insertData(ContentValues values,boolean markRawContactAsDirty){
  int aggregationMode=RawContacts.AGGREGATION_MODE_DISABLED;
  long id=0;
  mValues.clear();
  mValues.putAll(values);
  long rawContactId=mValues.getAsLong(Data.RAW_CONTACT_ID);
  final String packageName=mValues.getAsString(Data.RES_PACKAGE);
  if (packageName != null) {
    mValues.put(DataColumns.PACKAGE_ID,mOpenHelper.getPackageId(packageName));
  }
  mValues.remove(Data.RES_PACKAGE);
  final String mimeType=mValues.getAsString(Data.MIMETYPE);
  if (TextUtils.isEmpty(mimeType)) {
    throw new IllegalArgumentException(Data.MIMETYPE + "String_Node_Str");
  }
  mValues.put(DataColumns.MIMETYPE_ID,mOpenHelper.getMimeTypeId(mimeType));
  mValues.remove(Data.MIMETYPE);
  id=getDataRowHandler(mimeType).insert(mDb,rawContactId,mValues);
  if (markRawContactAsDirty) {
    setRawContactDirty(rawContactId);
  }
  triggerAggregation(rawContactId);
  return id;
}

Fixed version (ground truth):
/** 
 * Inserts an item in the data table
 * @param values the values for the new row
 * @return the row ID of the newly created row
 */
private long insertData(ContentValues values,boolean markRawContactAsDirty){
  long id=0;
  mValues.clear();
  mValues.putAll(values);
  long rawContactId=mValues.getAsLong(Data.RAW_CONTACT_ID);
  final String packageName=mValues.getAsString(Data.RES_PACKAGE);
  if (packageName != null) {
    mValues.put(DataColumns.PACKAGE_ID,mOpenHelper.getPackageId(packageName));
  }
  mValues.remove(Data.RES_PACKAGE);
  final String mimeType=mValues.getAsString(Data.MIMETYPE);
  if (TextUtils.isEmpty(mimeType)) {
    throw new IllegalArgumentException(Data.MIMETYPE + "String_Node_Str");
  }
  mValues.put(DataColumns.MIMETYPE_ID,mOpenHelper.getMimeTypeId(mimeType));
  mValues.remove(Data.MIMETYPE);
  id=getDataRowHandler(mimeType).insert(mDb,rawContactId,mValues);
  if (markRawContactAsDirty) {
    setRawContactDirty(rawContactId);
  }
  triggerAggregation(rawContactId);
  return id;
}
Program: 152554
Project: 152554
Buggy source:
/** 
 * Schedules an aggregation pass after a short delay.
 */
public synchronized void schedule(){
switch (mStatus) {
case STATUS_STAND_BY:
{
      mInitialRequestTimestamp=currentTime();
      mStatus=STATUS_SCHEDULED;
      runDelayed();
      break;
    }
case STATUS_SCHEDULED:
{
    if (currentTime() - mInitialRequestTimestamp < MAX_AGGREGATION_DELAY) {
      runDelayed();
    }
    break;
  }
case STATUS_RUNNING:
{
  if (currentTime() - mInitialRequestTimestamp < MAX_AGGREGATION_DELAY) {
    mAggregator.interrupt();
  }
  mRescheduleWhenComplete=true;
  break;
}
}
}

Fixed version (ground truth):
/** 
 * Schedules an aggregation pass after a short delay.
 */
public synchronized void schedule(){
switch (mStatus) {
case STATUS_STAND_BY:
{
      mInitialRequestTimestamp=currentTime();
      mStatus=STATUS_SCHEDULED;
      runDelayed();
      break;
    }
case STATUS_INTERRUPTED:
{
    mStatus=STATUS_SCHEDULED;
    runDelayed();
    break;
  }
case STATUS_SCHEDULED:
{
  if (currentTime() - mInitialRequestTimestamp < MAX_AGGREGATION_DELAY) {
    runDelayed();
  }
  break;
}
case STATUS_RUNNING:
{
if (currentTime() - mInitialRequestTimestamp < MAX_AGGREGATION_DELAY) {
  mAggregator.interrupt();
  mStatus=STATUS_INTERRUPTED;
}
mRescheduleWhenComplete=true;
break;
}
}
}
Program: 152555
Project: 152555
Buggy source:
/** 
 * Called just before an aggregation pass begins.
 */
public void run(){
synchronized (this) {
    mStatus=STATUS_RUNNING;
    mRescheduleWhenComplete=false;
  }
  try {
    mAggregator.run();
  }
  finally {
synchronized (this) {
      mStatus=STATUS_STAND_BY;
      mInitialRequestTimestamp=0;
      if (mRescheduleWhenComplete) {
        mRescheduleWhenComplete=false;
        schedule();
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Called just before an aggregation pass begins.
 */
public void run(){
synchronized (this) {
    mStatus=STATUS_RUNNING;
    mRescheduleWhenComplete=false;
  }
  try {
    mAggregator.run();
  }
  finally {
synchronized (this) {
      if (mStatus == STATUS_RUNNING) {
        mStatus=STATUS_STAND_BY;
      }
      if (mRescheduleWhenComplete) {
        mRescheduleWhenComplete=false;
        schedule();
      }
    }
  }
}
Program: 152556
Project: 152556
Buggy source:
public void importContacts() throws Exception {
  SQLiteDatabase sourceDb=null;
  try {
    String path=mContext.getDatabasePath(DATABASE_NAME).getPath();
    sourceDb=SQLiteDatabase.openDatabase(path,null,SQLiteDatabase.OPEN_READONLY);
    int version=sourceDb.getVersion();
    if (version < 78) {
      return;
    }
    Log.w(TAG,"String_Node_Str" + path);
    if (version < 80) {
      mPhoneticNameAvailable=false;
    }
    mContactsProvider.wipeData();
    importGroups(sourceDb);
    importPeople(sourceDb);
    importOrganizations(sourceDb);
    importPhones(sourceDb);
    importContactMethods(sourceDb);
    importPhotos(sourceDb);
    importGroupMemberships(sourceDb);
    importCalls(sourceDb);
    importDeletedPeople(sourceDb);
    Log.w(TAG,"String_Node_Str");
  }
  finally {
    if (sourceDb != null)     sourceDb.close();
  }
}

Fixed version (ground truth):
public void importContacts() throws Exception {
  SQLiteDatabase sourceDb=null;
  try {
    String path=mContext.getDatabasePath(DATABASE_NAME).getPath();
    try {
      sourceDb=SQLiteDatabase.openDatabase(path,null,SQLiteDatabase.OPEN_READONLY);
    }
 catch (    SQLiteException e) {
      return;
    }
    int version=sourceDb.getVersion();
    if (version < 78) {
      return;
    }
    Log.w(TAG,"String_Node_Str" + path);
    if (version < 80) {
      mPhoneticNameAvailable=false;
    }
    mContactsProvider.wipeData();
    importGroups(sourceDb);
    importPeople(sourceDb);
    importOrganizations(sourceDb);
    importPhones(sourceDb);
    importContactMethods(sourceDb);
    importPhotos(sourceDb);
    importGroupMemberships(sourceDb);
    importCalls(sourceDb);
    importDeletedPeople(sourceDb);
    Log.w(TAG,"String_Node_Str");
  }
  finally {
    if (sourceDb != null)     sourceDb.close();
  }
}
Program: 152557
Project: 152557
Buggy source:
/** 
 * Computes scores for contacts that have matching data rows.
 */
private void updateMatchScoresBasedOnDataMatches(SQLiteDatabase db,long rawContactId,int mode,MatchCandidateList candidates,ContactMatcher matcher){
  final Cursor c=db.query(Tables.DATA_JOIN_MIMETYPE_RAW_CONTACTS,DATA_JOIN_MIMETYPE_COLUMNS,Data.RAW_CONTACT_ID + "String_Node_Str" + rawContactId+ "String_Node_Str"+ MIMETYPE_SELECTION_IN_CLAUSE+ "String_Node_Str",null,null,null,null);
  try {
    while (c.moveToNext()) {
      String mimeType=c.getString(COL_MIMETYPE);
      String data1=c.getString(COL_DATA1);
      String data2=c.getString(COL_DATA2);
      if (mimeType.equals(CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE)) {
        addMatchCandidatesStructuredName(data1,data2,mode,candidates);
      }
 else       if (mimeType.equals(CommonDataKinds.Email.CONTENT_ITEM_TYPE)) {
        addMatchCandidatesEmail(data2,mode,candidates);
        lookupEmailMatches(db,data2,matcher);
      }
 else       if (mimeType.equals(CommonDataKinds.Phone.CONTENT_ITEM_TYPE)) {
        lookupPhoneMatches(db,data2,matcher);
      }
 else       if (mimeType.equals(CommonDataKinds.Nickname.CONTENT_ITEM_TYPE)) {
        addMatchCandidatesNickname(data2,mode,candidates);
        lookupNicknameMatches(db,data2,matcher);
      }
    }
  }
  finally {
    c.close();
  }
  lookupNameMatches(db,candidates,matcher);
  if (mode == MODE_SUGGESTIONS) {
    lookupApproximateNameMatches(db,candidates,matcher);
  }
}

Fixed version (ground truth):
/** 
 * Computes scores for contacts that have matching data rows.
 */
private void updateMatchScoresBasedOnDataMatches(SQLiteDatabase db,long rawContactId,int mode,MatchCandidateList candidates,ContactMatcher matcher){
  final Cursor c=db.query(Tables.DATA_JOIN_MIMETYPE_RAW_CONTACTS,DATA_JOIN_MIMETYPE_COLUMNS,Data.RAW_CONTACT_ID + "String_Node_Str" + rawContactId+ "String_Node_Str"+ MIMETYPE_SELECTION_IN_CLAUSE+ "String_Node_Str",null,null,null,null);
  try {
    while (c.moveToNext()) {
      String mimeType=c.getString(COL_MIMETYPE);
      String data1=c.getString(COL_DATA1);
      String data2=c.getString(COL_DATA2);
      if (mimeType.equals(CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE)) {
        addMatchCandidatesStructuredName(data1,data2,mode,candidates);
      }
 else       if (mimeType.equals(CommonDataKinds.Email.CONTENT_ITEM_TYPE)) {
        if (!TextUtils.isEmpty(data2)) {
          addMatchCandidatesEmail(data2,mode,candidates);
          lookupEmailMatches(db,data2,matcher);
        }
      }
 else       if (mimeType.equals(CommonDataKinds.Phone.CONTENT_ITEM_TYPE)) {
        if (!TextUtils.isEmpty(data2)) {
          lookupPhoneMatches(db,data2,matcher);
        }
      }
 else       if (mimeType.equals(CommonDataKinds.Nickname.CONTENT_ITEM_TYPE)) {
        if (!TextUtils.isEmpty(data2)) {
          addMatchCandidatesNickname(data2,mode,candidates);
          lookupNicknameMatches(db,data2,matcher);
        }
      }
    }
  }
  finally {
    c.close();
  }
  lookupNameMatches(db,candidates,matcher);
  if (mode == MODE_SUGGESTIONS) {
    lookupApproximateNameMatches(db,candidates,matcher);
  }
}
Program: 152560
Project: 152560
Buggy source:
@Override public String getType(Uri url){
  int match=sURIMatcher.match(url);
switch (match) {
case EXTENSIONS:
case PEOPLE_EXTENSIONS:
    return Extensions.CONTENT_TYPE;
case EXTENSIONS_ID:
case PEOPLE_EXTENSIONS_ID:
  return Extensions.CONTENT_ITEM_TYPE;
case PEOPLE:
return "String_Node_Str";
case PEOPLE_ID:
return "String_Node_Str";
case PEOPLE_PHONES:
return "String_Node_Str";
case PEOPLE_PHONES_ID:
return "String_Node_Str";
case PEOPLE_CONTACTMETHODS:
return "String_Node_Str";
case PEOPLE_CONTACTMETHODS_ID:
return getContactMethodType(url);
case PHONES:
return "String_Node_Str";
case PHONES_ID:
return "String_Node_Str";
case PHONES_FILTER:
case PHONES_FILTER_NAME:
case PHONES_MOBILE_FILTER_NAME:
return "String_Node_Str";
case PHOTOS_ID:
return "String_Node_Str";
case PHOTOS:
return "String_Node_Str";
case PEOPLE_PHOTO:
return "String_Node_Str";
case CONTACTMETHODS:
return "String_Node_Str";
case CONTACTMETHODS_ID:
return getContactMethodType(url);
case CONTACTMETHODS_EMAIL:
case CONTACTMETHODS_EMAIL_FILTER:
return "String_Node_Str";
case CALLS:
return "String_Node_Str";
case CALLS_ID:
return "String_Node_Str";
case ORGANIZATIONS:
return "String_Node_Str";
case ORGANIZATIONS_ID:
return "String_Node_Str";
case CALLS_FILTER:
return "String_Node_Str";
case SEARCH_SUGGESTIONS:
return SearchManager.SUGGEST_MIME_TYPE;
case SEARCH_SHORTCUT:
return SearchManager.SHORTCUT_MIME_TYPE;
default :
throw new IllegalArgumentException("String_Node_Str");
}
}

Fixed version (ground truth):
@Override public String getType(Uri url){
  int match=sURIMatcher.match(url);
switch (match) {
case EXTENSIONS:
case PEOPLE_EXTENSIONS:
    return Extensions.CONTENT_TYPE;
case EXTENSIONS_ID:
case PEOPLE_EXTENSIONS_ID:
  return Extensions.CONTENT_ITEM_TYPE;
case PEOPLE:
return "String_Node_Str";
case PEOPLE_ID:
return "String_Node_Str";
case PEOPLE_PHONES:
return "String_Node_Str";
case PEOPLE_PHONES_ID:
return "String_Node_Str";
case PEOPLE_CONTACTMETHODS:
return "String_Node_Str";
case PEOPLE_CONTACTMETHODS_ID:
return getContactMethodType(url);
case PHONES:
return "String_Node_Str";
case PHONES_ID:
return "String_Node_Str";
case PHONES_FILTER:
case PHONES_FILTER_NAME:
case PHONES_MOBILE_FILTER_NAME:
return "String_Node_Str";
case PHOTOS_ID:
return "String_Node_Str";
case PHOTOS:
return "String_Node_Str";
case PEOPLE_PHOTO:
return "String_Node_Str";
case PEOPLE_PHOTO_DATA:
return "String_Node_Str";
case CONTACTMETHODS:
return "String_Node_Str";
case CONTACTMETHODS_ID:
return getContactMethodType(url);
case CONTACTMETHODS_EMAIL:
case CONTACTMETHODS_EMAIL_FILTER:
return "String_Node_Str";
case CALLS:
return "String_Node_Str";
case CALLS_ID:
return "String_Node_Str";
case ORGANIZATIONS:
return "String_Node_Str";
case ORGANIZATIONS_ID:
return "String_Node_Str";
case CALLS_FILTER:
return "String_Node_Str";
case SEARCH_SUGGESTIONS:
return SearchManager.SUGGEST_MIME_TYPE;
case SEARCH_SHORTCUT:
return SearchManager.SHORTCUT_MIME_TYPE;
default :
throw new IllegalArgumentException("String_Node_Str");
}
}
Program: 152561
Project: 152561
Buggy source:
public ContactsProvider(){
  super(DATABASE_NAME,DATABASE_VERSION,Contacts.CONTENT_URI);
}

Fixed version (ground truth):
public ContactsProvider(){
  super(DATABASE_NAME,DATABASE_VERSION,Contacts.CONTENT_URI);
  mSearchSuggestionLanguage=Locale.getDefault().getLanguage();
  mSearchSuggestionsProjectionMap=new HashMap<String,String>();
  updateSuggestColumnTexts();
  mSearchSuggestionsProjectionMap.put(SearchManager.SUGGEST_COLUMN_ICON_1,"String_Node_Str" + Photos.DATA + "String_Node_Str"+ "String_Node_Str"+ People.CONTENT_URI+ "String_Node_Str"+ "String_Node_Str"+ Photos.CONTENT_DIRECTORY+ "String_Node_Str"+ "String_Node_Str"+ com.android.internal.R.drawable.ic_contact_picture+ "String_Node_Str"+ SearchManager.SUGGEST_COLUMN_ICON_1);
  mSearchSuggestionsProjectionMap.put(SearchManager.SUGGEST_COLUMN_ICON_2,PRESENCE_ICON_SQL + "String_Node_Str" + SearchManager.SUGGEST_COLUMN_ICON_2);
  mSearchSuggestionsProjectionMap.put(SearchManager.SUGGEST_COLUMN_INTENT_DATA_ID,"String_Node_Str" + SearchManager.SUGGEST_COLUMN_INTENT_DATA_ID);
  mSearchSuggestionsProjectionMap.put(SearchManager.SUGGEST_COLUMN_SHORTCUT_ID,"String_Node_Str" + SearchManager.SUGGEST_COLUMN_SHORTCUT_ID);
  mSearchSuggestionsProjectionMap.put(People._ID,"String_Node_Str" + People._ID);
}
Program: 152563
Project: 152563
Buggy source:
/** 
 * Prepare the walk action <p> This can be used to load required data for the walk action, e.g. all tags.
 */
public void prepare() throws GitRepositoryException {
}

Fixed version (ground truth):
/** 
 * Prepare the walk action <p> This can be used to load required data for the walk action, e.g. all tags.
 * @throws GitRepositoryException if an error occurs during the preparation
 */
public void prepare() throws GitRepositoryException {
}
Program: 152564
Project: 152564
Buggy source:
/** 
 * Runs the given action for all commits reachable from the current  {@code HEAD} commit
 * @param action The action to execute for each commit found
 * @throws GitRepositoryException if an error occurs during walking throughthe commits
 */
<T extends CommitWalkAction>T walkCommits(T action) throws GitRepositoryException ;

Fixed version (ground truth):
/** 
 * Runs the given action for all commits reachable from the current  {@code HEAD} commit
 * @param action The action to execute for each commit found
 * @param < T > The action’s type
 * @return The action itself
 * @throws GitRepositoryException if an error occurs during walking throughthe commits
 */
<T extends CommitWalkAction>T walkCommits(T action) throws GitRepositoryException ;
Program: 152565
Project: 152565
Buggy source:
/** 
 * Load tag meta data
 */
void load(GitRepository repository) throws GitRepositoryException ;

Fixed version (ground truth):
/** 
 * Load tag meta data
 * @param repository The repository to load information from
 * @throws GitRepositoryException if tags cannot be loaded
 */
void load(GitRepository repository) throws GitRepositoryException ;
Program: 152566
Project: 152566
Buggy source:
/** 
 * Initializes a JGit Repository object for further reference
 * @see GitRepository
 * @throws GitRepositoryException if retrieving information from the Gitrepository fails
 */
protected GitRepository initRepository() throws GitRepositoryException {
  GitRepository repository=new JGitRepository(baseDir,gitDir);
  repository.check();
  repository.setHeadRef(head);
  return repository;
}

Fixed version (ground truth):
/** 
 * Initializes a JGit Repository object for further reference
 * @return The repository instance
 * @throws GitRepositoryException if retrieving information from the Gitrepository fails
 */
protected GitRepository initRepository() throws GitRepositoryException {
  GitRepository repository=new JGitRepository(baseDir,gitDir);
  repository.check();
  repository.setHeadRef(head);
  return repository;
}
Program: 152567
Project: 152567
Buggy source:
/** 
 * The actual implementation of the mojo <p> This is called internally by   {@link #init}.
 * @throws MavanagaiataMojoException if there is an error during execution
 */
protected abstract void run(GitRepository repository) throws MavanagaiataMojoException ;

Fixed version (ground truth):
/** 
 * The actual implementation of the mojo
 * @param repository The repository instance to use
 * @throws MavanagaiataMojoException if there is an error during execution
 */
protected abstract void run(GitRepository repository) throws MavanagaiataMojoException ;
Program: 152568
Project: 152568
Buggy source:
/** 
 * Creates a new print stream for the configured outputfile and encoding
 * @return A new print stream
 */
PrintStream createPrintStream() throws FileNotFoundException, UnsupportedEncodingException {
  return new PrintStream(getOutputFile(),encoding);
}

Fixed version (ground truth):
/** 
 * Creates a new print stream for the configured output file and encoding
 * @return A new print stream
 * @throws FileNotFoundException if the output file could not be found
 * @throws UnsupportedEncodingException if the encoding is not supported
 */
PrintStream createPrintStream() throws FileNotFoundException, UnsupportedEncodingException {
  return new PrintStream(getOutputFile(),encoding);
}
Program: 152569
Project: 152569
Buggy source:
/** 
 * Writes the (optional) footer and flushes the   {@code PrintStream} aftercalling the main mojo implementation
 * @see #writeOutput
 * @throws MavanagaiataMojoException if the output cannot be generated
 */
protected void generateOutput(GitRepository repository,PrintStream printStream) throws MavanagaiataMojoException {
  writeOutput(repository,printStream);
  if (footer.length() > 0) {
    SimpleDateFormat baseDateFormat=new SimpleDateFormat(dateFormat);
    printStream.println(String.format(footer,VersionHelper.getVersion(),baseDateFormat.format(new Date())));
  }
  printStream.flush();
}

Fixed version (ground truth):
/** 
 * Writes the (optional) footer and flushes the   {@code PrintStream} aftercalling the main mojo implementation
 * @param repository The repository the mojo is running in
 * @param printStream The stream the output should be printed to
 * @see #writeOutput
 * @throws MavanagaiataMojoException if the output cannot be generated
 */
protected void generateOutput(GitRepository repository,PrintStream printStream) throws MavanagaiataMojoException {
  writeOutput(repository,printStream);
  if (footer.length() > 0) {
    SimpleDateFormat baseDateFormat=new SimpleDateFormat(dateFormat);
    printStream.println(String.format(footer,VersionHelper.getVersion(),baseDateFormat.format(new Date())));
  }
  printStream.flush();
}
Program: 152570
Project: 152570
Buggy source:
/** 
 * Generates a link to the GitHub compare / commits view and inserts it into the changelog <p> If no current ref is provided, the generated text will link to the commits view, listing all commits of the latest tag or the whole branch. Otherwise the text will link to the compare view, listing all commits that are in the current ref, but not in the last one.
 * @param lastRef The last tag or branch in the changelog
 * @param currentRef The current tag or branch in the changelog
 * @param isBranch Whether the link is points to a branch
 */
protected void insertGitHubLink(PrintStream printStream,String lastRef,String currentRef,boolean isBranch){
  String url=String.format("String_Node_Str",this.gitHubUser,this.gitHubProject);
  if (currentRef == null) {
    url+=String.format("String_Node_Str",lastRef);
  }
 else {
    url+=String.format("String_Node_Str",lastRef,currentRef);
  }
  String linkText;
  if (isBranch) {
    if (currentRef == null) {
      linkText=String.format(this.gitHubBranchOnlyLinkFormat,lastRef,url);
    }
 else {
      linkText=String.format(this.gitHubBranchLinkFormat,currentRef,lastRef,url);
    }
  }
 else {
    String tagName=(currentRef == null) ? lastRef : currentRef;
    linkText=String.format(this.gitHubTagLinkFormat,tagName,url);
  }
  printStream.println(linkText);
}

Fixed version (ground truth):
/** 
 * Generates a link to the GitHub compare / commits view and inserts it into the changelog <p> If no current ref is provided, the generated text will link to the commits view, listing all commits of the latest tag or the whole branch. Otherwise the text will link to the compare view, listing all commits that are in the current ref, but not in the last one.
 * @param printStream The stream the output should be printed to
 * @param lastRef The last tag or branch in the changelog
 * @param currentRef The current tag or branch in the changelog
 * @param isBranch Whether the link is points to a branch
 */
protected void insertGitHubLink(PrintStream printStream,String lastRef,String currentRef,boolean isBranch){
  String url=String.format("String_Node_Str",this.gitHubUser,this.gitHubProject);
  if (currentRef == null) {
    url+=String.format("String_Node_Str",lastRef);
  }
 else {
    url+=String.format("String_Node_Str",lastRef,currentRef);
  }
  String linkText;
  if (isBranch) {
    if (currentRef == null) {
      linkText=String.format(this.gitHubBranchOnlyLinkFormat,lastRef,url);
    }
 else {
      linkText=String.format(this.gitHubBranchLinkFormat,currentRef,lastRef,url);
    }
  }
 else {
    String tagName=(currentRef == null) ? lastRef : currentRef;
    linkText=String.format(this.gitHubTagLinkFormat,tagName,url);
  }
  printStream.println(linkText);
}
Program: 152571
Project: 152571
Buggy source:
/** 
 * Creates a new exception for the given check failure type
 * @param type The type of failure
 */
CheckMojoException(Type type,String... args){
  super(getMessageForType(type,args),null);
  this.type=type;
}

Fixed version (ground truth):
/** 
 * Creates a new exception for the given check failure type
 * @param type The type of failure
 * @param args The arguments to integrate into the error message
 */
CheckMojoException(Type type,String... args){
  super(getMessageForType(type,args),null);
  this.type=type;
}
Program: 152572
Project: 152572
Buggy source:
@Test public void testErrors(){
  this.mojo.gitDir=null;
  try {
    this.mojo.initRepository();
    fail("String_Node_Str");
  }
 catch (  Exception e) {
    assertEquals(FileNotFoundException.class,e.getClass());
    assertEquals("String_Node_Str",e.getMessage());
  }
  this.mojo.gitDir=new File(System.getenv().get("String_Node_Str")).getAbsoluteFile();
  try {
    this.mojo.initRepository();
    fail("String_Node_Str");
  }
 catch (  Exception e) {
    assertEquals(FileNotFoundException.class,e.getClass());
    assertEquals(this.mojo.gitDir + "String_Node_Str",e.getMessage());
  }
  this.mojo.gitDir=new File("String_Node_Str");
  try {
    this.mojo.initRepository();
    fail("String_Node_Str");
  }
 catch (  Exception e) {
    assertEquals(FileNotFoundException.class,e.getClass());
    assertEquals(this.mojo.gitDir + "String_Node_Str",e.getMessage());
  }
  this.mojo.gitDir=new File("String_Node_Str");
  try {
    this.mojo.initRepository();
    fail("String_Node_Str");
  }
 catch (  Exception e) {
    assertEquals(IOException.class,e.getClass());
    assertEquals("String_Node_Str",e.getMessage());
  }
}

Fixed version (ground truth):
@Test public void testErrors(){
  this.mojo.gitDir=null;
  try {
    this.mojo.initRepository();
    fail("String_Node_Str");
  }
 catch (  Exception e) {
    assertEquals(FileNotFoundException.class,e.getClass());
    assertEquals("String_Node_Str",e.getMessage());
  }
  String home=System.getenv().get("String_Node_Str");
  if (home == null) {
    home=System.getenv().get("String_Node_Str") + System.getenv("String_Node_Str");
  }
  this.mojo.gitDir=new File(home).getAbsoluteFile();
  try {
    this.mojo.initRepository();
    fail("String_Node_Str");
  }
 catch (  Exception e) {
    assertEquals(FileNotFoundException.class,e.getClass());
    assertEquals(this.mojo.gitDir + "String_Node_Str",e.getMessage());
  }
  this.mojo.gitDir=new File("String_Node_Str");
  try {
    this.mojo.initRepository();
    fail("String_Node_Str");
  }
 catch (  Exception e) {
    assertEquals(FileNotFoundException.class,e.getClass());
    assertEquals(this.mojo.gitDir + "String_Node_Str",e.getMessage());
  }
  this.mojo.gitDir=new File("String_Node_Str");
  try {
    this.mojo.initRepository();
    fail("String_Node_Str");
  }
 catch (  Exception e) {
    assertEquals(IOException.class,e.getClass());
    assertEquals("String_Node_Str",e.getMessage());
  }
}
Program: 152574
Project: 152574
Buggy source:
public int compare(BufferedImage image1,BufferedImage image2){
  int area1=image1.getWidth() * image1.getHeight();
  int area2=image2.getWidth() * image2.getHeight();
  return area2 - area1;
}

Fixed version (ground truth):
public int compare(ImageName image1,ImageName image2){
  int area1=image1.image.getWidth() * image1.image.getHeight();
  int area2=image2.image.getWidth() * image2.image.getHeight();
  if (area1 != area2) {
    return area2 - area1;
  }
 else {
    return image1.name.compareTo(image2.name);
  }
}
Program: 152576
Project: 152576
Buggy source:
/** 
 * Instantiates a new psd descriptor.
 * @param stream the stream
 * @throws IOException Signals that an I/O exception has occurred.
 */
public PsdDescriptor(PsdInputStream stream) throws IOException {
  int nameLen=stream.readInt() * 2;
  stream.skipBytes(nameLen);
  classId=stream.readPsdString();
  int itemsCount=stream.readInt();
  logger.finest("String_Node_Str" + itemsCount);
  for (int i=0; i < itemsCount; i++) {
    String key=stream.readPsdString();
    logger.finest("String_Node_Str" + key);
    objects.put(key,PsdObjectBase.loadPsdObject(stream));
  }
}

Fixed version (ground truth):
/** 
 * Instantiates a new psd descriptor.
 * @param stream the stream
 * @throws IOException Signals that an I/O exception has occurred.
 */
public PsdDescriptor(PsdInputStream stream) throws IOException {
  int nameLen=stream.readInt() * 2;
  stream.skipBytes(nameLen);
  classId=stream.readPsdString();
  int itemsCount=stream.readInt();
  logger.finest("String_Node_Str" + itemsCount);
  for (int i=0; i < itemsCount; i++) {
    String key=stream.readPsdString().trim();
    logger.finest("String_Node_Str" + key);
    objects.put(key,PsdObjectBase.loadPsdObject(stream));
  }
}
Program: 152577
Project: 152577
Buggy source:
/** 
 * Read value.
 * @param stream the stream
 * @param level the level
 * @return the object
 * @throws IOException Signals that an I/O exception has occurred.
 */
private Object readValue(PsdInputStream stream,int level) throws IOException {
}

Fixed version (ground truth):
private Object readValue(PsdInputStream stream) throws IOException {
}
Program: 152578
Project: 152578
Buggy source:
/** 
 * Read map.
 * @param stream the stream
 * @param level the level
 * @return the map
 * @throws IOException Signals that an I/O exception has occurred.
 */
private Map<String,Object> readMap(PsdInputStream stream,int level) throws IOException {
}

Fixed version (ground truth):
private Map<String,Object> readMap(PsdInputStream stream) throws IOException {
}
Program: 152579
Project: 152579
Buggy source:
/** 
 * Skip string.
 * @param stream the stream
 * @param string the string
 * @throws IOException Signals that an I/O exception has occurred.
 */
private void skipString(PsdInputStream stream,String string) throws IOException {
}

Fixed version (ground truth):
private void skipString(PsdInputStream stream,String string) throws IOException {
}
Program: 152580
Project: 152580
Buggy source:
/** 
 * Instantiates a new psd text data.
 * @param stream the stream
 * @throws IOException Signals that an I/O exception has occurred.
 */
public PsdTextData(PsdInputStream stream) throws IOException {
}

Fixed version (ground truth):
/** 
 * Instantiates a new psd text data.
 * @param stream the stream
 * @throws IOException Signals that an I/O exception has occurred.
 */
public PsdTextData(PsdInputStream stream) throws IOException {
  int size=stream.readInt();
  int startPos=stream.getPos();
  if (true) {
    byte[] array=new byte[size];
    stream.read(array,0,size);
    ByteArrayInputStream byteStream=new ByteArrayInputStream(array);
    stream=new PsdInputStream(byteStream);
    for (int i=0; i < size; i++) {
      int b=array[i];
      if (b == 13 || b == 10) {
        System.out.println();
      }
 else       if (b == ' ') {
        System.out.print("String_Node_Str");
      }
 else       if (b == 9) {
        System.out.print('\t');
      }
 else       if (b < 32) {
        System.out.print(b);
      }
 else {
        System.out.print((char)b);
      }
    }
    System.out.println();
  }
  properties=readMap(stream);
}
Program: 152581
Project: 152581
Buggy source:
private static void battleSim(){
  RandomForPokemon gen=new RandomForPokemon();
  Trainer trainer1=new Trainer();
  trainer1.setLeadingPokemon(PokemonFactory.getPokemonAtLevel(mSpeciesArray[512],20));
  Trainer trainer2=new Trainer();
  trainer2.setLeadingPokemon(gen.randomPokemon(20));
  Battle battle=new Battle(trainer1,trainer2);
  battle.battleThread();
  retryQuestion();
}

Fixed version (ground truth):
private static void battleSim(){
  RandomForPokemon gen=new RandomForPokemon();
  Trainer trainer1=new Trainer();
  trainer1.setLeadingPokemon(gen.randomPokemon(20));
  Trainer trainer2=new Trainer();
  trainer2.setLeadingPokemon(gen.randomPokemon(20));
  Battle battle=new Battle(trainer1,trainer2);
  battle.battleThread();
  retryQuestion();
}
Program: 152583
Project: 152583
Buggy source:
public MoveExecutionThread(BattlePlayer attacker,BattlePlayer target,Move move,Battle battle){
  this.mAttacker=attacker;
  this.mTarget=target;
  this.mMove=move;
  this.mBattle=battle;
  this.mAttackerPokemon=mAttacker.getPokemon();
  this.mTargetPokemon=mTarget.getPokemon();
}

Fixed version (ground truth):
/** 
 */
public MoveExecutionThread(BattlePlayer attacker,BattlePlayer target,Move move,Battle battle){
  this.mAttacker=attacker;
  this.mTarget=target;
  this.mMove=move;
  this.mBattle=battle;
  this.mAttackerPokemon=mAttacker.getPokemon();
  this.mTargetPokemon=mTarget.getPokemon();
}
Program: 152584
Project: 152584
Buggy source:
public BattlePlayer getAttacker(){
  return mAttacker;
}

Fixed version (ground truth):
/** 
 */
public BattlePlayer getAttacker(){
  return mAttacker;
}
Program: 152585
Project: 152585
Buggy source:
public void standardMove(){
  dealDamage(accuracyCheck());
}

Fixed version (ground truth):
/** 
 */
public void standardMove(){
  dealDamage(accuracyCheck());
}
Program: 152586
Project: 152586
Buggy source:
public Ability getBattleAbility(){
  if (mAlteredAbility != Ability.NONE) {
    return mAlteredAbility;
  }
 else {
    return mAbility;
  }
}

Fixed version (ground truth):
public Ability getBattleAbility(){
  if (mAbilityIsActive) {
    if (mAlteredAbility != Ability.NONE) {
      return mAlteredAbility;
    }
 else {
      return mAbility;
    }
  }
 else {
    return Ability.NONE;
  }
}
Program: 152587
Project: 152587
Buggy source:
public AbilityClass(Pokemon pokemon){
  mAbility=pokemon.getAbility();
}

Fixed version (ground truth):
public AbilityClass(Pokemon pokemon){
  mAbility=pokemon.getTrueAbility();
}
Program: 152588
Project: 152588
Buggy source:
protected double getSpeedAbilityMod(BattlePlayer player){
  double sm=1;
  Pokemon pokemon=player.getPokemon();
  if (player.isGastroAcid()) {
    return sm;
  }
switch (pokemon.getAbility()) {
case CHLOROPHYLL:
    if (mWeather == Weather.SUNNY_DAY) {
      sm=2;
    }
  break;
case QUICK_FEET:
if (pokemon.getStatus() != NonVolatileStatusAilment.NONE) {
  sm=1.5;
}
break;
case SAND_RUSH:
if (mWeather == Weather.SANDSTORM) {
sm=2;
}
break;
case SLOW_START:
if (pokemon.getTurnsInBattle() <= 5) {
sm=0.5;
}
break;
case SWIFT_SWIM:
if (mWeather == Weather.RAIN_DANCE) {
sm=2;
}
break;
case UNBURDEN:
break;
}
return sm;
}

Fixed version (ground truth):
protected double getSpeedAbilityMod(BattlePlayer player){
  double sm=1;
  Pokemon pokemon=player.getPokemon();
  if (player.isGastroAcid()) {
    return sm;
  }
switch (pokemon.getBattleAbility()) {
case CHLOROPHYLL:
    if (mWeather == Weather.SUNNY_DAY) {
      sm=2;
    }
  break;
case QUICK_FEET:
if (pokemon.getStatus() != NonVolatileStatusAilment.NONE) {
  sm=1.5;
}
break;
case SAND_RUSH:
if (mWeather == Weather.SANDSTORM) {
sm=2;
}
break;
case SLOW_START:
if (pokemon.getTurnsInBattle() <= 5) {
sm=0.5;
}
break;
case SWIFT_SWIM:
if (mWeather == Weather.RAIN_DANCE) {
sm=2;
}
break;
case UNBURDEN:
break;
}
return sm;
}
Program: 152589
Project: 152589
Buggy source:
protected double getPayalyzeMod(Pokemon pokemon){
  if (pokemon.getStatus() == NonVolatileStatusAilment.PARALYZE && pokemon.getAbility() != Ability.QUICK_FEET) {
    return 0.25;
  }
 else {
    return 1;
  }
}

Fixed version (ground truth):
protected double getPayalyzeMod(Pokemon pokemon){
  if (pokemon.getStatus() == NonVolatileStatusAilment.PARALYZE && pokemon.getBattleAbility() != Ability.QUICK_FEET) {
    return 0.25;
  }
 else {
    return 1;
  }
}
Program: 152590
Project: 152590
Buggy source:
public BattlePlayer(Trainer trainer){
  this.mTrainer=trainer;
  mPokemon=mTrainer.getLeadingPokemon();
}

Fixed version (ground truth):
public BattlePlayer(Trainer trainer){
  this.mTrainer=trainer;
  mPokemon=mTrainer.getLeadingPokemon();
  mPokemon.initBattleAbility();
}
Program: 152591
Project: 152591
Buggy source:
private void MoveTargetId(int i){
  this.id=i;
}

Fixed version (ground truth):
private void MoveTargetId(int i){
  this.fId=i;
}
Program: 152594
Project: 152594
Buggy source:
private static int calcMod3(BattlePlayer playerAttacker,BattlePlayer playerDefender,double effectiveness){
  Pokemon attacker=playerAttacker.getPokemon();
  Pokemon defender=playerDefender.getPokemon();
  double mod3=1;
  double srf=1;
  double eb=1;
  double tl=1;
  double trb=1;
  if (defender.getAbility() == Ability.SOLID_ROCK || defender.getAbility() == Ability.FILTER) {
    srf=0.75;
  }
  if (attacker.getHeldItem() == Items.EXPERT_BELT && (effectiveness >= 2)) {
    eb=1.2;
  }
  if (effectiveness > 1 && attacker.getAbility() == Ability.TINTED_LENS) {
    tl=2;
  }
  if (defender.getHeldItem() <= 200 && defender.getHeldItem() >= 217) {
    trb=0.5;
  }
  mod3=srf * eb * tl* trb;
  return (int)mod3;
}

Fixed version (ground truth):
private static int calcMod3(BattlePlayer playerAttacker,BattlePlayer playerDefender,double effectiveness){
  Pokemon attacker=playerAttacker.getPokemon();
  Pokemon defender=playerDefender.getPokemon();
  double mod3=1;
  double srf=1;
  double eb=1;
  double tl=1;
  double trb=1;
  if (defender.hasAbility(Ability.SOLID_ROCK) || defender.hasAbility(Ability.FILTER)) {
    srf=0.75;
  }
  if (attacker.getHeldItem() == Items.EXPERT_BELT && (effectiveness >= 2)) {
    eb=1.2;
  }
  if (effectiveness > 1 && attacker.hasAbility(Ability.TINTED_LENS)) {
    tl=2;
  }
  if (defender.getHeldItem() <= 200 && defender.getHeldItem() >= 217) {
    trb=0.5;
  }
  mod3=srf * eb * tl* trb;
  return (int)mod3;
}
Program: 152596
Project: 152596
Buggy source:
private static int calcCritHit(BattlePlayer playerAttacker,BattlePlayer playerDefender){
  Pokemon attacker=playerAttacker.getPokemon();
  Pokemon defender=playerDefender.getPokemon();
  int critMult=1;
  if (defender.getAbility() == Ability.BATTLE_ARMOR) {
    return critMult;
  }
  Random generator=new Random();
  double ran=(double)generator.nextDouble() * 100;
  double chance=6.25;
  if (attacker.getAbility() == Ability.SUPER_LUCK) {
    chance=chance * 2;
  }
  if (defender.getAbility() == Ability.BATTLE_ARMOR || defender.getAbility() == Ability.SHELL_ARMOR) {
    ran=100;
  }
  if (ran <= chance) {
    critMult=2;
    if (attacker.getAbility() == Ability.SNIPER) {
      critMult=3;
    }
    playerDefender.setTookACrit(true);
  }
  return critMult;
}

Fixed version (ground truth):
private static int calcCritHit(BattlePlayer playerAttacker,BattlePlayer playerDefender){
  Pokemon attacker=playerAttacker.getPokemon();
  Pokemon defender=playerDefender.getPokemon();
  int critMult=1;
  if (defender.hasAbility(Ability.BATTLE_ARMOR)) {
    return critMult;
  }
  Random generator=new Random();
  double ran=(double)generator.nextDouble() * 100;
  double chance=6.25;
  if (attacker.hasAbility(Ability.SUPER_LUCK)) {
    chance=chance * 2;
  }
  if (defender.hasAbility(Ability.BATTLE_ARMOR) || defender.hasAbility(Ability.SHELL_ARMOR)) {
    ran=100;
  }
  if (ran <= chance) {
    critMult=2;
    if (attacker.hasAbility(Ability.SNIPER)) {
      critMult=3;
    }
    playerDefender.setTookACrit(true);
  }
  return critMult;
}
Program: 152597
Project: 152597
Buggy source:
private static void battleSim(){
  RandomForPokemon gen=new RandomForPokemon();
  Trainer trainer1=new Trainer();
  trainer1.setLeadingPokemon(gen.randomPokemon(10));
  Trainer trainer2=new Trainer();
  trainer2.setLeadingPokemon(gen.randomPokemon(10));
  Battle battle=new Battle(trainer1,trainer2);
  battle.battleThread();
  System.out.println("String_Node_Str");
  Scanner scan=new Scanner(System.in);
  String input=scan.nextLine();
  if (input.equals("String_Node_Str") || input.equals("String_Node_Str")) {
    battleSim();
  }
 else {
    System.out.println("String_Node_Str");
  }
}

Fixed version (ground truth):
private static void battleSim(){
  RandomForPokemon gen=new RandomForPokemon();
  Trainer trainer1=new Trainer();
  trainer1.setLeadingPokemon(gen.randomPokemon(20));
  Trainer trainer2=new Trainer();
  trainer2.setLeadingPokemon(gen.randomPokemon(20));
  Battle battle=new Battle(trainer1,trainer2);
  battle.battleThread();
  retryQuestion();
}
Program: 152598
Project: 152598
Buggy source:
private void applyAttackerStatChanges(){
}

Fixed version (ground truth):
private void applyAttackerStatChanges(){
  int[] statChanges=mMove.getMoveStatChanges();
  mAttackerPokemon.addStatChangeArray(statChanges);
}
Program: 152600
Project: 152600
Buggy source:
public void initBattleAbility(){
  if (mAbility != Ability.NONE) {
    mBattleAbility=new AbilityClass(this);
  }
 else {
    throw new IllegalArgumentException("String_Node_Str");
  }
}

Fixed version (ground truth):
public void initBattleAbility(){
  if (mAbility != Ability.NONE) {
    mBattleAbility=new AbilityClass(this);
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + mNickName + "String_Node_Str");
  }
}
Program: 152601
Project: 152601
Buggy source:
public boolean hasAbility(Ability ability){
  if (mAbility == ability) {
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
public boolean hasAbility(Ability ability){
  if (mBattleAbility.getBattleAbility() == ability) {
    return true;
  }
 else {
    return false;
  }
}
Program: 152602
Project: 152602
Buggy source:
public static double typeMath(Types moveType,Types defenderType1,Types defenderType2){
  if (defenderType1 == Types.NONE && defenderType2 == Types.NONE) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  double retValue=0.0;
  if (defenderType2 == Types.NONE) {
    retValue=typeMatrix[moveType.getId()][defenderType1.getId()];
  }
 else   if (defenderType1 == Types.NONE) {
    retValue=typeMatrix[moveType.getId()][defenderType2.getId()];
  }
 else {
    retValue=typeMatrix[moveType.getId()][defenderType1.getId()] * typeMatrix[moveType.getId()][defenderType2.getId()];
  }
  if (retValue > 1) {
    System.out.println("String_Node_Str");
  }
 else   if (retValue < 1) {
    System.out.println("String_Node_Str");
  }
  return retValue;
}

Fixed version (ground truth):
public static double typeMath(Types moveType,Types defenderType1,Types defenderType2){
  if (defenderType1 == Types.NONE && defenderType2 == Types.NONE) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  double retValue=0.0;
  if (defenderType2 == Types.NONE) {
    retValue=typeMatrix[moveType.getId() - 1][defenderType1.getId() - 1];
  }
 else   if (defenderType1 == Types.NONE) {
    retValue=typeMatrix[moveType.getId() - 1][defenderType2.getId() - 1];
  }
 else {
    retValue=typeMatrix[moveType.getId() - 1][defenderType1.getId() - 1] * typeMatrix[moveType.getId() - 1][defenderType2.getId() - 1];
  }
  if (retValue > 1) {
    System.out.println("String_Node_Str");
  }
 else   if (retValue < 1) {
    System.out.println("String_Node_Str");
  }
  return retValue;
}
Program: 152603
Project: 152603
Buggy source:
@Override private boolean round(){
  Move trainerMove=getTrainerMove(mActivePokemonTrainer);
  Move wildMove=getWildMove();
  int wildPriority=wildMove.getPriority(trainerMove);
  int trainerPriority=trainerMove.getPriority(wildMove);
  if (wildPriority > trainerPriority) {
    return executeMoves(mWildPokemon,wildMove,mActivePokemonTrainer,trainerMove);
  }
 else   if (trainerPriority > wildPriority) {
    return executeMoves(mActivePokemonTrainer,trainerMove,mWildPokemon,wildMove);
  }
 else   if (mActivePokemonTrainer == determineOrder(mActivePokemonTrainer,mWildPokemon)) {
    return executeMoves(mActivePokemonTrainer,trainerMove,mWildPokemon,wildMove);
  }
 else {
    return executeMoves(mWildPokemon,wildMove,mActivePokemonTrainer,trainerMove);
  }
}

Fixed version (ground truth):
@Override protected boolean round(){
  Move trainerMove=getTrainerMove(mActivePokemonTrainer);
  Move wildMove=getWildMove();
  int wildPriority=wildMove.getPriority(trainerMove);
  int trainerPriority=trainerMove.getPriority(wildMove);
  if (wildPriority > trainerPriority) {
    return executeMoves(mWildPokemon,wildMove,mActivePokemonTrainer,trainerMove);
  }
 else   if (trainerPriority > wildPriority) {
    return executeMoves(mActivePokemonTrainer,trainerMove,mWildPokemon,wildMove);
  }
 else   if (mActivePokemonTrainer == determineOrder(mActivePokemonTrainer,mWildPokemon)) {
    return executeMoves(mActivePokemonTrainer,trainerMove,mWildPokemon,wildMove);
  }
 else {
    return executeMoves(mWildPokemon,wildMove,mActivePokemonTrainer,trainerMove);
  }
}
Program: 152604
Project: 152604
Buggy source:
public static Stats getStat(int i){
  for (  Stats stat : Stats.values()) {
    if (i == stat.ordinal()) {
      return stat;
    }
  }
  return null;
}

Fixed version (ground truth):
public static ModdableBattleStats getStat(int i){
  for (  ModdableBattleStats stat : ModdableBattleStats.values()) {
    if (i == stat.ordinal()) {
      return stat;
    }
  }
  return ATTACK;
}
Program: 152606
Project: 152606
Buggy source:
public Pokemon(PokemonSpecies species){
  this.mNickName=species.getSpeciesName();
  this.mSpecies=species;
  this.mGender=Gender.GENDERLESS;
  mTypes[0]=species.getType(1);
  mTypes[1]=species.getType(2);
  Random generator=new Random();
  for (int i=0; i < mIVs.length; i++) {
    mIVs[i]=generator.nextInt(32);
  }
  for (int i=0; i < mEVs.length; i++) {
    mEVs[i]=0;
  }
  for (int i=0; i < mMoves.length; i++) {
    mMoves[i]=Main.mMoveArray[0];
  }
  this.mTurnsInBattle=0;
}

Fixed version (ground truth):
public Pokemon(PokemonSpecies species){
  this.mNickName=species.getSpeciesName();
  this.mSpecies=species;
  this.mGender=Gender.GENDERLESS;
  mTypes[0]=species.getType(1);
  mTypes[1]=species.getType(2);
  Random generator=new Random();
  int natureInt=generator.nextInt(25) + 1;
  mNature=Nature.getNature(natureInt);
  for (int i=0; i < mIVs.length; i++) {
    mIVs[i]=generator.nextInt(32);
  }
  for (int i=0; i < mEVs.length; i++) {
    mEVs[i]=0;
  }
  for (int i=0; i < mMoves.length; i++) {
    mMoves[i]=Main.mMoveArray[0];
  }
  this.mTurnsInBattle=0;
}
Program: 152607
Project: 152607
Buggy source:
private void Types(int id){
  this.id=id;
}

Fixed version (ground truth):
private void Types(int id,String name){
  this.id=id;
  this.name=name;
}
Program: 152608
Project: 152608
Buggy source:
public static double typeMath(Types moveType,Types defenderType1,Types defenderType2){
  return typeMatrix[moveType.id][defenderType1.id] * typeMatrix[moveType.id][defenderType2.id];
}

Fixed version (ground truth):
public static double typeMath(Types moveType,Types defenderType1,Types defenderType2){
  if (defenderType1 == Types.NONE && defenderType2 == Types.NONE) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  double retValue=0.0;
  if (defenderType2 == Types.NONE) {
    retValue=typeMatrix[moveType.id][defenderType1.id];
  }
 else   if (defenderType1 == Types.NONE) {
    retValue=typeMatrix[moveType.id][defenderType2.id];
  }
 else {
    retValue=typeMatrix[moveType.id][defenderType1.id] * typeMatrix[moveType.id][defenderType2.id];
  }
  return retValue;
}
Program: 152609
Project: 152609
Buggy source:
public static void main(String[] args){
  mSpeciesArray=PokemonSpeciesFactory.createSpeciesArray();
  mMoveArray=MoveFactory.createMoveArray();
  Random generator=new Random();
  int val=generator.nextInt(559) + 1;
  PokemonSpecies species=Main.mSpeciesArray[6];
  Pokemon wildPokemon=PokemonFactory.getPokemon(species);
  wildPokemon.setLevel(50);
  Move move=mMoveArray[53];
  move.setType(Types.FIRE);
  System.out.println("String_Node_Str" + wildPokemon.getNickName() + "String_Node_Str");
  System.out.println(move.getMoveName() + "String_Node_Str" + move.getBasePower()+ "String_Node_Str"+ move.getAccuracy());
  System.out.println(move.getMoveName() + "String_Node_Str" + move.getType()+ "String_Node_Str");
  PokemonSpecies mewtwo=mSpeciesArray[150];
  Pokemon otherPoke=PokemonFactory.getPokemon(mewtwo);
  otherPoke.setLevel(50);
  Trainer trainer=new Trainer();
  trainer.setPokemon1(wildPokemon);
  wildPokemon.setType1(Types.FIRE);
  wildPokemon.setType2(Types.FLYING);
  otherPoke.setType1(Types.PSYCHIC);
  WildBattle wildBattle=new WildBattle(trainer);
  wildBattle.executeMoves(wildPokemon,move,otherPoke,mMoveArray[1]);
}

Fixed version (ground truth):
public static void main(String[] args){
  mSpeciesArray=PokemonSpeciesFactory.createSpeciesArray();
  mMoveArray=MoveFactory.createMoveArray();
  Random generator=new Random();
  int val=generator.nextInt(559) + 1;
  PokemonSpecies species=Main.mSpeciesArray[6];
  Pokemon wildPokemon=PokemonFactory.getPokemon(species);
  wildPokemon.setLevel(50);
  Move move=mMoveArray[53];
  move.setType(Types.FIRE);
  System.out.println("String_Node_Str" + wildPokemon.getNickName() + "String_Node_Str");
  System.out.println(move.getMoveName() + "String_Node_Str" + move.getBasePower()+ "String_Node_Str"+ move.getAccuracy());
  System.out.println(move.getMoveName() + "String_Node_Str" + move.getType()+ "String_Node_Str");
  PokemonSpecies mewtwo=mSpeciesArray[150];
  Pokemon otherPoke=PokemonFactory.getPokemon(mewtwo);
  otherPoke.setLevel(50);
  Trainer trainer=new Trainer();
  trainer.setPokemon1(wildPokemon);
  wildPokemon.setType1(Types.FIRE);
  wildPokemon.setType2(Types.FLYING);
  otherPoke.setType1(Types.PSYCHIC);
  WildBattle wildBattle=new WildBattle(trainer);
  System.out.println("String_Node_Str" + otherPoke.getHPStat() + "String_Node_Str"+ otherPoke.getCurrentHP());
  wildBattle.executeMoves(wildPokemon,move,otherPoke,mMoveArray[1]);
}
Program: 152610
Project: 152610
Buggy source:
public void setLevel(int level){
  this.mLevel=level;
}

Fixed version (ground truth):
public void setLevel(int level){
  this.mLevel=level;
  PokemonFactory.respecStats(this,mSpecies);
}
Program: 152611
Project: 152611
Buggy source:
public void setAbility(Abilities ability){
  this.mAbility=ability;
}

Fixed version (ground truth):
public void setAbility(Abilities ability){
  this.mAbility=ability;
  PokemonFactory.respecStats(this,mSpecies);
}
Program: 152612
Project: 152612
Buggy source:
public void setSpecies(PokemonSpecies mSpecies){
  this.mSpecies=mSpecies;
}

Fixed version (ground truth):
public void setSpecies(PokemonSpecies species){
  this.mSpecies=species;
  PokemonFactory.respecStats(this,mSpecies);
}