nus-yam/ex-repair huggingface dataset:
Program: 13470
Project: 13470
Buggy source:
public static String parseDate(String timestamp,String fromFormat,String toFormat){
  SimpleDateFormat from=new SimpleDateFormat(fromFormat);
  SimpleDateFormat to=new SimpleDateFormat(toFormat);
  try {
    Date date=from.parse(timestamp);
    return to.format(date);
  }
 catch (  ParseException e) {
    AppLog.e(T.STATS,e);
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
public static String parseDate(String timestamp,String fromFormat,String toFormat){
  SimpleDateFormat from=new SimpleDateFormat(fromFormat,Locale.getDefault());
  SimpleDateFormat to=new SimpleDateFormat(toFormat,Locale.getDefault());
  try {
    Date date=from.parse(timestamp);
    return to.format(date);
  }
 catch (  ParseException e) {
    AppLog.e(T.STATS,e);
  }
  return "String_Node_Str";
}
Program: 13471
Project: 13471
Buggy source:
private String getDateForDisplayInLabels(String date,StatsTimeframe timeframe){
  String prefix=getString(R.string.stats_for);
switch (timeframe) {
case DAY:
    return String.format(prefix,StatsUtils.parseDate(date,StatsConstants.STATS_INPUT_DATE_FORMAT,StatsConstants.STATS_OUTPUT_DATE_MONTH_LONG_DAY_SHORT_FORMAT));
case WEEK:
  try {
    SimpleDateFormat sdf=new SimpleDateFormat(StatsConstants.STATS_INPUT_DATE_FORMAT);
    final Date parsedDate=sdf.parse(date);
    Calendar c=Calendar.getInstance();
    c.setTime(parsedDate);
    String endDateLabel=StatsUtils.msToString(c.getTimeInMillis(),StatsConstants.STATS_OUTPUT_DATE_MONTH_LONG_DAY_LONG_FORMAT);
    c.add(Calendar.DAY_OF_WEEK,-6);
    String startDateLabel=StatsUtils.msToString(c.getTimeInMillis(),StatsConstants.STATS_OUTPUT_DATE_MONTH_LONG_DAY_LONG_FORMAT);
    return String.format(prefix,startDateLabel + "String_Node_Str" + endDateLabel);
  }
 catch (  ParseException e) {
    AppLog.e(AppLog.T.UTILS,e);
    return "String_Node_Str";
  }
case MONTH:
return String.format(prefix,StatsUtils.parseDate(date,StatsConstants.STATS_INPUT_DATE_FORMAT,StatsConstants.STATS_OUTPUT_DATE_MONTH_LONG_FORMAT));
case YEAR:
return String.format(prefix,StatsUtils.parseDate(date,StatsConstants.STATS_INPUT_DATE_FORMAT,StatsConstants.STATS_OUTPUT_DATE_YEAR_FORMAT));
}
return "String_Node_Str";
}

Fixed version (ground truth):
private String getDateForDisplayInLabels(String date,StatsTimeframe timeframe){
  String prefix=getString(R.string.stats_for);
switch (timeframe) {
case DAY:
    return String.format(prefix,StatsUtils.parseDate(date,StatsConstants.STATS_INPUT_DATE_FORMAT,StatsConstants.STATS_OUTPUT_DATE_MONTH_LONG_DAY_SHORT_FORMAT));
case WEEK:
  try {
    SimpleDateFormat sdf=new SimpleDateFormat(StatsConstants.STATS_INPUT_DATE_FORMAT,Locale.getDefault());
    final Date parsedDate=sdf.parse(date);
    Calendar c=Calendar.getInstance();
    c.setTime(parsedDate);
    String endDateLabel=StatsUtils.msToLocalizedString(c.getTimeInMillis(),StatsConstants.STATS_OUTPUT_DATE_MONTH_LONG_DAY_LONG_FORMAT);
    c.add(Calendar.DAY_OF_WEEK,-6);
    String startDateLabel=StatsUtils.msToLocalizedString(c.getTimeInMillis(),StatsConstants.STATS_OUTPUT_DATE_MONTH_LONG_DAY_LONG_FORMAT);
    return String.format(prefix,startDateLabel + "String_Node_Str" + endDateLabel);
  }
 catch (  ParseException e) {
    AppLog.e(AppLog.T.UTILS,e);
    return "String_Node_Str";
  }
case MONTH:
return String.format(prefix,StatsUtils.parseDate(date,StatsConstants.STATS_INPUT_DATE_FORMAT,StatsConstants.STATS_OUTPUT_DATE_MONTH_LONG_FORMAT));
case YEAR:
return String.format(prefix,StatsUtils.parseDate(date,StatsConstants.STATS_INPUT_DATE_FORMAT,StatsConstants.STATS_OUTPUT_DATE_YEAR_FORMAT));
}
return "String_Node_Str";
}
Program: 13472
Project: 13472
Buggy source:
private String getDateForDisplayInLabels(String date,StatsTimeframe timeframe){
  String prefix=getString(R.string.stats_for);
switch (timeframe) {
case DAY:
    return String.format(prefix,StatsUtils.parseDate(date,StatsConstants.STATS_INPUT_DATE_FORMAT,StatsConstants.STATS_OUTPUT_DATE_MONTH_LONG_DAY_SHORT_FORMAT));
case WEEK:
  try {
    SimpleDateFormat sdf;
    Calendar c;
    final Date parsedDate;
    sdf=new SimpleDateFormat("String_Node_Str");
    parsedDate=sdf.parse(date);
    c=Calendar.getInstance();
    c.setFirstDayOfWeek(Calendar.MONDAY);
    c.setTime(parsedDate);
    c.set(Calendar.DAY_OF_WEEK,Calendar.MONDAY);
    String startDateLabel=StatsUtils.msToString(c.getTimeInMillis(),StatsConstants.STATS_OUTPUT_DATE_MONTH_LONG_DAY_LONG_FORMAT);
    c.add(Calendar.DAY_OF_WEEK,+6);
    String endDateLabel=StatsUtils.msToString(c.getTimeInMillis(),StatsConstants.STATS_OUTPUT_DATE_MONTH_LONG_DAY_LONG_FORMAT);
    return String.format(prefix,startDateLabel + "String_Node_Str" + endDateLabel);
  }
 catch (  ParseException e) {
    AppLog.e(AppLog.T.UTILS,e);
    return "String_Node_Str";
  }
case MONTH:
return String.format(prefix,StatsUtils.parseDate(date,StatsConstants.STATS_INPUT_DATE_FORMAT,StatsConstants.STATS_OUTPUT_DATE_MONTH_LONG_FORMAT));
case YEAR:
return String.format(prefix,StatsUtils.parseDate(date,StatsConstants.STATS_INPUT_DATE_FORMAT,StatsConstants.STATS_OUTPUT_DATE_YEAR_FORMAT));
}
return "String_Node_Str";
}

Fixed version (ground truth):
private String getDateForDisplayInLabels(String date,StatsTimeframe timeframe){
  String prefix=getString(R.string.stats_for);
switch (timeframe) {
case DAY:
    return String.format(prefix,StatsUtils.parseDate(date,StatsConstants.STATS_INPUT_DATE_FORMAT,StatsConstants.STATS_OUTPUT_DATE_MONTH_LONG_DAY_SHORT_FORMAT));
case WEEK:
  try {
    SimpleDateFormat sdf;
    Calendar c;
    final Date parsedDate;
    sdf=new SimpleDateFormat("String_Node_Str",Locale.ROOT);
    parsedDate=sdf.parse(date);
    c=Calendar.getInstance();
    c.setFirstDayOfWeek(Calendar.MONDAY);
    c.setTime(parsedDate);
    c.set(Calendar.DAY_OF_WEEK,Calendar.MONDAY);
    String startDateLabel=StatsUtils.msToLocalizedString(c.getTimeInMillis(),StatsConstants.STATS_OUTPUT_DATE_MONTH_LONG_DAY_LONG_FORMAT);
    c.add(Calendar.DAY_OF_WEEK,+6);
    String endDateLabel=StatsUtils.msToLocalizedString(c.getTimeInMillis(),StatsConstants.STATS_OUTPUT_DATE_MONTH_LONG_DAY_LONG_FORMAT);
    return String.format(prefix,startDateLabel + "String_Node_Str" + endDateLabel);
  }
 catch (  ParseException e) {
    AppLog.e(AppLog.T.UTILS,e);
    return "String_Node_Str";
  }
case MONTH:
return String.format(prefix,StatsUtils.parseDate(date,StatsConstants.STATS_INPUT_DATE_FORMAT,StatsConstants.STATS_OUTPUT_DATE_MONTH_LONG_FORMAT));
case YEAR:
return String.format(prefix,StatsUtils.parseDate(date,StatsConstants.STATS_INPUT_DATE_FORMAT,StatsConstants.STATS_OUTPUT_DATE_YEAR_FORMAT));
}
return "String_Node_Str";
}
Program: 13475
Project: 13475
Buggy source:
public WPLinearLayoutSizeBound(Context context,AttributeSet attrs){
  super(context,attrs);
  TypedArray a=getContext().obtainStyledAttributes(attrs,R.styleable.WPLinearLayoutSizeBound);
  mMaxWidth=a.getDimensionPixelSize(R.styleable.WPLinearLayoutSizeBound_maxWidth,Integer.MAX_VALUE);
  mMaxHeight=a.getDimensionPixelSize(R.styleable.WPLinearLayoutSizeBound_maxHeight,Integer.MAX_VALUE);
}

Fixed version (ground truth):
public WPLinearLayoutSizeBound(Context context,AttributeSet attrs){
  super(context,attrs);
  TypedArray a=getContext().obtainStyledAttributes(attrs,R.styleable.WPLinearLayoutSizeBound);
  mMaxWidth=a.getDimensionPixelSize(R.styleable.WPLinearLayoutSizeBound_maxWidth,Integer.MAX_VALUE);
  mMaxHeight=a.getDimensionPixelSize(R.styleable.WPLinearLayoutSizeBound_maxHeight,Integer.MAX_VALUE);
  a.recycle();
}
Program: 13476
Project: 13476
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View view=inflater.inflate(R.layout.plugin_list_fragment,container,false);
  mRecycler=view.findViewById(R.id.recycler);
  mRecycler.setLayoutManager(new LinearLayoutManager(getActivity(),LinearLayoutManager.VERTICAL,false));
  mRecycler.addItemDecoration(new DividerItemDecoration(getActivity(),DividerItemDecoration.VERTICAL_LIST));
  mSwipeToRefreshHelper=buildSwipeToRefreshHelper((CustomSwipeRefreshLayout)view.findViewById(R.id.ptr_layout),new SwipeToRefreshHelper.RefreshListener(){
    @Override public void onRefreshStarted(){
      mViewModel.pullToRefresh(mListType);
    }
  }
);
  return view;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View view=inflater.inflate(R.layout.plugin_list_fragment,container,false);
  mRecycler=view.findViewById(R.id.recycler);
  mRecycler.setLayoutManager(new LinearLayoutManager(getActivity(),LinearLayoutManager.VERTICAL,false));
  mRecycler.addItemDecoration(new DividerItemDecoration(getActivity(),DividerItemDecoration.VERTICAL));
  mSwipeToRefreshHelper=buildSwipeToRefreshHelper((CustomSwipeRefreshLayout)view.findViewById(R.id.ptr_layout),new SwipeToRefreshHelper.RefreshListener(){
    @Override public void onRefreshStarted(){
      mViewModel.pullToRefresh(mListType);
    }
  }
);
  return view;
}
Program: 13478
Project: 13478
Buggy source:
private ViewGroup buttonizeUsername(final String username){
  if (!isAdded()) {
    return null;
  }
  final ViewGroup usernameButton=(ViewGroup)LayoutInflater.from(getActivity()).inflate(R.layout.invite_username_button,null);
  final TextView usernameTextView=(TextView)usernameButton.findViewById(R.id.username);
  usernameTextView.setText(username);
  mUsernamesContainer.addView(usernameButton,mUsernamesContainer.getChildCount() - 1);
  final ImageButton delete=(ImageButton)usernameButton.findViewById(R.id.username_delete);
  delete.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      removeUsername(username);
    }
  }
);
  return usernameButton;
}

Fixed version (ground truth):
private ViewGroup buttonizeUsername(final String username){
  if (!isAdded()) {
    return null;
  }
  final ViewGroup usernameButton=(ViewGroup)LayoutInflater.from(getActivity()).inflate(R.layout.invite_username_button,mUsernamesContainer,false);
  final TextView usernameTextView=(TextView)usernameButton.findViewById(R.id.username);
  usernameTextView.setText(username);
  mUsernamesContainer.addView(usernameButton,mUsernamesContainer.getChildCount() - 1);
  final ImageButton delete=(ImageButton)usernameButton.findViewById(R.id.username_delete);
  delete.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      removeUsername(username);
    }
  }
);
  return usernameButton;
}
Program: 13479
Project: 13479
Buggy source:
private void updateUsernameError(String username,@Nullable String usernameResult){
  if (!isAdded()) {
    return;
  }
  TextView usernameErrorTextView;
  if (mUsernameErrorViews.containsKey(username)) {
    usernameErrorTextView=(TextView)mUsernameErrorViews.get(username);
    if (usernameResult == null || usernameResult.equals(FLAG_SUCCESS)) {
      ((ViewGroup)usernameErrorTextView.getParent()).removeView(usernameErrorTextView);
      mUsernameErrorViews.remove(username);
      return;
    }
  }
 else {
    if (usernameResult == null || usernameResult.equals(FLAG_SUCCESS)) {
      return;
    }
    usernameErrorTextView=(TextView)LayoutInflater.from(getActivity()).inflate(R.layout.people_invite_error_view,null);
    final ViewGroup usernameErrorsContainer=(ViewGroup)getView().findViewById(R.id.username_errors_container);
    usernameErrorsContainer.addView(usernameErrorTextView);
    mUsernameErrorViews.put(username,usernameErrorTextView);
  }
  usernameErrorTextView.setText(usernameResult);
}

Fixed version (ground truth):
private void updateUsernameError(String username,@Nullable String usernameResult){
  if (!isAdded()) {
    return;
  }
  TextView usernameErrorTextView;
  if (mUsernameErrorViews.containsKey(username)) {
    usernameErrorTextView=(TextView)mUsernameErrorViews.get(username);
    if (usernameResult == null || usernameResult.equals(FLAG_SUCCESS)) {
      ((ViewGroup)usernameErrorTextView.getParent()).removeView(usernameErrorTextView);
      mUsernameErrorViews.remove(username);
      return;
    }
  }
 else {
    if (usernameResult == null || usernameResult.equals(FLAG_SUCCESS)) {
      return;
    }
    final ViewGroup usernameErrorsContainer=(ViewGroup)getView().findViewById(R.id.username_errors_container);
    usernameErrorTextView=(TextView)LayoutInflater.from(getActivity()).inflate(R.layout.people_invite_error_view,usernameErrorsContainer,false);
    usernameErrorsContainer.addView(usernameErrorTextView);
    mUsernameErrorViews.put(username,usernameErrorTextView);
  }
  usernameErrorTextView.setText(usernameResult);
}
Program: 13481
Project: 13481
Buggy source:
public static String getLongLikeLabelText(Context context,int numLikes,boolean isLikedByCurrentUser){
  if (isLikedByCurrentUser) {
switch (numLikes) {
case 1:
      return context.getString(R.string.reader_likes_only_you);
case 2:
    return context.getString(R.string.reader_likes_you_and_one);
default :
  String youAndMultiLikes=context.getString(R.string.reader_likes_you_and_multi);
return String.format(youAndMultiLikes,numLikes - 1);
}
}
 else {
if (numLikes == 1) {
return context.getString(R.string.reader_likes_one);
}
 else {
String likes=context.getString(R.string.reader_likes_multi);
return String.format(LocaleManager.getSafeLocale(context),likes,numLikes);
}
}
}

Fixed version (ground truth):
public static String getLongLikeLabelText(Context context,int numLikes,boolean isLikedByCurrentUser){
  if (isLikedByCurrentUser) {
switch (numLikes) {
case 1:
      return context.getString(R.string.reader_likes_only_you);
case 2:
    return context.getString(R.string.reader_likes_you_and_one);
default :
  String youAndMultiLikes=context.getString(R.string.reader_likes_you_and_multi);
return String.format(LocaleManager.getSafeLocale(context),youAndMultiLikes,numLikes - 1);
}
}
 else {
if (numLikes == 1) {
return context.getString(R.string.reader_likes_one);
}
 else {
String likes=context.getString(R.string.reader_likes_multi);
return String.format(LocaleManager.getSafeLocale(context),likes,numLikes);
}
}
}
Program: 13483
Project: 13483
Buggy source:
private static void purge(){
  SQLiteDatabase db=getWritableDb();
  db.beginTransaction();
  try {
    int numPostsDeleted=ReaderPostTable.purge(db);
    if (numPostsDeleted > 0) {
      AppLog.i(T.READER,String.format("String_Node_Str",numPostsDeleted));
      int numCommentsDeleted=ReaderCommentTable.purge(db);
      if (numCommentsDeleted > 0) {
        AppLog.i(T.READER,String.format("String_Node_Str",numCommentsDeleted));
      }
      int numLikesDeleted=ReaderLikeTable.purge(db);
      if (numLikesDeleted > 0) {
        AppLog.i(T.READER,String.format("String_Node_Str",numLikesDeleted));
      }
      int numThumbsPurged=ReaderThumbnailTable.purge(db);
      if (numThumbsPurged > 0) {
        AppLog.i(T.READER,String.format("String_Node_Str",numThumbsPurged));
      }
    }
    db.setTransactionSuccessful();
  }
  finally {
    db.endTransaction();
  }
}

Fixed version (ground truth):
private static void purge(){
  SQLiteDatabase db=getWritableDb();
  db.beginTransaction();
  try {
    int numPostsDeleted=ReaderPostTable.purge(db);
    if (numPostsDeleted > 0) {
      AppLog.i(T.READER,String.format(Locale.ENGLISH,"String_Node_Str",numPostsDeleted));
      int numCommentsDeleted=ReaderCommentTable.purge(db);
      if (numCommentsDeleted > 0) {
        AppLog.i(T.READER,String.format(Locale.ENGLISH,"String_Node_Str",numCommentsDeleted));
      }
      int numLikesDeleted=ReaderLikeTable.purge(db);
      if (numLikesDeleted > 0) {
        AppLog.i(T.READER,String.format(Locale.ENGLISH,"String_Node_Str",numLikesDeleted));
      }
      int numThumbsPurged=ReaderThumbnailTable.purge(db);
      if (numThumbsPurged > 0) {
        AppLog.i(T.READER,String.format(Locale.ENGLISH,"String_Node_Str",numThumbsPurged));
      }
    }
    db.setTransactionSuccessful();
  }
  finally {
    db.endTransaction();
  }
}
Program: 13484
Project: 13484
Buggy source:
public static void updateFollowedStatus(){
  SQLiteStatement statement=ReaderDatabase.getWritableDb().compileStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  try {
    int count=statement.executeUpdateDelete();
    if (count > 0) {
      AppLog.d(AppLog.T.READER,String.format("String_Node_Str",count));
    }
  }
  finally {
    statement.close();
  }
}

Fixed version (ground truth):
public static void updateFollowedStatus(){
  SQLiteStatement statement=ReaderDatabase.getWritableDb().compileStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  try {
    int count=statement.executeUpdateDelete();
    if (count > 0) {
      AppLog.d(AppLog.T.READER,String.format(Locale.ENGLISH,"String_Node_Str",count));
    }
  }
  finally {
    statement.close();
  }
}
Program: 13485
Project: 13485
Buggy source:
private static int purgePostsForTag(SQLiteDatabase db,ReaderTag tag){
  int numPosts=getNumPostsWithTag(tag);
  if (numPosts <= MAX_POSTS_PER_TAG) {
    return 0;
  }
  String[] args={tag.getTagSlug(),Integer.toString(tag.tagType.toInt()),Integer.toString(MAX_POSTS_PER_TAG)};
  String where="String_Node_Str" + "String_Node_Str" + getSortColumnForTag(tag) + "String_Node_Str";
  int numDeleted=db.delete("String_Node_Str",where,args);
  AppLog.d(AppLog.T.READER,String.format("String_Node_Str",numDeleted,tag.getTagNameForLog()));
  return numDeleted;
}

Fixed version (ground truth):
private static int purgePostsForTag(SQLiteDatabase db,ReaderTag tag){
  int numPosts=getNumPostsWithTag(tag);
  if (numPosts <= MAX_POSTS_PER_TAG) {
    return 0;
  }
  String[] args={tag.getTagSlug(),Integer.toString(tag.tagType.toInt()),Integer.toString(MAX_POSTS_PER_TAG)};
  String where="String_Node_Str" + "String_Node_Str" + getSortColumnForTag(tag) + "String_Node_Str";
  int numDeleted=db.delete("String_Node_Str",where,args);
  AppLog.d(AppLog.T.READER,String.format(Locale.ENGLISH,"String_Node_Str",numDeleted,tag.getTagNameForLog()));
  return numDeleted;
}
Program: 13486
Project: 13486
Buggy source:
@Override public String getLabel(){
  if (isTagDisplayNameAlphaNumeric()) {
    return getTagDisplayName().toLowerCase();
  }
 else   if (hasTagTitle()) {
    return getTagTitle();
  }
 else {
    return getTagDisplayName();
  }
}

Fixed version (ground truth):
@Override public String getLabel(){
  if (isTagDisplayNameAlphaNumeric()) {
    return getTagDisplayName().toLowerCase(Locale.ROOT);
  }
 else   if (hasTagTitle()) {
    return getTagTitle();
  }
 else {
    return getTagDisplayName();
  }
}
Program: 13487
Project: 13487
Buggy source:
public boolean isTagTopic(){
  String endpoint=getEndpoint();
  return endpoint.toLowerCase().contains("String_Node_Str");
}

Fixed version (ground truth):
public boolean isTagTopic(){
  String endpoint=getEndpoint();
  return endpoint.toLowerCase(Locale.ROOT).contains("String_Node_Str");
}
Program: 13488
Project: 13488
Buggy source:
public boolean isListTopic(){
  String endpoint=getEndpoint();
  return endpoint.toLowerCase().contains("String_Node_Str");
}

Fixed version (ground truth):
public boolean isListTopic(){
  String endpoint=getEndpoint();
  return endpoint.toLowerCase(Locale.ROOT).contains("String_Node_Str");
}
Program: 13490
Project: 13490
Buggy source:
protected void lowerCaseEditable(Editable editable){
  String lowerCase=editable.toString().toLowerCase();
  if (!lowerCase.equals(editable.toString())) {
    editable.replace(0,editable.length(),lowerCase);
  }
}

Fixed version (ground truth):
protected void lowerCaseEditable(Editable editable){
  String lowerCase=editable.toString().toLowerCase(Locale.getDefault());
  if (!lowerCase.equals(editable.toString())) {
    editable.replace(0,editable.length(),lowerCase);
  }
}
Program: 13491
Project: 13491
Buggy source:
/** 
 * Create a display name from the email address by taking everything before the "@" symbol, removing all non-letters and non-periods, replacing periods with spaces, and capitalizing the first letter of each word.
 * @return {@link String} to be the display name
 */
private String createDisplayNameFromEmail(){
  String username=mEmailAddress.split("String_Node_Str")[0].replaceAll("String_Node_Str","String_Node_Str");
  String[] array=username.split("String_Node_Str");
  StringBuilder builder=new StringBuilder();
  for (  String s : array) {
    String capitalized=s.substring(0,1).toUpperCase() + s.substring(1);
    builder.append(capitalized.concat("String_Node_Str"));
  }
  return builder.toString().trim();
}

Fixed version (ground truth):
/** 
 * Create a display name from the email address by taking everything before the "@" symbol, removing all non-letters and non-periods, replacing periods with spaces, and capitalizing the first letter of each word.
 * @return {@link String} to be the display name
 */
private String createDisplayNameFromEmail(){
  String username=mEmailAddress.split("String_Node_Str")[0].replaceAll("String_Node_Str","String_Node_Str");
  String[] array=username.split("String_Node_Str");
  StringBuilder builder=new StringBuilder();
  for (  String s : array) {
    String capitalized=s.substring(0,1).toUpperCase(Locale.getDefault()) + s.substring(1);
    builder.append(capitalized.concat("String_Node_Str"));
  }
  return builder.toString().trim();
}
Program: 13492
Project: 13492
Buggy source:
/** 
 * Create a username from the email address by taking everything before the "@" symbol and removing all non-alphanumeric characters.
 * @return {@link String} to be the username
 */
private String createUsernameFromEmail(){
  return mEmailAddress.split("String_Node_Str")[0].replaceAll("String_Node_Str","String_Node_Str").toLowerCase();
}

Fixed version (ground truth):
/** 
 * Create a username from the email address by taking everything before the "@" symbol and removing all non-alphanumeric characters.
 * @return {@link String} to be the username
 */
private String createUsernameFromEmail(){
  return mEmailAddress.split("String_Node_Str")[0].replaceAll("String_Node_Str","String_Node_Str").toLowerCase(Locale.ROOT);
}
Program: 13493
Project: 13493
Buggy source:
private String getUsernameQueryFromDisplayName(){
  return mDisplayName.replace("String_Node_Str","String_Node_Str").toLowerCase();
}

Fixed version (ground truth):
private String getUsernameQueryFromDisplayName(){
  return mDisplayName.replace("String_Node_Str","String_Node_Str").toLowerCase(Locale.ROOT);
}
Program: 13495
Project: 13495
Buggy source:
private SiteList filteredSitesByText(SiteList sites){
  SiteList filteredSiteList=new SiteList();
  for (int i=0; i < sites.size(); i++) {
    SiteRecord record=sites.get(i);
    String siteNameLowerCase=record.mBlogName.toLowerCase();
    String hostNameLowerCase=record.mHomeURL.toLowerCase();
    if (siteNameLowerCase.contains(mLastSearch.toLowerCase()) || hostNameLowerCase.contains(mLastSearch.toLowerCase())) {
      filteredSiteList.add(record);
    }
  }
  return filteredSiteList;
}

Fixed version (ground truth):
private SiteList filteredSitesByText(SiteList sites){
  SiteList filteredSiteList=new SiteList();
  for (int i=0; i < sites.size(); i++) {
    SiteRecord record=sites.get(i);
    String siteNameLowerCase=record.mBlogName.toLowerCase(Locale.getDefault());
    String hostNameLowerCase=record.mHomeURL.toLowerCase(Locale.ROOT);
    if (siteNameLowerCase.contains(mLastSearch.toLowerCase(Locale.getDefault())) || hostNameLowerCase.contains(mLastSearch.toLowerCase(Locale.ROOT))) {
      filteredSiteList.add(record);
    }
  }
  return filteredSiteList;
}
Program: 13496
Project: 13496
Buggy source:
private void deleteMedia(final ArrayList<Integer> ids){
  final ArrayList<MediaModel> mediaToDelete=new ArrayList<>();
  int processedItemCount=0;
  for (  int currentId : ids) {
    MediaModel mediaModel=mMediaStore.getMediaWithLocalId(currentId);
    if (mediaModel == null) {
      continue;
    }
    if (UploadService.isPendingOrInProgressMediaUpload(mediaModel)) {
      MediaStore.CancelMediaPayload payload=new MediaStore.CancelMediaPayload(mSite,mediaModel,false);
      mDispatcher.dispatch(MediaActionBuilder.newCancelMediaUploadAction(payload));
    }
    if (mediaModel.getUploadState() != null && MediaUtils.isLocalFile(mediaModel.getUploadState().toLowerCase())) {
      mDispatcher.dispatch(MediaActionBuilder.newRemoveMediaAction(mediaModel));
    }
 else {
      mediaToDelete.add(mediaModel);
      mediaModel.setUploadState(MediaUploadState.DELETING);
      mDispatcher.dispatch(MediaActionBuilder.newUpdateMediaAction(mediaModel));
    }
    processedItemCount++;
  }
  if (processedItemCount != ids.size()) {
    ToastUtils.showToast(this,R.string.cannot_delete_multi_media_items,ToastUtils.Duration.LONG);
  }
  if (!mediaToDelete.isEmpty()) {
    startMediaDeleteService(mediaToDelete);
  }
}

Fixed version (ground truth):
private void deleteMedia(final ArrayList<Integer> ids){
  final ArrayList<MediaModel> mediaToDelete=new ArrayList<>();
  int processedItemCount=0;
  for (  int currentId : ids) {
    MediaModel mediaModel=mMediaStore.getMediaWithLocalId(currentId);
    if (mediaModel == null) {
      continue;
    }
    if (UploadService.isPendingOrInProgressMediaUpload(mediaModel)) {
      MediaStore.CancelMediaPayload payload=new MediaStore.CancelMediaPayload(mSite,mediaModel,false);
      mDispatcher.dispatch(MediaActionBuilder.newCancelMediaUploadAction(payload));
    }
    if (mediaModel.getUploadState() != null && MediaUtils.isLocalFile(mediaModel.getUploadState().toLowerCase(Locale.ROOT))) {
      mDispatcher.dispatch(MediaActionBuilder.newRemoveMediaAction(mediaModel));
    }
 else {
      mediaToDelete.add(mediaModel);
      mediaModel.setUploadState(MediaUploadState.DELETING);
      mDispatcher.dispatch(MediaActionBuilder.newUpdateMediaAction(mediaModel));
    }
    processedItemCount++;
  }
  if (processedItemCount != ids.size()) {
    ToastUtils.showToast(this,R.string.cannot_delete_multi_media_items,ToastUtils.Duration.LONG);
  }
  if (!mediaToDelete.isEmpty()) {
    startMediaDeleteService(mediaToDelete);
  }
}
Program: 13499
Project: 13499
Buggy source:
private void definitelyDeleteBackspaceDeletedMediaItems(){
  for (  String mediaId : mAztecBackspaceDeletedMediaItemIds) {
    if (!TextUtils.isEmpty(mediaId)) {
      MediaModel mediaModel=mMediaStore.getMediaWithLocalId(StringUtils.stringToInt(mediaId));
      if (mediaModel == null) {
        continue;
      }
      if (mediaModel.getUploadState() != null && MediaUtils.isLocalFile(mediaModel.getUploadState().toLowerCase()) && !UploadService.isPendingOrInProgressMediaUpload(mediaModel)) {
        mDispatcher.dispatch(MediaActionBuilder.newRemoveMediaAction(mediaModel));
      }
    }
  }
}

Fixed version (ground truth):
private void definitelyDeleteBackspaceDeletedMediaItems(){
  for (  String mediaId : mAztecBackspaceDeletedMediaItemIds) {
    if (!TextUtils.isEmpty(mediaId)) {
      MediaModel mediaModel=mMediaStore.getMediaWithLocalId(StringUtils.stringToInt(mediaId));
      if (mediaModel == null) {
        continue;
      }
      if (mediaModel.getUploadState() != null && MediaUtils.isLocalFile(mediaModel.getUploadState().toLowerCase(Locale.ROOT)) && !UploadService.isPendingOrInProgressMediaUpload(mediaModel)) {
        mDispatcher.dispatch(MediaActionBuilder.newRemoveMediaAction(mediaModel));
      }
    }
  }
}
Program: 13500
Project: 13500
Buggy source:
public void filter(final String text){
  final List<TermModel> allTags=mAllTags;
  new Thread(new Runnable(){
    @Override public void run(){
      final List<TermModel> filteredTags=new ArrayList<>();
      if (TextUtils.isEmpty(text)) {
        filteredTags.addAll(allTags);
      }
 else {
        for (        TermModel tag : allTags) {
          if (tag.getName().toLowerCase().contains(text.toLowerCase())) {
            filteredTags.add(tag);
          }
        }
      }
      ((Activity)mContext).runOnUiThread(new Runnable(){
        @Override public void run(){
          mFilteredTags=filteredTags;
          notifyDataSetChanged();
        }
      }
);
    }
  }
).start();
}

Fixed version (ground truth):
public void filter(final String text){
  final List<TermModel> allTags=mAllTags;
  new Thread(new Runnable(){
    @Override public void run(){
      final List<TermModel> filteredTags=new ArrayList<>();
      if (TextUtils.isEmpty(text)) {
        filteredTags.addAll(allTags);
      }
 else {
        for (        TermModel tag : allTags) {
          if (tag.getName().toLowerCase(Locale.getDefault()).contains(text.toLowerCase(Locale.getDefault()))) {
            filteredTags.add(tag);
          }
        }
      }
      ((Activity)mContext).runOnUiThread(new Runnable(){
        @Override public void run(){
          mFilteredTags=filteredTags;
          notifyDataSetChanged();
        }
      }
);
    }
  }
).start();
}
Program: 13501
Project: 13501
Buggy source:
private void retrieveSiteDomain(){
  Bundle args=getArguments();
  mSiteDomain=getString(R.string.wordpress_dot_com).toLowerCase();
  if (args != null) {
    mSiteDomain=args.getString(SITE_DOMAIN_KEY);
  }
}

Fixed version (ground truth):
private void retrieveSiteDomain(){
  Bundle args=getArguments();
  mSiteDomain=getString(R.string.wordpress_dot_com).toLowerCase(Locale.ROOT);
  if (args != null) {
    mSiteDomain=args.getString(SITE_DOMAIN_KEY);
  }
}
Program: 13502
Project: 13502
Buggy source:
private boolean isUrlConfirmationTextValid(){
  String confirmationText=mUrlConfirmation.getText().toString().trim().toLowerCase();
  String hintText=mSiteDomain.toLowerCase();
  return confirmationText.equals(hintText);
}

Fixed version (ground truth):
private boolean isUrlConfirmationTextValid(){
  String confirmationText=mUrlConfirmation.getText().toString().trim().toLowerCase(Locale.ROOT);
  String hintText=mSiteDomain.toLowerCase(Locale.ROOT);
  return confirmationText.equals(hintText);
}
Program: 13504
Project: 13504
Buggy source:
public void setSharingButtonStyle(String sharingButtonStyle){
  if (TextUtils.isEmpty(sharingButtonStyle)) {
    mSettings.sharingButtonStyle=STANDARD_SHARING_BUTTON_STYLE;
  }
 else {
    mSettings.sharingButtonStyle=sharingButtonStyle.toLowerCase();
  }
}

Fixed version (ground truth):
public void setSharingButtonStyle(String sharingButtonStyle){
  if (TextUtils.isEmpty(sharingButtonStyle)) {
    mSettings.sharingButtonStyle=STANDARD_SHARING_BUTTON_STYLE;
  }
 else {
    mSettings.sharingButtonStyle=sharingButtonStyle.toLowerCase(Locale.ROOT);
  }
}
Program: 13505
Project: 13505
Buggy source:
/** 
 * Sets the default post format.
 * @param format if null or empty default format is set to {@link SiteSettingsInterface#STANDARD_POST_FORMAT_KEY}
 */
public void setDefaultFormat(String format){
  if (TextUtils.isEmpty(format)) {
    mSettings.defaultPostFormat=STANDARD_POST_FORMAT_KEY;
  }
 else {
    mSettings.defaultPostFormat=format.toLowerCase();
  }
}

Fixed version (ground truth):
/** 
 * Sets the default post format.
 * @param format if null or empty default format is set to {@link SiteSettingsInterface#STANDARD_POST_FORMAT_KEY}
 */
public void setDefaultFormat(String format){
  if (TextUtils.isEmpty(format)) {
    mSettings.defaultPostFormat=STANDARD_POST_FORMAT_KEY;
  }
 else {
    mSettings.defaultPostFormat=format.toLowerCase(Locale.ROOT);
  }
}
Program: 13506
Project: 13506
Buggy source:
public void filter(final String text){
  mFilteredTags.clear();
  if (TextUtils.isEmpty(text)) {
    mFilteredTags.addAll(mAllTags);
  }
 else {
    for (    TermModel tag : mAllTags) {
      if (tag.getName().toLowerCase().contains(text.toLowerCase())) {
        mFilteredTags.add(tag);
      }
    }
  }
  notifyDataSetChanged();
  showEmptyView(mFilteredTags.isEmpty());
}

Fixed version (ground truth):
public void filter(final String text){
  mFilteredTags.clear();
  if (TextUtils.isEmpty(text)) {
    mFilteredTags.addAll(mAllTags);
  }
 else {
    for (    TermModel tag : mAllTags) {
      if (tag.getName().toLowerCase(Locale.getDefault()).contains(text.toLowerCase(Locale.getDefault()))) {
        mFilteredTags.add(tag);
      }
    }
  }
  notifyDataSetChanged();
  showEmptyView(mFilteredTags.isEmpty());
}
Program: 13507
Project: 13507
Buggy source:
private void loadImage(String mediaUri){
  if (TextUtils.isEmpty(mediaUri)) {
    showLoadingError();
    return;
  }
  mImageView.setVisibility(View.VISIBLE);
  int width=DisplayUtils.getDisplayPixelWidth(getActivity());
  int height=DisplayUtils.getDisplayPixelHeight(getActivity());
  int size=Math.max(width,height);
  if (mediaUri.startsWith("String_Node_Str")) {
    showProgress(true);
    String imageUrl=mediaUri;
    if (SiteUtils.isPhotonCapable(mSite)) {
      imageUrl=PhotonUtils.getPhotonImageUrl(mediaUri,size,0);
    }
    mImageLoader.get(imageUrl,new ImageLoader.ImageListener(){
      @Override public void onResponse(      ImageLoader.ImageContainer response,      boolean isImmediate){
        if (isAdded() && response.getBitmap() != null) {
          showProgress(false);
          setBitmap(response.getBitmap());
        }
      }
      @Override public void onErrorResponse(      VolleyError error){
        AppLog.e(AppLog.T.MEDIA,error);
        if (isAdded()) {
          showProgress(false);
          showLoadingError();
        }
      }
    }
,size,0);
  }
 else {
    new LocalImageTask(mediaUri,size).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
  }
}

Fixed version (ground truth):
private void loadImage(String mediaUri){
  if (TextUtils.isEmpty(mediaUri)) {
    showLoadingError();
    return;
  }
  mImageView.setVisibility(View.VISIBLE);
  int width=DisplayUtils.getDisplayPixelWidth(getActivity());
  int height=DisplayUtils.getDisplayPixelHeight(getActivity());
  int size=Math.max(width,height);
  if (mediaUri.startsWith("String_Node_Str")) {
    showProgress(true);
    String imageUrl=mediaUri;
    if (mSite == null || SiteUtils.isPhotonCapable(mSite)) {
      imageUrl=PhotonUtils.getPhotonImageUrl(mediaUri,size,0);
    }
    mImageLoader.get(imageUrl,new ImageLoader.ImageListener(){
      @Override public void onResponse(      ImageLoader.ImageContainer response,      boolean isImmediate){
        if (isAdded() && response.getBitmap() != null) {
          showProgress(false);
          setBitmap(response.getBitmap());
        }
      }
      @Override public void onErrorResponse(      VolleyError error){
        AppLog.e(AppLog.T.MEDIA,error);
        if (isAdded()) {
          showProgress(false);
          showLoadingError();
        }
      }
    }
,size,0);
  }
 else {
    new LocalImageTask(mediaUri,size).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
  }
}
Program: 13508
Project: 13508
Buggy source:
/** 
 * @param site optional site this media is associated with
 * @param media media model
 * @param autoPlay true = play video/audio after fragment is created
 */
public static MediaPreviewFragment newInstance(SiteModel site,MediaModel media,boolean autoPlay){
  Bundle args=new Bundle();
  args.putString(ARG_MEDIA_CONTENT_URI,media.getUrl());
  args.putString(ARG_TITLE,media.getTitle());
  args.putBoolean(ARG_AUTOPLAY,autoPlay);
  if (site != null) {
    args.putSerializable(WordPress.SITE,site);
  }
  if (media.isVideo() && !TextUtils.isEmpty(media.getThumbnailUrl())) {
    args.putString(ARG_VIDEO_THUMB,media.getThumbnailUrl());
  }
  MediaPreviewFragment fragment=new MediaPreviewFragment();
  fragment.setArguments(args);
  return fragment;
}

Fixed version (ground truth):
/** 
 * @param site optional site this media is associated with
 * @param media media model
 * @param autoPlay true = play video/audio after fragment is created
 */
public static MediaPreviewFragment newInstance(@Nullable SiteModel site,@NonNull MediaModel media,boolean autoPlay){
  Bundle args=new Bundle();
  args.putString(ARG_MEDIA_CONTENT_URI,media.getUrl());
  args.putString(ARG_TITLE,media.getTitle());
  args.putBoolean(ARG_AUTOPLAY,autoPlay);
  if (site != null) {
    args.putSerializable(WordPress.SITE,site);
  }
  if (media.isVideo() && !TextUtils.isEmpty(media.getThumbnailUrl())) {
    args.putString(ARG_VIDEO_THUMB,media.getThumbnailUrl());
  }
  MediaPreviewFragment fragment=new MediaPreviewFragment();
  fragment.setArguments(args);
  return fragment;
}
Program: 13510
Project: 13510
Buggy source:
@Override protected WebViewClient createWebViewClient(List<String> allowedURL){
  mWebViewClient=new JetpackConnectionWebViewClient(this,mAccountStore,(SiteModel)getIntent().getSerializableExtra(WordPress.SITE));
  return mWebViewClient;
}

Fixed version (ground truth):
@Override protected WebViewClient createWebViewClient(List<String> allowedURL){
  mWebViewClient=new JetpackConnectionWebViewClient(this,mAccountStore,mSite);
  return mWebViewClient;
}
Program: 13511
Project: 13511
Buggy source:
public void cancel(){
  if (!flowFinished) {
    AnalyticsTracker.track(AnalyticsTracker.Stat.STATS_CANCELED_INSTALL_JETPACK);
  }
}

Fixed version (ground truth):
public void cancel(){
  if (!mFlowFinished) {
    AnalyticsTracker.track(AnalyticsTracker.Stat.STATS_CANCELED_INSTALL_JETPACK);
  }
}
Program: 13512
Project: 13512
Buggy source:
public void onRestoreInstanceState(Bundle savedInstanceState){
  redirectPage=savedInstanceState.getString(REDIRECT_PAGE_STATE_ITEM);
  flowFinished=savedInstanceState.getBoolean(FLOW_FINISHED);
}

Fixed version (ground truth):
public void onRestoreInstanceState(Bundle savedInstanceState){
  mRedirectPage=savedInstanceState.getString(REDIRECT_PAGE_STATE_ITEM);
  mFlowFinished=savedInstanceState.getBoolean(FLOW_FINISHED);
}
Program: 13513
Project: 13513
Buggy source:
void activityResult(Context context,int requestCode){
  if (requestCode == JETPACK_LOGIN) {
    JetpackConnectionWebViewActivity.openJetpackConnectionFlow(context,redirectPage,mSiteModel);
    activity.finish();
  }
}

Fixed version (ground truth):
void activityResult(Context context,int requestCode){
  if (requestCode == JETPACK_LOGIN) {
    JetpackConnectionWebViewActivity.openJetpackConnectionFlow(context,mRedirectPage,mSiteModel);
    mActivity.finish();
  }
}
Program: 13515
Project: 13515
Buggy source:
public void onSaveInstanceState(Bundle outState){
  outState.putString(REDIRECT_PAGE_STATE_ITEM,redirectPage);
  outState.putBoolean(FLOW_FINISHED,flowFinished);
}

Fixed version (ground truth):
public void onSaveInstanceState(Bundle outState){
  outState.putString(REDIRECT_PAGE_STATE_ITEM,mRedirectPage);
  outState.putBoolean(FLOW_FINISHED,mFlowFinished);
}
Program: 13516
Project: 13516
Buggy source:
JetpackConnectionWebViewClient(Activity activity,AccountStore accountStore,SiteModel mSiteModel){
  this.activity=activity;
  this.accountStore=accountStore;
  this.mSiteModel=mSiteModel;
}

Fixed version (ground truth):
JetpackConnectionWebViewClient(Activity activity,AccountStore accountStore,SiteModel siteModel){
  mActivity=activity;
  mAccountStore=accountStore;
  mSiteModel=siteModel;
}
Program: 13517
Project: 13517
Buggy source:
private void loginToWPCom(WebView view,SiteModel site){
  String authenticationURL=WPWebViewActivity.getSiteLoginUrl(site);
  String postData=WPWebViewActivity.getAuthenticationPostData(authenticationURL,redirectPage,site.getUsername(),site.getPassword(),accountStore.getAccessToken());
  view.postUrl(authenticationURL,postData.getBytes());
}

Fixed version (ground truth):
private void loginToWPCom(WebView view,SiteModel site){
  String authenticationURL=WPWebViewActivity.getSiteLoginUrl(site);
  String postData=WPWebViewActivity.getAuthenticationPostData(authenticationURL,mRedirectPage,site.getUsername(),site.getPassword(),mAccountStore.getAccessToken());
  view.postUrl(authenticationURL,postData.getBytes());
}
Program: 13519
Project: 13519
Buggy source:
public WPLinearLayoutSizeBound(Context context,AttributeSet attrs){
  super(context,attrs);
  TypedArray a=getContext().obtainStyledAttributes(attrs,R.styleable.WPLinearLayoutSizeBound);
  mMaxWidth=a.getDimensionPixelSize(R.styleable.WPLinearLayoutSizeBound_maxWidth,Integer.MAX_VALUE);
  mMaxHeight=a.getDimensionPixelSize(R.styleable.WPLinearLayoutSizeBound_maxHeight,Integer.MAX_VALUE);
}

Fixed version (ground truth):
public WPLinearLayoutSizeBound(Context context,AttributeSet attrs){
  super(context,attrs);
  TypedArray a=getContext().obtainStyledAttributes(attrs,R.styleable.WPLinearLayoutSizeBound);
  mMaxWidth=a.getDimensionPixelSize(R.styleable.WPLinearLayoutSizeBound_maxWidth,Integer.MAX_VALUE);
  mMaxHeight=a.getDimensionPixelSize(R.styleable.WPLinearLayoutSizeBound_maxHeight,Integer.MAX_VALUE);
  a.recycle();
}
Program: 13520
Project: 13520
Buggy source:
private static Intent preparePictureLibraryIntent(String title,boolean multiSelect){
  Intent intent=new Intent(Intent.ACTION_GET_CONTENT);
  intent.setType("String_Node_Str");
  if (multiSelect) {
    intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE,true);
  }
  return Intent.createChooser(intent,title);
}

Fixed version (ground truth):
private static Intent preparePictureLibraryIntent(String title,boolean multiSelect){
  Intent intent=new Intent(Intent.ACTION_GET_CONTENT);
  intent.setType("String_Node_Str");
  if (multiSelect) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
      intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE,true);
    }
  }
  return Intent.createChooser(intent,title);
}
Program: 13521
Project: 13521
Buggy source:
private static Intent prepareVideoLibraryIntent(Context context,boolean multiSelect){
  Intent intent=new Intent(Intent.ACTION_GET_CONTENT);
  intent.setType("String_Node_Str");
  if (multiSelect) {
    intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE,true);
  }
  return Intent.createChooser(intent,context.getString(R.string.pick_video));
}

Fixed version (ground truth):
private static Intent prepareVideoLibraryIntent(Context context,boolean multiSelect){
  Intent intent=new Intent(Intent.ACTION_GET_CONTENT);
  intent.setType("String_Node_Str");
  if (multiSelect) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
      intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE,true);
    }
  }
  return Intent.createChooser(intent,context.getString(R.string.pick_video));
}
Program: 13522
Project: 13522
Buggy source:
@Override protected void onDraw(Canvas canvas){
  int[] selectorIndices=getIndices();
  setIndices(new int[0]);
  setIndices(selectorIndices);
  setDisplayValues();
  float elementHeight=getSelectorElementHeight();
  float x=((getRight() - getLeft()) / 2.0f);
  float y=getScrollOffset();
  Paint paint=mInputView.getPaint();
  paint.setTextAlign(Paint.Align.CENTER);
  paint.setColor(getResources().getColor(R.color.blue_medium));
  int alpha=isEnabled() ? 255 : 96;
  paint.setAlpha(alpha);
  mPaint.setAlpha(alpha);
  int offset=getResources().getDimensionPixelSize(R.dimen.margin_medium);
  for (int i=0; i < DISPLAY_COUNT; ++i) {
    String scrollSelectorValue;
    if (mFormatter != null) {
      scrollSelectorValue=mFormatter.format(mDisplayValues[i]);
    }
 else {
      scrollSelectorValue=String.valueOf(mDisplayValues[i]);
    }
    if (i == MIDDLE_INDEX) {
      canvas.drawText(scrollSelectorValue,x,y - ((paint.descent() + paint.ascent()) / 2) - offset,paint);
    }
 else {
      canvas.drawText(scrollSelectorValue,x,y - ((mPaint.descent() + mPaint.ascent()) / 2) - offset,mPaint);
    }
    y+=elementHeight;
  }
}

Fixed version (ground truth):
@Override protected void onDraw(Canvas canvas){
  int[] selectorIndices=getIndices();
  setIndices(mEmptyIndices);
  setIndices(selectorIndices);
  setDisplayValues();
  float elementHeight=getSelectorElementHeight();
  float x=((getRight() - getLeft()) / 2.0f);
  float y=getScrollOffset();
  Paint paint=mInputView.getPaint();
  paint.setTextAlign(Paint.Align.CENTER);
  paint.setColor(getResources().getColor(R.color.blue_medium));
  int alpha=isEnabled() ? 255 : 96;
  paint.setAlpha(alpha);
  mPaint.setAlpha(alpha);
  int offset=getResources().getDimensionPixelSize(R.dimen.margin_medium);
  for (int i=0; i < DISPLAY_COUNT; ++i) {
    String scrollSelectorValue;
    if (mFormatter != null) {
      scrollSelectorValue=mFormatter.format(mDisplayValues[i]);
    }
 else {
      scrollSelectorValue=String.valueOf(mDisplayValues[i]);
    }
    if (i == MIDDLE_INDEX) {
      canvas.drawText(scrollSelectorValue,x,y - ((paint.descent() + paint.ascent()) / 2) - offset,paint);
    }
 else {
      canvas.drawText(scrollSelectorValue,x,y - ((mPaint.descent() + mPaint.ascent()) / 2) - offset,mPaint);
    }
    y+=elementHeight;
  }
}
Program: 13523
Project: 13523
Buggy source:
String generateNewAnonID(){
  String uuid=UUID.randomUUID().toString().replace("String_Node_Str","String_Node_Str");
  AppLog.d(AppLog.T.STATS,"String_Node_Str" + this.getClass().getSimpleName() + "String_Node_Str"+ uuid);
  SharedPreferences preferences=PreferenceManager.getDefaultSharedPreferences(mContext);
  final SharedPreferences.Editor editor=preferences.edit();
  editor.putString(getAnonIdPrefKey(),uuid);
  editor.commit();
  mAnonID=uuid;
  return uuid;
}

Fixed version (ground truth):
String generateNewAnonID(){
  String uuid=UUID.randomUUID().toString().replace("String_Node_Str","String_Node_Str");
  AppLog.d(AppLog.T.STATS,"String_Node_Str" + this.getClass().getSimpleName() + "String_Node_Str"+ uuid);
  SharedPreferences preferences=PreferenceManager.getDefaultSharedPreferences(mContext);
  final SharedPreferences.Editor editor=preferences.edit();
  editor.putString(getAnonIdPrefKey(),uuid);
  editor.apply();
  mAnonID=uuid;
  return uuid;
}
Program: 13524
Project: 13524
Buggy source:
void clearAnonID(){
  mAnonID=null;
  SharedPreferences preferences=PreferenceManager.getDefaultSharedPreferences(mContext);
  if (preferences.contains(getAnonIdPrefKey())) {
    final SharedPreferences.Editor editor=preferences.edit();
    editor.remove(getAnonIdPrefKey());
    editor.commit();
  }
}

Fixed version (ground truth):
void clearAnonID(){
  mAnonID=null;
  SharedPreferences preferences=PreferenceManager.getDefaultSharedPreferences(mContext);
  if (preferences.contains(getAnonIdPrefKey())) {
    final SharedPreferences.Editor editor=preferences.edit();
    editor.remove(getAnonIdPrefKey());
    editor.apply();
  }
}