nus-yam/ex-repair huggingface dataset:
Program: 179614
Project: 179614
Buggy source:
@Override public void onItemClick(AdapterView<?> arg0,View view,int itemNumber,long arg3){
  if (itemNumber < usersArray.size()) {
    User user=usersArray.get(itemNumber);
    if (user.getAdmin() == UserType.USER && (Boolean)view.getTag()) {
      Permission permission=usersAdapter.getUserIdToPermissionMap().get(user.getId());
      Intent intent=new Intent(mContext,PermissionModifyActivity.class);
      intent.putExtra(Constants.REPOSITORY,repository);
      intent.putExtra(Constants.USER,user);
      if (permission != null) {
        intent.putExtra(Constants.PERMISSION,permission);
      }
      startActivityForResult(intent,0);
    }
 else     if (user.getAdmin() != UserType.USER) {
      GUI.displayMonit(mContext,"String_Node_Str");
    }
 else {
      GUI.displayMonit(mContext,"String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@Override public void onItemClick(AdapterView<?> arg0,View view,int itemNumber,long arg3){
  User user=usersArray.get(itemNumber - 1);
  if (user.getAdmin() == UserType.USER && (Boolean)view.getTag()) {
    Permission permission=usersAdapter.getUserIdToPermissionMap().get(user.getId());
    Intent intent=new Intent(mContext,PermissionModifyActivity.class);
    intent.putExtra(Constants.REPOSITORY,repository);
    intent.putExtra(Constants.USER,user);
    if (permission != null) {
      intent.putExtra(Constants.PERMISSION,permission);
    }
    startActivityForResult(intent,0);
  }
 else   if (user.getAdmin() != UserType.USER) {
    GUI.displayMonit(mContext,"String_Node_Str");
  }
 else {
    GUI.displayMonit(mContext,"String_Node_Str");
  }
}
Program: 179616
Project: 179616
Buggy source:
public void testParseChangesets() throws IOException, XMLParserException {
  String testXml=convertIStoString(getInstrumentation().getContext().getAssets().open(CHANGESET_XML_ADDRESS));
  ArrayList<Changeset> changesetList=XmlParser.parseChangesetList(testXml);
  Changeset changeset1=changesetList.get(0);
  assertNotNull("String_Node_Str",changeset1);
  assertEquals(88998,changeset1.getAccountId());
  assertEquals("String_Node_Str",changeset1.getAuthor());
  assertEquals("String_Node_Str",changeset1.getEmail());
  assertEquals("String_Node_Str",changeset1.getHashId());
  assertEquals(207784,changeset1.getRepositoryId());
  assertEquals("String_Node_Str",changeset1.getRevision());
  calendar.set(2011,4,06,13,00,29);
  assertEquals(new Date(111,4,06,13,00,29),changeset1.getTime());
  assertEquals(false,changeset1.isTooLarge());
  assertEquals(184072,changeset1.getUserId());
  Changeset changeset2=changesetList.get(1);
  assertNotNull("String_Node_Str",changeset2);
  assertEquals(88998,changeset2.getAccountId());
  assertEquals("String_Node_Str",changeset2.getAuthor());
  assertEquals("String_Node_Str",changeset2.getEmail());
  assertEquals("String_Node_Str",changeset2.getHashId());
  assertEquals(205628,changeset2.getRepositoryId());
  assertEquals("String_Node_Str",changeset2.getRevision());
  assertEquals(new Date(111,3,28,9,32,50),changeset2.getTime());
  assertEquals(false,changeset2.isTooLarge());
  assertEquals(0,changeset2.getUserId());
}

Fixed version (ground truth):
public void testParseChangesets() throws IOException, XMLParserException {
  String testXml=convertIStoString(getInstrumentation().getContext().getAssets().open(CHANGESET_XML_ADDRESS));
  ArrayList<Changeset> changesetList=XmlParser.parseChangesetList(testXml);
  Changeset changeset1=changesetList.get(0);
  assertNotNull("String_Node_Str",changeset1);
  assertEquals(88998,changeset1.getAccountId());
  assertEquals("String_Node_Str",changeset1.getAuthor());
  assertEquals("String_Node_Str",changeset1.getEmail());
  assertEquals("String_Node_Str",changeset1.getHashId());
  assertEquals(207784,changeset1.getRepositoryId());
  assertEquals("String_Node_Str",changeset1.getRevision());
  assertEquals(new Date(111,4,06,13,00,29),changeset1.getTime());
  assertEquals(false,changeset1.isTooLarge());
  assertEquals(184072,changeset1.getUserId());
  Changeset changeset2=changesetList.get(1);
  assertNotNull("String_Node_Str",changeset2);
  assertEquals(88998,changeset2.getAccountId());
  assertEquals("String_Node_Str",changeset2.getAuthor());
  assertEquals("String_Node_Str",changeset2.getEmail());
  assertEquals("String_Node_Str",changeset2.getHashId());
  assertEquals(205628,changeset2.getRepositoryId());
  assertEquals("String_Node_Str",changeset2.getRevision());
  assertEquals(new Date(111,3,28,9,32,50),changeset2.getTime());
  assertEquals(false,changeset2.isTooLarge());
  assertEquals(0,changeset2.getUserId());
}
Program: 179617
Project: 179617
Buggy source:
@Override protected void setUp() throws Exception {
  super.setUp();
  TimeZone.setDefault(TimeZone.getTimeZone("String_Node_Str"));
  calendar=Calendar.getInstance();
}

Fixed version (ground truth):
@Override protected void setUp() throws Exception {
  super.setUp();
  TimeZone.setDefault(TimeZone.getTimeZone("String_Node_Str"));
  calendar=Calendar.getInstance();
  calendar.setTimeZone(TimeZone.getTimeZone("String_Node_Str"));
}
Program: 179619
Project: 179619
Buggy source:
private void addBranchName(String branchName) throws IllegalArgumentException, IllegalStateException, IOException {
  if (branchName != null) {
    serializer.startTag("String_Node_Str","String_Node_Str");
    serializer.text(branchName);
    serializer.endTag("String_Node_Str","String_Node_Str");
  }
}

Fixed version (ground truth):
private void addBranchName(String branchName) throws IllegalArgumentException, IllegalStateException, IOException {
  if (branchName != null && !branchName.equals("String_Node_Str")) {
    serializer.startTag("String_Node_Str","String_Node_Str");
    serializer.text(branchName);
    serializer.endTag("String_Node_Str","String_Node_Str");
  }
}
Program: 179621
Project: 179621
Buggy source:
public static Integer sendModifyServerEnvironmentXML(SharedPreferences prefs,String accountModificationXml,int repoId,int environmentId) throws XMLParserException, HttpSenderServerErrorException, HttpSenderException, UnsupportedEncodingException {
  UsernamePasswordCredentials credentials=getCredentialsFromPreferences(prefs);
  String domain=getAccountDomain(prefs);
  HttpPut putRequest=new HttpPut(HTTPS_PREFIX + domain + SERVER_ENVIRONMENT_UPDATE_HTTP_MIDDLE+ String.valueOf(repoId)+ SERVER_ENVIRONMENT_UPDATE_HTTP_SUFFIX+ String.valueOf(environmentId)+ "String_Node_Str");
  return executeModifyPutRequst(accountModificationXml,credentials,putRequest);
}

Fixed version (ground truth):
public static int sendModifyServerEnvironmentXML(SharedPreferences prefs,String modificationXml,int repoId,int environmentId) throws XMLParserException, HttpSenderServerErrorException, HttpSenderException, UnsupportedEncodingException {
  UsernamePasswordCredentials credentials=getCredentialsFromPreferences(prefs);
  String domain=getAccountDomain(prefs);
  HttpPut putRequest=new HttpPut(HTTPS_PREFIX + domain + SERVER_ENVIRONMENT_UPDATE_HTTP_MIDDLE+ String.valueOf(repoId)+ SERVER_ENVIRONMENT_UPDATE_HTTP_SUFFIX+ String.valueOf(environmentId)+ "String_Node_Str");
  return executeModifyPutRequst(modificationXml,credentials,putRequest);
}
Program: 179622
Project: 179622
Buggy source:
private static int executeModifyPutRequst(String accountModificationXml,UsernamePasswordCredentials credentials,HttpPut putRequest) throws UnsupportedEncodingException, XMLParserException, HttpSenderServerErrorException, HttpSenderException {
  putRequest.addHeader(BasicScheme.authenticate(credentials,"String_Node_Str",false));
  putRequest.addHeader("String_Node_Str","String_Node_Str");
  StringEntity se=new StringEntity(accountModificationXml,"String_Node_Str");
  putRequest.setEntity(se);
  try {
    HttpResponse putResponse=httpClient.execute(putRequest);
    String entity=EntityUtils.toString(putResponse.getEntity());
    int statusCode=putResponse.getStatusLine().getStatusCode();
    if (statusCode == 200) {
      return 200;
    }
 else     if (statusCode == 422) {
      StringBuilder sb=new StringBuilder();
      for (      String s : XmlParser.parseErrors(entity)) {
        sb.append(s);
        sb.append("String_Node_Str");
      }
      throw new HttpSenderServerErrorException(sb.toString());
    }
 else {
      throw new HttpSenderServerErrorException(putResponse.getStatusLine().getReasonPhrase());
    }
  }
 catch (  IOException e) {
    putRequest.abort();
    e.printStackTrace();
    throw new HttpSenderException("String_Node_Str");
  }
}

Fixed version (ground truth):
private static int executeModifyPutRequst(String modificationXml,UsernamePasswordCredentials credentials,HttpPut putRequest) throws UnsupportedEncodingException, XMLParserException, HttpSenderServerErrorException, HttpSenderException {
  putRequest.addHeader(BasicScheme.authenticate(credentials,"String_Node_Str",false));
  putRequest.addHeader("String_Node_Str","String_Node_Str");
  StringEntity se=new StringEntity(modificationXml,"String_Node_Str");
  putRequest.setEntity(se);
  try {
    HttpResponse putResponse=httpClient.execute(putRequest);
    String entity=EntityUtils.toString(putResponse.getEntity());
    int statusCode=putResponse.getStatusLine().getStatusCode();
    if (statusCode == 200) {
      return 200;
    }
 else     if (statusCode == 422) {
      StringBuilder sb=new StringBuilder();
      for (      String s : XmlParser.parseErrors(entity)) {
        sb.append(s);
        sb.append("String_Node_Str");
      }
      throw new HttpSenderServerErrorException(sb.toString());
    }
 else {
      Log.d("String_Node_Str",modificationXml);
      Log.d("String_Node_Str",putRequest.getURI().toASCIIString());
      Log.d("String_Node_Str",putResponse.getStatusLine().toString());
      throw new HttpSenderServerErrorException(putResponse.getStatusLine().getReasonPhrase());
    }
  }
 catch (  IOException e) {
    putRequest.abort();
    e.printStackTrace();
    throw new HttpSenderException("String_Node_Str");
  }
}
Program: 179623
Project: 179623
Buggy source:
public static Integer sendUpdateAccountXML(SharedPreferences prefs,String accountModificationXml) throws XMLParserException, HttpSenderServerErrorException, HttpSenderException, UnsupportedEncodingException {
  UsernamePasswordCredentials credentials=getCredentialsFromPreferences(prefs);
  String domain=getAccountDomain(prefs);
  HttpPut putRequest=new HttpPut(HTTPS_PREFIX + domain + ACCOUNT_UPDATE_HTTP_SUFFIX);
  return executeModifyPutRequst(accountModificationXml,credentials,putRequest);
}

Fixed version (ground truth):
public static int sendUpdateAccountXML(SharedPreferences prefs,String accountModificationXml) throws XMLParserException, HttpSenderServerErrorException, HttpSenderException, UnsupportedEncodingException {
  UsernamePasswordCredentials credentials=getCredentialsFromPreferences(prefs);
  String domain=getAccountDomain(prefs);
  HttpPut putRequest=new HttpPut(HTTPS_PREFIX + domain + ACCOUNT_UPDATE_HTTP_SUFFIX);
  return executeModifyPutRequst(accountModificationXml,credentials,putRequest);
}
Program: 179624
Project: 179624
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.create_new_server_environment_layout);
  repoId=getIntent().getIntExtra(Constants.REPOSITORY_ID,0);
  nameEditText=(EditText)findViewById(R.id.nameLabel);
  automaticCheckBox=(CheckBox)findViewById(R.id.is_automatic_checkbox);
  branchName=(EditText)findViewById(R.id.branch_name_edittext);
  findViewById(R.id.createButton).setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      new SendNewServerEnvironment(getApplicationContext()).execute();
    }
  }
);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.create_new_server_environment_layout);
  repoId=getIntent().getIntExtra(Constants.REPOSITORY_ID,0);
  nameEditText=(EditText)findViewById(R.id.nameEditText);
  automaticCheckBox=(CheckBox)findViewById(R.id.is_automatic_checkbox);
  branchName=(EditText)findViewById(R.id.branch_name_edittext);
  findViewById(R.id.createButton).setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      new SendNewServerEnvironment(CreateNewServerEnvironmentActivity.this).execute();
    }
  }
);
}
Program: 179625
Project: 179625
Buggy source:
@Override public void onClick(View v){
  new SendNewServerEnvironment(getApplicationContext()).execute();
}

Fixed version (ground truth):
@Override public void onClick(View v){
  new SendNewServerEnvironment(CreateNewServerEnvironmentActivity.this).execute();
}
Program: 179626
Project: 179626
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.repository_deployments_layout);
  repository=getIntent().getParcelableExtra(Constants.REPOSITORY);
  ((TextView)findViewById(R.id.repoTitle)).setText(repository.getTitle());
  findViewById(R.id.colorLabel).getBackground().setLevel(repository.getColorLabelNo());
  mReleasesList=(ListView)findViewById(R.id.releases_list);
  mServersList=(ExpandableListView)findViewById(R.id.servers_list);
  releasesButton=(Button)findViewById(R.id.releases_button);
  releasesButton.setOnClickListener(this);
  serversButton=(Button)findViewById(R.id.servers_button);
  serversButton.setOnClickListener(this);
  releasesButton.setSelected(true);
  serversButton.setSelected(false);
  mReleasesAdapter=new ReleasesAdapter(this,R.layout.releases_entry,mReleaseArray);
  mReleasesList.setAdapter(mReleasesAdapter);
  mServersAdapter=new ServersAdapter(this,R.layout.environments_list_entry,mServersArray);
  mServersList.setAdapter(mServersAdapter);
  new DownloadReleaseListTask(this).execute();
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.repository_deployments_layout);
  repository=getIntent().getParcelableExtra(Constants.REPOSITORY);
  ((TextView)findViewById(R.id.repoTitle)).setText(repository.getTitle());
  findViewById(R.id.colorLabel).getBackground().setLevel(repository.getColorLabelNo());
  mReleasesList=(ListView)findViewById(R.id.releases_list);
  mServersList=(ExpandableListView)findViewById(R.id.servers_list);
  releasesButton=(Button)findViewById(R.id.releases_button);
  releasesButton.setOnClickListener(this);
  serversButton=(Button)findViewById(R.id.servers_button);
  serversButton.setOnClickListener(this);
  releasesButton.setSelected(true);
  serversButton.setSelected(false);
  View footerView=((LayoutInflater)getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.add_server_environment_footer,null,false);
  footerView.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      Intent intent=new Intent(getApplicationContext(),CreateNewServerEnvironmentActivity.class);
      intent.putExtra(Constants.REPOSITORY_ID,repository.getId());
      startActivity(intent);
    }
  }
);
  mServersList.addFooterView(footerView);
  mReleasesAdapter=new ReleasesAdapter(this,R.layout.releases_entry,mReleaseArray);
  mReleasesList.setAdapter(mReleasesAdapter);
  mServersAdapter=new ServersAdapter(this,R.layout.environments_list_entry,mServersArray);
  mServersList.setAdapter(mServersAdapter);
  new DownloadReleaseListTask(this).execute();
}
Program: 179627
Project: 179627
Buggy source:
@Override public int update(Uri uri,ContentValues values,String selection,String[] selectionArgs){
  return db.getWritableDatabase().update(Mnem.TABLE_NAME,values,selection,selectionArgs);
}

Fixed version (ground truth):
@Override public int update(Uri uri,ContentValues values,String selection,String[] selectionArgs){
  selection=Mnem._ID + "String_Node_Str" + uri.getLastPathSegment();
  return db.getWritableDatabase().update(Mnem.TABLE_NAME,values,selection,selectionArgs);
}
Program: 179628
Project: 179628
Buggy source:
@Override public void onUpgrade(SQLiteDatabase db,int oldVersion,int newVersion){
  if (oldVersion < DATABASE_VERSION) {
    if (oldVersion > 11 && oldVersion < 13) {
      db.execSQL(DATABASE_CREATE_PLACE);
    }
 else     if (oldVersion < 14) {
      db.execSQL("String_Node_Str" + CON_TABLE + "String_Node_Str");
      db.execSQL("String_Node_Str" + REMINDER_TABLE + "String_Node_Str");
    }
 else {
      db.execSQL("String_Node_Str" + CON_TABLE);
      db.execSQL("String_Node_Str" + ANNOTATION_TABLE);
      db.execSQL("String_Node_Str" + LINE_TABLE);
      if (oldVersion > 4 && oldVersion != 6)       db.execSQL("String_Node_Str" + FAVORITE_TABLE);
      if (oldVersion > 5 && oldVersion != 6)       db.execSQL("String_Node_Str" + REMINDER_TABLE);
      this.onCreate(db);
    }
  }
}

Fixed version (ground truth):
@Override public void onUpgrade(SQLiteDatabase db,int oldVersion,int newVersion){
  if (oldVersion < DATABASE_VERSION) {
    if (oldVersion > 11 && oldVersion < 13) {
      db.execSQL(DATABASE_CREATE_PLACE);
      db.execSQL("String_Node_Str" + CON_TABLE + "String_Node_Str");
      db.execSQL("String_Node_Str" + REMINDER_TABLE + "String_Node_Str");
    }
 else {
      db.execSQL("String_Node_Str" + CON_TABLE);
      db.execSQL("String_Node_Str" + ANNOTATION_TABLE);
      db.execSQL("String_Node_Str" + LINE_TABLE);
      if (oldVersion > 4 && oldVersion != 6)       db.execSQL("String_Node_Str" + FAVORITE_TABLE);
      if (oldVersion > 5 && oldVersion != 6)       db.execSQL("String_Node_Str" + REMINDER_TABLE);
      this.onCreate(db);
    }
  }
}
Program: 179629
Project: 179629
Buggy source:
public AboutDialog(Activity context){
  this.context=context;
  AlertDialog.Builder ab;
  if (Build.VERSION.SDK_INT > 10) {
    ab=new AlertDialog.Builder(context,AlertDialog.THEME_DEVICE_DEFAULT_LIGHT);
  }
 else {
    ab=new AlertDialog.Builder(context);
  }
  View v=LayoutInflater.from(context).inflate(R.layout.about_dialog,null);
  ab.setTitle(R.string.appNameAbout);
  ab.setPositiveButton("String_Node_Str",new OkListener());
  ab.setNeutralButton("String_Node_Str",new DonateListener());
  ab.setNegativeButton("String_Node_Str",new FeedbackListener());
  ImageView follow=((ImageView)v.findViewById(R.id.iFollow));
  follow.setOnClickListener(new FollowListener());
  ab.setIcon(R.drawable.icon);
  ab.setView(v);
  dialog=ab.create();
  dialog.show();
  mHelper=new IabHelper(AboutDialog.this.context,publicKey);
  mHelper.startSetup(new IabHelper.OnIabSetupFinishedListener(){
    public void onIabSetupFinished(    IabResult result){
      if (!result.isSuccess()) {
        Log.d("String_Node_Str","String_Node_Str" + result);
      }
      mHelper.queryInventoryAsync(new IabHelper.QueryInventoryFinishedListener(){
        @Override public void onQueryInventoryFinished(        IabResult result,        Inventory inventory){
          Log.d("String_Node_Str","String_Node_Str");
          if (mHelper == null)           return;
          if (result.isFailure()) {
            return;
          }
          Log.d("String_Node_Str","String_Node_Str");
          Purchase gasPurchase=inventory.getPurchase(sku);
          if (gasPurchase != null) {
            Log.d("String_Node_Str","String_Node_Str");
            mHelper.consumeAsync(inventory.getPurchase(sku),null);
            return;
          }
        }
      }
);
    }
  }
);
  mHelper.enableDebugLogging(true);
}

Fixed version (ground truth):
public AboutDialog(Activity context){
  this.context=context;
}
Program: 179631
Project: 179631
Buggy source:
@Override public void onClick(View v){
  if (place.getGps() != null) {
    String uri=String.format(Locale.ENGLISH,"String_Node_Str",place.getGps().lat,place.getGps().lon,place.getName());
    Intent intent=new Intent(Intent.ACTION_VIEW,Uri.parse(uri));
    startActivity(intent);
  }
}

Fixed version (ground truth):
@Override public void onClick(View v){
  if (place.getGps() != null) {
    String uri=String.format(Locale.ENGLISH,"String_Node_Str",place.getGps().lat,place.getGps().lon,place.getName());
    Intent intent=new Intent(Intent.ACTION_VIEW,Uri.parse(uri));
    PackageManager manager=getPackageManager();
    List<ResolveInfo> infos=manager.queryIntentActivities(intent,0);
    if (infos.size() > 0) {
      startActivity(intent);
    }
  }
}
Program: 179632
Project: 179632
Buggy source:
@Override public void onClick(View v){
switch (v.getId()) {
case R.id.tdRestaurants:
    Intent in2=new Intent(parentActivity,NeighbourhoodListActivity.class);
  parentActivity.startActivity(in2);
break;
case R.id.tdMap:
Convention event=provider.getCon();
if (event.getGps() != null) {
String uri=String.format(Locale.ENGLISH,"String_Node_Str",event.getGps().lat,event.getGps().lon);
Intent intent=new Intent(Intent.ACTION_VIEW,Uri.parse(uri));
parentActivity.startActivity(intent);
}
break;
case R.id.tdWeb:
Intent browserIntent=new Intent(Intent.ACTION_VIEW,Uri.parse(provider.getCon().getUrl()));
parentActivity.startActivity(browserIntent);
break;
case R.id.tdAnother:
Intent intent=new Intent(parentActivity,WelcomeActivity.class);
intent.putExtra("String_Node_Str",true);
parentActivity.startActivity(intent);
break;
case R.id.tdReminders:
Intent in=new Intent(parentActivity,ReminderList.class);
parentActivity.startActivity(in);
break;
case R.id.tdSettings:
Intent i=new Intent(parentActivity,Preferences.class);
parentActivity.startActivity(i);
break;
case R.id.tdAbout:
parentActivity.setActivityResultListener(new AboutDialog(parentActivity));
break;
}
this.parentActivity.closeDrawer();
}

Fixed version (ground truth):
@Override public void onClick(View v){
switch (v.getId()) {
case R.id.tdRestaurants:
    Intent in2=new Intent(parentActivity,NeighbourhoodListActivity.class);
  parentActivity.startActivity(in2);
break;
case R.id.tdMap:
Convention event=provider.getCon();
if (event.getGps() != null) {
String uri=String.format(Locale.ENGLISH,"String_Node_Str",event.getGps().lat,event.getGps().lon);
Intent intent=new Intent(Intent.ACTION_VIEW,Uri.parse(uri));
PackageManager manager=parentActivity.getPackageManager();
List<ResolveInfo> infos=manager.queryIntentActivities(intent,0);
if (infos.size() > 0) {
parentActivity.startActivity(intent);
}
}
break;
case R.id.tdWeb:
Intent browserIntent=new Intent(Intent.ACTION_VIEW,Uri.parse(provider.getCon().getUrl()));
parentActivity.startActivity(browserIntent);
break;
case R.id.tdAnother:
Intent intent=new Intent(parentActivity,WelcomeActivity.class);
intent.putExtra("String_Node_Str",true);
parentActivity.startActivity(intent);
break;
case R.id.tdReminders:
Intent in=new Intent(parentActivity,ReminderList.class);
parentActivity.startActivity(in);
break;
case R.id.tdSettings:
Intent i=new Intent(parentActivity,Preferences.class);
parentActivity.startActivity(i);
break;
case R.id.tdAbout:
AboutDialog aboutDialog=new AboutDialog(parentActivity);
parentActivity.setActivityResultListener(aboutDialog);
aboutDialog.show();
break;
}
this.parentActivity.closeDrawer();
}
Program: 179633
Project: 179633
Buggy source:
@Override protected void onException(Exception e) throws RuntimeException {
  if (e instanceof RetrofitError) {
    if (((RetrofitError)e).isNetworkError()) {
      Toast.makeText(listener.getActivity(),R.string.networkError,Toast.LENGTH_LONG).show();
      return;
    }
 else     if (((RetrofitError)e).getResponse() != null && ((RetrofitError)e).getResponse().getStatus() >= 500) {
      Toast.makeText(listener.getActivity(),R.string.serverError,Toast.LENGTH_LONG).show();
      return;
    }
  }
  super.onException(e);
  listener.onTaskErrored(this);
}

Fixed version (ground truth):
@Override protected void onException(Exception e) throws RuntimeException {
  if (e instanceof RetrofitError) {
    if (((RetrofitError)e).isNetworkError()) {
      Toast.makeText(listener.getActivity(),R.string.networkError,Toast.LENGTH_LONG).show();
    }
 else     if (((RetrofitError)e).getResponse() != null && ((RetrofitError)e).getResponse().getStatus() >= 500) {
      Toast.makeText(listener.getActivity(),R.string.serverError,Toast.LENGTH_LONG).show();
    }
  }
  super.onException(e);
  listener.onTaskErrored(this);
}
Program: 179635
Project: 179635
Buggy source:
public Convention getCon(){
  if (this.con != null) {
    return con;
  }
  Cursor c=this.mDatabase.query(CondroidDatabase.CON_TABLE,null,null,null,null,null);
  Convention co=new Convention();
  while (c.moveToNext()) {
    co.setCid(c.getInt(c.getColumnIndex("String_Node_Str")));
    co.setDataUrl(c.getString(c.getColumnIndex("String_Node_Str")));
    co.setDate(c.getString(c.getColumnIndex("String_Node_Str")));
    co.setIconUrl(c.getString(c.getColumnIndex("String_Node_Str")));
    co.setName(c.getString(c.getColumnIndex("String_Node_Str")));
    co.setMessage(c.getString(c.getColumnIndex("String_Node_Str")));
    co.setLocationsFile(c.getString(c.getColumnIndex("String_Node_Str")));
    SimpleDateFormat format=new SimpleDateFormat("String_Node_Str",new Locale("String_Node_Str","String_Node_Str"));
    try {
      co.setLastUpdate(format.parse(c.getString(c.getColumnIndex("String_Node_Str"))));
    }
 catch (    Exception e) {
      Log.e("String_Node_Str","String_Node_Str",e);
      co.setLastUpdate(new Date());
    }
  }
  c.close();
  this.con=co;
  return co;
}

Fixed version (ground truth):
public Convention getCon(){
  if (this.con != null) {
    return con;
  }
  Cursor c=this.mDatabase.query(CondroidDatabase.CON_TABLE,null,null,null,null,null);
  Convention co=new Convention();
  while (c.moveToNext()) {
    co.setCid(c.getInt(c.getColumnIndex("String_Node_Str")));
    co.setDataUrl(c.getString(c.getColumnIndex("String_Node_Str")));
    co.setDate(c.getString(c.getColumnIndex("String_Node_Str")));
    co.setIconUrl(c.getString(c.getColumnIndex("String_Node_Str")));
    co.setName(c.getString(c.getColumnIndex("String_Node_Str")));
    co.setMessage(c.getString(c.getColumnIndex("String_Node_Str")));
    co.setLocationsFile(c.getString(c.getColumnIndex("String_Node_Str")));
    DateTimeFormatter format=DateTimeFormat.forPattern("String_Node_Str").withZoneUTC();
    try {
      co.setLastUpdate(format.parseDateTime(c.getString(c.getColumnIndex("String_Node_Str"))).toDate());
    }
 catch (    Exception e) {
      Log.e("String_Node_Str","String_Node_Str",e);
      co.setLastUpdate(new Date());
    }
  }
  c.close();
  this.con=co;
  return co;
}
Program: 179638
Project: 179638
Buggy source:
public ContentValues getContentValues(){
  ContentValues ret=new ContentValues();
  ret.put("String_Node_Str",this.cid);
  ret.put("String_Node_Str",date);
  ret.put("String_Node_Str",iconUrl);
  ret.put("String_Node_Str",name);
  ret.put("String_Node_Str",dataUrl);
  ret.put("String_Node_Str",message);
  ret.put("String_Node_Str",locationsFile);
  ret.put("String_Node_Str",providesAnnotations);
  ret.put("String_Node_Str",providesTimetable);
  return ret;
}

Fixed version (ground truth):
public ContentValues getContentValues(){
  ContentValues ret=new ContentValues();
  ret.put("String_Node_Str",this.cid);
  ret.put("String_Node_Str",date);
  ret.put("String_Node_Str",iconUrl);
  ret.put("String_Node_Str",name);
  ret.put("String_Node_Str",dataUrl);
  ret.put("String_Node_Str",message);
  ret.put("String_Node_Str",locationsFile);
  ret.put("String_Node_Str",providesAnnotations);
  ret.put("String_Node_Str",providesTimetable);
  DateTimeFormatter dateSQLFormatter=DateTimeFormat.forPattern("String_Node_Str").withZoneUTC();
  ret.put("String_Node_Str",dateSQLFormatter.print(lastUpdate.getTime()));
  return ret;
}
Program: 179640
Project: 179640
Buggy source:
public static void planUpdateService(Context context){
  SharedPreferences preferences=PreferenceManager.getDefaultSharedPreferences(context);
  if (!(preferences.getBoolean("String_Node_Str",false) && !preferences.getBoolean("String_Node_Str",false))) {
    stopUpdateService(context);
    return;
  }
  AlarmManager am=(AlarmManager)context.getSystemService(ALARM_SERVICE);
  long interval;
  interval=Integer.parseInt(preferences.getString("String_Node_Str","String_Node_Str"));
  interval*=60 * 1000;
  long time=interval + preferences.getLong("String_Node_Str",System.currentTimeMillis());
  PendingIntent pendingIntent=PendingIntent.getService(context,0,new Intent(context,UpdatesService.class),0);
  am.setInexactRepeating(AlarmManager.RTC,time,interval,pendingIntent);
  Log.d("String_Node_Str","String_Node_Str" + (new Date(time)));
}

Fixed version (ground truth):
public static void planUpdateService(Context context){
  stopUpdateService(context);
  SharedPreferences preferences=PreferenceManager.getDefaultSharedPreferences(context);
  if (!(preferences.getBoolean("String_Node_Str",false) && !preferences.getBoolean("String_Node_Str",false))) {
    stopUpdateService(context);
    return;
  }
  AlarmManager am=(AlarmManager)context.getSystemService(ALARM_SERVICE);
  long interval;
  interval=Integer.parseInt(preferences.getString("String_Node_Str","String_Node_Str"));
  if (!preferences.contains("String_Node_Str")) {
    SharedPreferences.Editor e=preferences.edit();
    e.putLong("String_Node_Str",System.currentTimeMillis() - (interval - 1) * 60 * 1000);
    e.commit();
  }
  long time=interval * 60 * 1000 + preferences.getLong("String_Node_Str",System.currentTimeMillis());
  PendingIntent pendingIntent=PendingIntent.getService(context,0,new Intent(context,UpdatesService.class),0);
  am.setInexactRepeating(AlarmManager.RTC,time,interval,pendingIntent);
  Log.d("String_Node_Str","String_Node_Str" + (new Date(time)));
}
Program: 179641
Project: 179641
Buggy source:
public void onAsyncTaskCompleted(ListenedAsyncTask<?,?> task){
  asyncTaskHandler=null;
  if (!provider.hasData()) {
    Toast.makeText(this,"String_Node_Str",Toast.LENGTH_LONG).show();
    finish();
    return;
  }
  SearchProvider.getSearchQueryBuilders().clear();
  refreshDataset=true;
  this.onResume();
  SharedPreferences.Editor editor=PreferenceManager.getDefaultSharedPreferences(this).edit();
  editor.remove("String_Node_Str");
  editor.remove("String_Node_Str");
  editor.remove("String_Node_Str");
  editor.commit();
  Preferences.planUpdateService(this);
  initView();
}

Fixed version (ground truth):
public void onAsyncTaskCompleted(ListenedAsyncTask<?,?> task){
  asyncTaskHandler=null;
  if (!provider.hasData()) {
    Toast.makeText(this,"String_Node_Str",Toast.LENGTH_LONG).show();
    finish();
    return;
  }
  refreshDataset=true;
  this.onResume();
  SharedPreferences.Editor editor=PreferenceManager.getDefaultSharedPreferences(this).edit();
  editor.remove("String_Node_Str");
  editor.remove("String_Node_Str");
  editor.remove("String_Node_Str");
  editor.remove("String_Node_Str");
  editor.commit();
  Preferences.planUpdateService(this);
  initView();
}
Program: 179642
Project: 179642
Buggy source:
public static void updateAlarmManager(Context context){
  Log.d("String_Node_Str","String_Node_Str");
  AlarmManager am=(AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
  DataProvider dp=DataProvider.getInstance(context);
  Reminder closest=dp.getNextReminder();
  if (closest != null) {
    if (closest.annotation == null) {
      Toast.makeText(context,"String_Node_Str",Toast.LENGTH_LONG).show();
      return;
    }
    if (closest.annotation.getStartTime() == null) {
      dp.removeReminder(closest.annotation.getPid());
      return;
    }
    PendingIntent pi=PendingIntent.getService(context,0,new Intent(context,ReminderTask.class),0);
    long time=closest.annotation.getStartTime().getTime() + (closest.reminder * 60 * 1000);
    am.set(AlarmManager.RTC_WAKEUP,time,pi);
    Log.d("String_Node_Str","String_Node_Str" + new Date(time));
  }
 else {
    Log.d("String_Node_Str","String_Node_Str");
  }
}

Fixed version (ground truth):
public static void updateAlarmManager(Context context){
  Log.d("String_Node_Str","String_Node_Str");
  AlarmManager am=(AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
  DataProvider dp=DataProvider.getInstance(context);
  Reminder closest=dp.getNextReminder();
  if (closest != null) {
    if (closest.annotation == null) {
      Toast.makeText(context,"String_Node_Str",Toast.LENGTH_LONG).show();
      return;
    }
    if (closest.annotation.getStartTime() == null) {
      dp.removeReminder(closest.annotation.getPid());
      return;
    }
    PendingIntent pi=PendingIntent.getService(context,0,new Intent(context,ReminderTask.class),0);
    long time=closest.annotation.getStartTime().getTime() - (closest.reminder * 60 * 1000);
    am.set(AlarmManager.RTC_WAKEUP,time,pi);
    Log.d("String_Node_Str","String_Node_Str" + new Date(time));
  }
 else {
    Log.d("String_Node_Str","String_Node_Str");
  }
}
Program: 179643
Project: 179643
Buggy source:
@Override protected void onProgressUpdate(Integer... values){
  int value=values[0];
  super.onProgressUpdate(values);
  if (pd == null) {
    pdMax=value;
    showDialog();
    return;
  }
  float progress=(float)value / 2;
  pd.setProgress((int)(progress));
}

Fixed version (ground truth):
@Override protected void onProgressUpdate(Integer... values){
  int value=values[0];
  super.onProgressUpdate(values);
  if (pd == null || !pd.isShowing()) {
    pdMax=value;
    showDialog();
    return;
  }
  float progress=(float)value / 2;
  pd.setProgress((int)(progress));
}
Program: 179644
Project: 179644
Buggy source:
@Override protected void showDialog(){
  pd=new ProgressDialog(parentActivity);
  pd.setMessage(parentActivity.getString(R.string.processing));
  pd.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
  pd.setMax(pdMax);
  pd.show();
}

Fixed version (ground truth):
@Override protected void showDialog(){
  if (pd != null) {
    pd.dismiss();
  }
  pd=new ProgressDialog(parentActivity);
  pd.setMessage(parentActivity.getString(R.string.processing));
  pd.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
  pd.setMax(pdMax);
  pd.show();
}
Program: 179645
Project: 179645
Buggy source:
public String getCondition(){
  return "String_Node_Str" + date + "String_Node_Str"+ date2+ "String_Node_Str";
}

Fixed version (ground truth):
public String getCondition(){
  Date d2=(Date)d.clone();
  d2.setDate(d.getDate() + 1);
  return "String_Node_Str" + df.format(d) + "String_Node_Str"+ df.format(d2)+ "String_Node_Str";
}
Program: 179646
Project: 179646
Buggy source:
public void addParam(final Date d){
  final DateFormat df=new SimpleDateFormat("String_Node_Str");
  final String date=df.format(d);
  d.setDate(d.getDate() + 1);
  final String date2=df.format(d);
  this.addParam(new ICondition(){
    public String getCondition(){
      return "String_Node_Str" + date + "String_Node_Str"+ date2+ "String_Node_Str";
    }
    @Override public String getReadable(){
      return new SimpleDateFormat("String_Node_Str").format(d);
    }
  }
,new Date().getClass().getName());
}

Fixed version (ground truth):
public void addParam(final Date d){
  final DateFormat df=new SimpleDateFormat("String_Node_Str");
  this.addParam(new ICondition(){
    public String getCondition(){
      Date d2=(Date)d.clone();
      d2.setDate(d.getDate() + 1);
      return "String_Node_Str" + df.format(d) + "String_Node_Str"+ df.format(d2)+ "String_Node_Str";
    }
    @Override public String getReadable(){
      return new SimpleDateFormat("String_Node_Str").format(d);
    }
  }
,new Date().getClass().getName());
}
Program: 179647
Project: 179647
Buggy source:
public View inflateAnnotation(View v,Annotation annotation){
  ViewHolder vh=(ViewHolder)v.getTag(R.id.listItem);
  if (false) {
    vh.favorited.setVisibility(View.VISIBLE);
  }
 else {
    vh.favorited.setVisibility(View.GONE);
  }
  if (vh.title != null) {
    vh.title.setText(annotation.getTitle());
  }
  if (vh.author != null) {
    vh.author.setText(annotation.getAuthor());
  }
  if (vh.line != null) {
    vh.line.setText(provider.getProgramLine(annotation.getLid()).getName());
  }
  if (annotation.getStartTime() != null && annotation.getEndTime() != null) {
    vh.time.setText(formatDate(annotation.getStartTime()) + "String_Node_Str" + todayFormat.format(annotation.getEndTime()));
    if (annotation.getLid() > 0) {
      vh.line.setText(vh.line.getText() + "String_Node_Str");
    }
  }
 else {
    vh.title.setText("String_Node_Str");
  }
  if (annotation.getLocation() != null) {
    vh.place.setText(annotation.getLocation());
    if (annotation.getLid() > 0) {
      vh.line.setText(vh.line.getText() + "String_Node_Str");
    }
  }
 else {
    vh.place.setText("String_Node_Str");
  }
  if (vh.programType != null) {
    vh.programType.setImageResource(annotation.getProgramIcon());
  }
  return v;
}

Fixed version (ground truth):
public View inflateAnnotation(View v,Annotation annotation){
  ViewHolder vh=(ViewHolder)v.getTag(R.id.listItem);
  if (provider.getFavorited().contains(Integer.valueOf(annotation.getPid()))) {
    vh.favorited.setVisibility(View.VISIBLE);
  }
 else {
    vh.favorited.setVisibility(View.GONE);
  }
  if (vh.title != null) {
    vh.title.setText(annotation.getTitle());
  }
  if (vh.author != null) {
    vh.author.setText(annotation.getAuthor());
  }
  if (vh.line != null) {
    vh.line.setText(provider.getProgramLine(annotation.getLid()).getName());
  }
  if (vh.time.getVisibility() == View.VISIBLE && annotation.getStartTime() != null && annotation.getEndTime() != null) {
    vh.time.setText(formatDate(annotation.getStartTime()) + "String_Node_Str" + todayFormat.format(annotation.getEndTime()));
    if (annotation.getLid() > 0) {
      vh.line.setText(vh.line.getText() + "String_Node_Str");
    }
  }
 else {
    vh.time.setText("String_Node_Str");
  }
  if (vh.place.getVisibility() == View.VISIBLE && annotation.getLocation() != null) {
    vh.place.setText(annotation.getLocation());
    if (annotation.getLid() > 0) {
      vh.line.setText(vh.line.getText() + "String_Node_Str");
    }
  }
 else {
    vh.place.setText("String_Node_Str");
  }
  if (vh.programType != null) {
    vh.programType.setImageResource(annotation.getProgramIcon());
  }
  return v;
}
Program: 179648
Project: 179648
Buggy source:
private void initView(){
  Convention con=dataProvider.getCon();
  if (con != null) {
    TextView tw2=(TextView)findViewById(R.id.tLoadedInfoCon);
    findViewById(R.id.lLoadedInfo).setVisibility(View.VISIBLE);
    tw2.setText(con.getName());
  }
  LinearLayout l=(LinearLayout)findViewById(R.id.lbShowLocations);
  if (con.getLocationsFile().trim() != "String_Node_Str") {
    l.setVisibility(View.VISIBLE);
  }
 else {
    l.setVisibility(View.GONE);
  }
}

Fixed version (ground truth):
private void initView(){
  Convention con=dataProvider.getCon();
  if (con != null) {
    TextView tw2=(TextView)findViewById(R.id.tLoadedInfoCon);
    findViewById(R.id.lLoadedInfo).setVisibility(View.VISIBLE);
    tw2.setText(con.getName());
  }
  LinearLayout l=(LinearLayout)findViewById(R.id.lbShowLocations);
  if (con.getLocationsFile() != null && !con.getLocationsFile().trim().equals("String_Node_Str")) {
    l.setVisibility(View.VISIBLE);
  }
 else {
    l.setVisibility(View.GONE);
  }
}
Program: 179649
Project: 179649
Buggy source:
@Override protected boolean cacheInBackground() throws Exception {
  if (this.itemsPerPage == 0 || ((this.getCount() - 1) % this.itemsPerPage != 0)) {
    return false;
  }
  this.itemsToAdd=this.getPrecachedData(this.getCount() / this.itemsPerPage);
  return (this.itemsToAdd.size() == this.itemsPerPage);
}

Fixed version (ground truth):
@Override protected boolean cacheInBackground() throws Exception {
  if (this.itemsPerPage == 0) {
    return false;
  }
  this.itemsToAdd=this.getPrecachedData(this.getCount() / this.itemsPerPage);
  return (this.itemsToAdd.size() > 0);
}
Program: 179650
Project: 179650
Buggy source:
public void LoadTweets(String info){
  TwitterFactory twitterFactory=new TwitterFactory();
  Twitter twitter=twitterFactory.getInstance();
  Query query=new Query(info);
  QueryResult res=null;
  try {
    res=twitter.search(query);
    List<Tweet> listaTweets=res.getTweets();
    Iterator<Tweet> itTweet=listaTweets.iterator();
    while (itTweet.hasNext()) {
      Tweet tweet=itTweet.next();
      String infoTweet=(tweet.getFromUser() + "String_Node_Str" + tweet.getText());
      listTweets.add(infoTweet);
    }
  }
 catch (  TwitterException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void LoadTweets(String info){
  TwitterFactory twitterFactory=new TwitterFactory();
  Twitter twitter=twitterFactory.getInstance();
  Query query=new Query(info);
  QueryResult res=null;
  try {
    res=twitter.search(query);
    List<Tweet> listaTweets=res.getTweets();
    Iterator<Tweet> itTweet=listaTweets.iterator();
    listTweets.clear();
    while (itTweet.hasNext()) {
      Tweet tweet=itTweet.next();
      String infoTweet=(tweet.getFromUser() + "String_Node_Str" + tweet.getText());
      listTweets.add(infoTweet);
    }
  }
 catch (  TwitterException e) {
    e.printStackTrace();
  }
}
Program: 179651
Project: 179651
Buggy source:
/** 
 * Constructs this   {@code WeightedRoundRobinList} with the specifiedcollection of elements.
 * @param elements the collection of elements to initialize this list with.
 */
public WeightedRoundRobinList(List<Element<E>> elements){
  if (elements == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  loadElements(elements);
}

Fixed version (ground truth):
/** 
 * Constructs this   {@code WeightedRoundRobinList} with the specifiedcollection of elements.
 * @param elements the collection of elements to initialize this list with.
 */
public WeightedRoundRobinList(List<Element<E>> elements){
  loadElements(Check.forNull(elements));
}
Program: 179653
Project: 179653
Buggy source:
/** 
 * This   {@code WeightedRoundRobinList} concludes equality with the givenobject by comparing each element in the specified list. The order of elements also determines if the given object is equal to this list. Lastly, the specified object's size must match this lists size in order for both objects to be equal.
 * @param other the other list to compare to this list for equality.
 * @return {@code true} if the specified object is equal to this list.
 */
@Override public boolean equals(Object other){
  if (this == other) {
    return true;
  }
  if (other instanceof LoadBalanceList) {
    WeightedRoundRobinList<?> otherList=(WeightedRoundRobinList<?>)other;
    if (otherList.size() != size()) {
      return false;
    }
    Iterator<?> one=elements.iterator();
    Iterator<?> two=otherList.elements.iterator();
    while (one.hasNext()) {
      Object e1=one.next();
      Object e2=two.next();
      if (!(e1 == null ? e2 == null : e1.equals(e2))) {
        return false;
      }
    }
    return true;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * This   {@code WeightedRoundRobinList} concludes equality with the givenobject by comparing each element in the specified list. The order of elements also determines if the given object is equal to this list. Lastly, the specified object's size must match this lists size in order for both objects to be equal.
 * @param other the other list to compare to this list for equality.
 * @return {@code true} if the specified object is equal to this list.
 */
@Override public boolean equals(Object other){
  if (this == other) {
    return true;
  }
  if (other instanceof LoadBalancedList) {
    WeightedRoundRobinList<?> otherList=(WeightedRoundRobinList<?>)other;
    if (otherList.size() != size()) {
      return false;
    }
    Iterator<?> one=elements.iterator();
    Iterator<?> two=otherList.elements.iterator();
    while (one.hasNext()) {
      Object e1=one.next();
      Object e2=two.next();
      if (!(e1 == null ? e2 == null : e1.equals(e2))) {
        return false;
      }
    }
    return true;
  }
  return true;
}
Program: 179654
Project: 179654
Buggy source:
/** 
 * Returns timestamp in human readable form, yet condensed form "yyMMdd-HHmmss.SSS".
 * @param timestamp timestamp in millis
 * @return timestamp as a human readable string
 */
public static String presentTimestamp(long timestamp){
  return TIMESTAMP_FORMAT.format(new Date(timestamp));
}

Fixed version (ground truth):
/** 
 * Returns timestamp in human readable form, yet condensed form "yyMMdd-HHmmss.SSS".
 * @param timestamp timestamp in millis
 * @return timestamp as a human readable string
 */
public static String presentTimestamp(long timestamp){
  if (timestamp == 0) {
    return UNDEF_STRING;
  }
  return TIMESTAMP_FORMAT.format(new Date(timestamp));
}
Program: 179655
Project: 179655
Buggy source:
public void init(FilterConfig filterConfig) throws ServletException {
  simonPrefix=filterConfig.getInitParameter(INIT_PARAM_PREFIX);
  String publishManager=filterConfig.getInitParameter(INIT_PARAM_PUBLISH_MANAGER);
  if (publishManager != null) {
    filterConfig.getServletContext().setAttribute(publishManager,SimonManager.manager());
  }
}

Fixed version (ground truth):
public void init(FilterConfig filterConfig) throws ServletException {
  if (filterConfig.getInitParameter(INIT_PARAM_PREFIX) != null) {
    simonPrefix=filterConfig.getInitParameter(INIT_PARAM_PREFIX);
  }
  String publishManager=filterConfig.getInitParameter(INIT_PARAM_PUBLISH_MANAGER);
  if (publishManager != null) {
    filterConfig.getServletContext().setAttribute(publishManager,SimonManager.manager());
  }
}
Program: 179656
Project: 179656
Buggy source:
public void doFilter(ServletRequest servletRequest,ServletResponse response,FilterChain filterChain) throws IOException, ServletException {
  HttpServletRequest request=(HttpServletRequest)servletRequest;
  String simonName=getSimonName(request);
  Split split=SimonManager.getStopwatch(simonPrefix + Manager.HIERARCHY_DELIMITER + simonName).start();
  filterChain.doFilter(request,response);
  split.stop();
}

Fixed version (ground truth):
public void doFilter(ServletRequest servletRequest,ServletResponse response,FilterChain filterChain) throws IOException, ServletException {
  HttpServletRequest request=(HttpServletRequest)servletRequest;
  String simonName=getSimonName(request);
  Split split=SimonManager.getStopwatch(simonPrefix + Manager.HIERARCHY_DELIMITER + simonName).start();
  try {
    filterChain.doFilter(request,response);
  }
  finally {
    split.stop();
  }
}
Program: 179657
Project: 179657
Buggy source:
private void register(SimonSuperMXBean simonMxBean){
  String name=simonMxBean.getName() + "String_Node_Str" + simonMxBean.getType();
  try {
    ObjectName objectName=new ObjectName(name);
    if (mBeanServer.isRegistered(objectName)) {
      mBeanServer.unregisterMBean(objectName);
    }
 else {
      registeredNames.add(name);
    }
    mBeanServer.registerMBean(simonMxBean,objectName);
    message("String_Node_Str" + objectName);
  }
 catch (  JMException e) {
    warning("String_Node_Str" + name,e);
    registeredNames.remove(name);
  }
}

Fixed version (ground truth):
private void register(SimonSuperMXBean simonMxBean){
  String name=constructObjectName(simonMxBean);
  try {
    ObjectName objectName=new ObjectName(name);
    if (mBeanServer.isRegistered(objectName)) {
      mBeanServer.unregisterMBean(objectName);
    }
 else {
      registeredNames.add(name);
    }
    mBeanServer.registerMBean(simonMxBean,objectName);
    message("String_Node_Str" + objectName);
  }
 catch (  JMException e) {
    warning("String_Node_Str" + name,e);
    registeredNames.remove(name);
  }
}