nus-yam/ex-repair huggingface dataset:
Program: 60764
Project: 60764
Buggy source:
private String getPTokenFromInternet(int index,EhConfig config){
  int previewIndex=index / mSpiderInfo.previewPerPage;
  try {
    String url=EhUrl.getGalleryDetailUrl(mGalleryInfo.gid,mGalleryInfo.token,previewIndex,false);
    if (DEBUG_LOG) {
      Log.d(TAG,url);
    }
    Request request=new EhRequestBuilder(url,config).build();
    Response response=mHttpClient.newCall(request).execute();
    String body=response.body().string();
    mSpiderInfo.previewPages=GalleryDetailParser.parsePreviewPages(body);
    readPreviews(body,mSpiderInfo);
    writeSpiderInfoToLocal(mSpiderInfo);
    String pToken;
synchronized (mPTokenLock) {
      pToken=mSpiderInfo.pTokenMap.get(index);
    }
    return pToken;
  }
 catch (  Exception e) {
    return null;
  }
}

Fixed version (ground truth):
private String getPTokenFromInternet(int index,EhConfig config){
  int previewIndex;
  if (mSpiderInfo.previewPerPage >= 0) {
    previewIndex=index / mSpiderInfo.previewPerPage;
  }
 else {
    previewIndex=0;
  }
  try {
    String url=EhUrl.getGalleryDetailUrl(mGalleryInfo.gid,mGalleryInfo.token,previewIndex,false);
    if (DEBUG_PTOKEN) {
      Log.d(TAG,"String_Node_Str" + index + "String_Node_Str"+ previewIndex+ "String_Node_Str"+ mSpiderInfo.previewPerPage+ "String_Node_Str"+ url);
    }
    Request request=new EhRequestBuilder(url,config).build();
    Response response=mHttpClient.newCall(request).execute();
    String body=response.body().string();
    readPreviews(body,previewIndex,mSpiderInfo);
    writeSpiderInfoToLocal(mSpiderInfo);
    String pToken;
synchronized (mPTokenLock) {
      pToken=mSpiderInfo.pTokenMap.get(index);
    }
    return pToken;
  }
 catch (  Exception e) {
    return null;
  }
}
Program: 60765
Project: 60765
Buggy source:
public static Result parse(String body) throws ParseException {
  Matcher m;
  Result result=new Result();
  m=PATTERN_IMAGE_URL.matcher(body);
  if (m.find()) {
    result.imageUrl=StringUtils.unescapeXml(StringUtils.trim(m.group(1)));
  }
  m=PATTERN_SKIP_HATH_KEY.matcher(body);
  if (m.find()) {
    result.skipHathKey=StringUtils.unescapeXml(StringUtils.trim(m.group(1)));
  }
  m=PATTERN_ORIGIN_IMAGE_URL.matcher(body);
  if (m.find()) {
    result.originImageUrl=StringUtils.unescapeXml(StringUtils.trim(m.group(1)));
  }
  if (!TextUtils.isEmpty(result.imageUrl) && !TextUtils.isEmpty(result.skipHathKey)) {
    return result;
  }
 else {
    throw new ParseException("String_Node_Str",body);
  }
}

Fixed version (ground truth):
public static Result parse(String body) throws ParseException {
  Matcher m;
  Result result=new Result();
  m=PATTERN_IMAGE_URL.matcher(body);
  if (m.find()) {
    result.imageUrl=StringUtils.unescapeXml(StringUtils.trim(m.group(1)));
  }
  m=PATTERN_SKIP_HATH_KEY.matcher(body);
  if (m.find()) {
    result.skipHathKey=StringUtils.unescapeXml(StringUtils.trim(m.group(1)));
  }
  m=PATTERN_ORIGIN_IMAGE_URL.matcher(body);
  if (m.find()) {
    result.originImageUrl=StringUtils.unescapeXml(m.group(1)) + "String_Node_Str" + StringUtils.unescapeXml(m.group(2));
  }
  if (!TextUtils.isEmpty(result.imageUrl)) {
    return result;
  }
 else {
    throw new ParseException("String_Node_Str",body);
  }
}
Program: 60766
Project: 60766
Buggy source:
public void setImageUri(@Nullable Uri imageUri){
  if (null == imageUri) {
    return;
  }
  Context context=getContext();
  UniFile file=UniFile.fromUri(context,imageUri);
  try {
    int maxSize=context.getResources().getDimensionPixelOffset(R.dimen.image_search_max_size);
    Bitmap bitmap=BitmapUtils.decodeStream(new UniFileInputStreamPipe(file),maxSize,maxSize);
    if (null == bitmap) {
      return;
    }
    File temp=AppConfig.createTempFile();
    if (null == temp) {
      return;
    }
    OutputStream os=null;
    try {
      os=new FileOutputStream(temp);
      bitmap.compress(Bitmap.CompressFormat.JPEG,90,os);
      mImagePath=temp.getPath();
      mPreview.setImageBitmap(bitmap);
      mPreview.setVisibility(VISIBLE);
    }
 catch (    FileNotFoundException e) {
      e.printStackTrace();
    }
 finally {
      IOUtils.closeQuietly(os);
    }
  }
 catch (  OutOfMemoryError e) {
    Log.e(TAG,"String_Node_Str");
  }
}

Fixed version (ground truth):
public void setImageUri(@Nullable Uri imageUri){
  if (null == imageUri) {
    return;
  }
  Context context=getContext();
  UniFile file=UniFile.fromUri(context,imageUri);
  if (null == file) {
    return;
  }
  try {
    int maxSize=context.getResources().getDimensionPixelOffset(R.dimen.image_search_max_size);
    Bitmap bitmap=BitmapUtils.decodeStream(new UniFileInputStreamPipe(file),maxSize,maxSize);
    if (null == bitmap) {
      return;
    }
    File temp=AppConfig.createTempFile();
    if (null == temp) {
      return;
    }
    OutputStream os=null;
    try {
      os=new FileOutputStream(temp);
      bitmap.compress(Bitmap.CompressFormat.JPEG,90,os);
      mImagePath=temp.getPath();
      mPreview.setImageBitmap(bitmap);
      mPreview.setVisibility(VISIBLE);
    }
 catch (    FileNotFoundException e) {
      e.printStackTrace();
    }
 finally {
      IOUtils.closeQuietly(os);
    }
  }
 catch (  OutOfMemoryError e) {
    Log.e(TAG,"String_Node_Str");
  }
}
Program: 60767
Project: 60767
Buggy source:
@Override public void onBindViewHolder(HistoryHolder holder,int position){
  if (null == mLazyList) {
    return;
  }
  GalleryInfo gi=mLazyList.get(position);
  holder.thumb.load(EhCacheKeyFactory.getThumbKey(gi.gid),gi.thumb);
  holder.title.setText(EhUtils.getSuitableTitle(gi));
  holder.uploader.setText(gi.uploader);
  holder.rating.setRating(gi.rating);
  TextView category=holder.category;
  String newCategoryText=EhUtils.getCategory(gi.category);
  if (!newCategoryText.equals(category.getText())) {
    category.setText(newCategoryText);
    category.setBackgroundColor(EhUtils.getCategoryColor(gi.category));
  }
  holder.posted.setText(gi.posted);
  holder.simpleLanguage.setText(gi.simpleLanguage);
}

Fixed version (ground truth):
@Override @TargetApi(Build.VERSION_CODES.LOLLIPOP) public void onBindViewHolder(HistoryHolder holder,int position){
  if (null == mLazyList) {
    return;
  }
  GalleryInfo gi=mLazyList.get(position);
  holder.thumb.load(EhCacheKeyFactory.getThumbKey(gi.gid),gi.thumb);
  holder.title.setText(EhUtils.getSuitableTitle(gi));
  holder.uploader.setText(gi.uploader);
  holder.rating.setRating(gi.rating);
  TextView category=holder.category;
  String newCategoryText=EhUtils.getCategory(gi.category);
  if (!newCategoryText.equals(category.getText())) {
    category.setText(newCategoryText);
    category.setBackgroundColor(EhUtils.getCategoryColor(gi.category));
  }
  holder.posted.setText(gi.posted);
  holder.simpleLanguage.setText(gi.simpleLanguage);
  if (ApiHelper.SUPPORT_TRANSITION) {
    long gid=gi.gid;
    holder.thumb.setTransitionName(TransitionNameFactory.getThumbTransitionName(gid));
  }
}
Program: 60768
Project: 60768
Buggy source:
private void onRestore(@NonNull Bundle savedInstanceState){
  mAction=savedInstanceState.getString(KEY_ACTION);
  mFilename=savedInstanceState.getString(KEY_FILENAME);
  mGalleryInfo=savedInstanceState.getParcelable(KEY_GALLERY_INFO);
  mPage=savedInstanceState.getInt(KEY_ACTION,-1);
  buildProvider();
}

Fixed version (ground truth):
private void onRestore(@NonNull Bundle savedInstanceState){
  mAction=savedInstanceState.getString(KEY_ACTION);
  mFilename=savedInstanceState.getString(KEY_FILENAME);
  mGalleryInfo=savedInstanceState.getParcelable(KEY_GALLERY_INFO);
  mPage=savedInstanceState.getInt(KEY_PAGE,-1);
  buildProvider();
}
Program: 60769
Project: 60769
Buggy source:
@Nullable public static Announcer parseUrl(String url){
  if (TextUtils.isEmpty(url)) {
    return null;
  }
  ListUrlBuilder listUrlBuilder=GalleryListUrlParser.parse(url);
  if (listUrlBuilder != null) {
    Bundle args=new Bundle();
    args.putString(GalleryListScene.KEY_ACTION,GalleryListScene.ACTION_LIST_URL_BUILDER);
    args.putParcelable(GalleryListScene.KEY_LIST_URL_BUILDER,listUrlBuilder);
    return new Announcer(GalleryListScene.class).setArgs(args);
  }
  GalleryDetailUrlParser.Result result1=GalleryDetailUrlParser.parse(url);
  if (result1 != null) {
    Bundle args=new Bundle();
    args.putString(GalleryDetailScene.KEY_ACTION,GalleryDetailScene.ACTION_GID_TOKEN);
    args.putLong(GalleryDetailScene.KEY_GID,result1.gid);
    args.putString(GalleryDetailScene.KEY_TOKEN,result1.token);
    return new Announcer(GalleryDetailScene.class).setArgs(args);
  }
  GalleryPageUrlParser.Result result2=GalleryPageUrlParser.parse(url);
  if (result2 != null) {
    Bundle args=new Bundle();
    args.putString(ProgressScene.KEY_ACTION,ProgressScene.ACTION_GALLERY_TOKEN);
    args.putLong(ProgressScene.KEY_GID,result2.gid);
    args.putString(ProgressScene.KEY_PTOKEN,result2.pToken);
    args.putLong(ProgressScene.KEY_PAGE,result2.page);
    return new Announcer(ProgressScene.class).setArgs(args);
  }
  Log.i(TAG,"String_Node_Str" + url);
  return null;
}

Fixed version (ground truth):
@Nullable public static Announcer parseUrl(String url){
  if (TextUtils.isEmpty(url)) {
    return null;
  }
  ListUrlBuilder listUrlBuilder=GalleryListUrlParser.parse(url);
  if (listUrlBuilder != null) {
    Bundle args=new Bundle();
    args.putString(GalleryListScene.KEY_ACTION,GalleryListScene.ACTION_LIST_URL_BUILDER);
    args.putParcelable(GalleryListScene.KEY_LIST_URL_BUILDER,listUrlBuilder);
    return new Announcer(GalleryListScene.class).setArgs(args);
  }
  GalleryDetailUrlParser.Result result1=GalleryDetailUrlParser.parse(url);
  if (result1 != null) {
    Bundle args=new Bundle();
    args.putString(GalleryDetailScene.KEY_ACTION,GalleryDetailScene.ACTION_GID_TOKEN);
    args.putLong(GalleryDetailScene.KEY_GID,result1.gid);
    args.putString(GalleryDetailScene.KEY_TOKEN,result1.token);
    return new Announcer(GalleryDetailScene.class).setArgs(args);
  }
  GalleryPageUrlParser.Result result2=GalleryPageUrlParser.parse(url);
  if (result2 != null) {
    Bundle args=new Bundle();
    args.putString(ProgressScene.KEY_ACTION,ProgressScene.ACTION_GALLERY_TOKEN);
    args.putLong(ProgressScene.KEY_GID,result2.gid);
    args.putString(ProgressScene.KEY_PTOKEN,result2.pToken);
    args.putInt(ProgressScene.KEY_PAGE,result2.page);
    return new Announcer(ProgressScene.class).setArgs(args);
  }
  Log.i(TAG,"String_Node_Str" + url);
  return null;
}
Program: 60770
Project: 60770
Buggy source:
private boolean handleArgs(Bundle args){
  if (args == null) {
    return false;
  }
  mAction=args.getString(KEY_ACTION);
  if (ACTION_GALLERY_TOKEN.equals(mAction)) {
    mGid=args.getInt(KEY_GID,-1);
    mPToken=args.getString(KEY_PTOKEN,null);
    mPage=args.getInt(KEY_PAGE,-1);
    if (mGid == -1 || mPToken == null || mPage == -1) {
      return false;
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean handleArgs(Bundle args){
  if (args == null) {
    return false;
  }
  mAction=args.getString(KEY_ACTION);
  if (ACTION_GALLERY_TOKEN.equals(mAction)) {
    mGid=args.getLong(KEY_GID,-1);
    mPToken=args.getString(KEY_PTOKEN,null);
    mPage=args.getInt(KEY_PAGE,-1);
    if (mGid == -1 || mPToken == null || mPage == -1) {
      return false;
    }
    return true;
  }
  return false;
}
Program: 60772
Project: 60772
Buggy source:
public void setOnFinishDate(int downloaded,int total){
  mType=TYPE_ON_FINISH;
  mDownloaded=downloaded;
  mTotal=total;
}

Fixed version (ground truth):
public void setOnFinishDate(int finished,int downloaded,int total){
  mType=TYPE_ON_FINISH;
  mFinished=finished;
  mDownloaded=downloaded;
  mTotal=total;
}
Program: 60773
Project: 60773
Buggy source:
@Override public void onFinish(int downloaded,int total){
}

Fixed version (ground truth):
@Override public void onFinish(int finished,int downloaded,int total){
}
Program: 60775
Project: 60775
Buggy source:
private void updatePageState(int index,@State int state,String error){
  int oldState;
synchronized (mPageStateLock) {
    oldState=mPageStateArray[index];
    mPageStateArray[index]=state;
  }
  if (!isStateDone(oldState) && isStateDone(state)) {
    mDownloadedPages.incrementAndGet();
  }
 else   if (isStateDone(oldState) && !isStateDone(state)) {
    mDownloadedPages.decrementAndGet();
  }
  if (oldState != STATE_FINISHED && state == STATE_FINISHED) {
    mFinishedPages.incrementAndGet();
  }
 else   if (oldState == STATE_FINISHED && state != STATE_FINISHED) {
    mFinishedPages.decrementAndGet();
  }
  if (state == STATE_DOWNLOADING) {
    mPageErrorMap.remove(index);
  }
 else   if (state == STATE_FINISHED || state == STATE_FAILED) {
    mPagePercentMap.remove(index);
  }
  if (state == STATE_FAILED) {
    if (error == null) {
      error=GetText.getString(R.string.error_unknown);
    }
    mPageErrorMap.put(index,error);
    notifyPageFailure(index,error);
  }
 else   if (state == STATE_FINISHED) {
    notifyPageSuccess(index);
  }
}

Fixed version (ground truth):
private void updatePageState(int index,@State int state,String error){
  int oldState;
synchronized (mPageStateLock) {
    oldState=mPageStateArray[index];
    mPageStateArray[index]=state;
  }
  if (!isStateDone(oldState) && isStateDone(state)) {
    mDownloadedPages.incrementAndGet();
  }
 else   if (isStateDone(oldState) && !isStateDone(state)) {
    mDownloadedPages.decrementAndGet();
  }
  if (oldState != STATE_FINISHED && state == STATE_FINISHED) {
    Log.d("String_Node_Str","String_Node_Str");
    mFinishedPages.incrementAndGet();
  }
 else   if (oldState == STATE_FINISHED && state != STATE_FINISHED) {
    mFinishedPages.decrementAndGet();
  }
  if (state == STATE_DOWNLOADING) {
    mPageErrorMap.remove(index);
  }
 else   if (state == STATE_FINISHED || state == STATE_FAILED) {
    mPagePercentMap.remove(index);
  }
  if (state == STATE_FAILED) {
    if (error == null) {
      error=GetText.getString(R.string.error_unknown);
    }
    mPageErrorMap.put(index,error);
    notifyPageFailure(index,error);
  }
 else   if (state == STATE_FINISHED) {
    notifyPageSuccess(index);
  }
}
Program: 60776
Project: 60776
Buggy source:
/** 
 * All workers end
 */
void onFinish(int downloaded,int total);

Fixed version (ground truth):
/** 
 * All workers end
 */
void onFinish(int finished,int downloaded,int total);
Program: 60777
Project: 60777
Buggy source:
private void notifyFinish(){
  int size=-1;
  int[] temp=mPageStateArray;
  if (temp != null) {
    size=temp.length;
  }
synchronized (mSpiderListeners) {
    for (    OnSpiderListener listener : mSpiderListeners) {
      listener.onFinish(mFinishedPages.get(),size);
    }
  }
}

Fixed version (ground truth):
private void notifyFinish(){
  int size=-1;
  int[] temp=mPageStateArray;
  if (temp != null) {
    size=temp.length;
  }
synchronized (mSpiderListeners) {
    for (    OnSpiderListener listener : mSpiderListeners) {
      listener.onFinish(mFinishedPages.get(),mDownloadedPages.get(),size);
    }
  }
}
Program: 60778
Project: 60778
Buggy source:
@Override public boolean onItemClick(EasyRecyclerView parent,View view,int position,long id){
  if (position != 0) {
    ClipboardManager cmb=(ClipboardManager)getContext().getSystemService(Context.CLIPBOARD_SERVICE);
    cmb.setPrimaryClip(ClipData.newPlainText(null,mValues.get(position)));
    Toast.makeText(getContext(),R.string.copied_to_clipboard,Toast.LENGTH_SHORT).show();
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean onItemClick(EasyRecyclerView parent,View view,int position,long id){
  if (position != 0 && mValues != null) {
    ClipboardManager cmb=(ClipboardManager)getContext().getSystemService(Context.CLIPBOARD_SERVICE);
    cmb.setPrimaryClip(ClipData.newPlainText(null,mValues.get(position)));
    Toast.makeText(getContext(),R.string.copied_to_clipboard,Toast.LENGTH_SHORT).show();
    return true;
  }
 else {
    return false;
  }
}
Program: 60779
Project: 60779
Buggy source:
@Nullable @Override public View onCreateView2(LayoutInflater inflater,@Nullable ViewGroup container,@Nullable Bundle savedInstanceState){
  View view=inflater.inflate(R.layout.scene_gallery_info,container,false);
  EasyRecyclerView recyclerView=(EasyRecyclerView)view.findViewById(R.id.recycler_view);
  InfoAdapter adapter=new InfoAdapter();
  recyclerView.setAdapter(adapter);
  recyclerView.setLayoutManager(new LinearLayoutManager(getContext(),LinearLayoutManager.VERTICAL,false));
  LinearDividerItemDecoration decoration=new LinearDividerItemDecoration(LinearDividerItemDecoration.VERTICAL,getResources().getColor(R.color.divider),LayoutUtils.dp2pix(getContext(),1));
  decoration.setPadding(getResources().getDimensionPixelOffset(R.dimen.keyline_margin));
  recyclerView.addItemDecoration(decoration);
  recyclerView.setSelector(RippleSalon.generateRippleDrawable(false));
  recyclerView.setClipToPadding(false);
  recyclerView.setHasFixedSize(true);
  recyclerView.setOnItemClickListener(this);
  return view;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Nullable @Override public View onCreateView2(LayoutInflater inflater,@Nullable ViewGroup container,@Nullable Bundle savedInstanceState){
  View view=inflater.inflate(R.layout.scene_gallery_info,container,false);
  EasyRecyclerView recyclerView=(EasyRecyclerView)view.findViewById(R.id.recycler_view);
  InfoAdapter adapter=new InfoAdapter();
  recyclerView.setAdapter(adapter);
  recyclerView.setLayoutManager(new LinearLayoutManager(getContext(),LinearLayoutManager.VERTICAL,false));
  LinearDividerItemDecoration decoration=new LinearDividerItemDecoration(LinearDividerItemDecoration.VERTICAL,getResources().getColor(R.color.divider),LayoutUtils.dp2pix(getContext(),1));
  decoration.setPadding(getResources().getDimensionPixelOffset(R.dimen.keyline_margin));
  recyclerView.addItemDecoration(decoration);
  recyclerView.setSelector(RippleSalon.generateRippleDrawable(false));
  recyclerView.setClipToPadding(false);
  recyclerView.setHasFixedSize(true);
  recyclerView.setOnItemClickListener(this);
  return view;
}
Program: 60780
Project: 60780
Buggy source:
@Override public void onBindViewHolder(InfoHolder holder,int position){
  holder.key.setText(mKeys.get(position));
  holder.value.setText(mValues.get(position));
  holder.itemView.setEnabled(position != 0);
}

Fixed version (ground truth):
@Override public void onBindViewHolder(InfoHolder holder,int position){
  if (mKeys != null && mValues != null) {
    holder.key.setText(mKeys.get(position));
    holder.value.setText(mValues.get(position));
    holder.itemView.setEnabled(position != 0);
  }
}
Program: 60782
Project: 60782
Buggy source:
@Override public void saveFromResponse(HttpUrl url,List<Cookie> cookies){
  List<Cookie> cs=new ArrayList<>(cookies.size() + 2);
  for (  Cookie cookie : cookies) {
    cs.add(cookie);
    if (EhUrl.DOMAIN_E.equals(cookie.domain()) && (KEY_IPD_MEMBER_ID.equals(cookie.name()) || KEY_IPD_PASS_HASH.equals(cookie.name()))) {
      cs.add(newCookie(cookie,CookieDB.cookiesDomain(EhUrl.DOMAIN_EX)));
    }
  }
  super.saveFromResponse(url,cs);
}

Fixed version (ground truth):
@Override public void saveFromResponse(HttpUrl url,List<Cookie> cookies){
  List<Cookie> cs=new ArrayList<>(cookies.size() + 2);
  for (  Cookie cookie : cookies) {
    cs.add(cookie);
    if (EhUrl.DOMAIN_E.equals(cookie.domain()) && (KEY_IPD_MEMBER_ID.equals(cookie.name()) || KEY_IPD_PASS_HASH.equals(cookie.name()))) {
      cs.add(newCookie(cookie,EhUrl.DOMAIN_EX));
    }
  }
  super.saveFromResponse(url,cs);
}
Program: 60783
Project: 60783
Buggy source:
public static Map<String,List<CookieWithID>> getAllCookies(){
  OkHttp3CookieDao dao=sDaoSession.getOkHttp3CookieDao();
  List<OkHttp3CookieRaw> list=dao.queryBuilder().list();
  long now=System.currentTimeMillis();
  Map<String,List<CookieWithID>> result=new HashMap<>();
  for (  OkHttp3CookieRaw raw : list) {
    if (!raw.getPersistent() || raw.getExpiresAt() <= now) {
      dao.delete(raw);
      continue;
    }
    String name=raw.getName();
    String value=raw.getValue();
    String domain=raw.getDomain();
    if (name == null || value == null || domain == null) {
      dao.delete(raw);
      continue;
    }
    Cookie.Builder builder=new Cookie.Builder();
    builder.name(name);
    builder.value(value);
    builder.expiresAt(raw.getExpiresAt());
    if (raw.getHostOnly()) {
      builder.hostOnlyDomain(domain);
    }
 else {
      builder.domain(raw.getDomain());
    }
    builder.path(raw.getPath());
    if (raw.getSecure()) {
      builder.secure();
    }
    if (raw.getHttpOnly()) {
      builder.httpOnly();
    }
    String cookiesDomain=cookiesDomain(domain);
    List<CookieWithID> cookies=result.get(cookiesDomain);
    if (cookies == null) {
      cookies=new ArrayList<>();
      result.put(cookiesDomain,cookies);
    }
    cookies.add(new CookieWithID(raw.getId(),builder.build()));
  }
  return result;
}

Fixed version (ground truth):
public static Map<String,List<CookieWithID>> getAllCookies(){
  OkHttp3CookieDao dao=sDaoSession.getOkHttp3CookieDao();
  List<OkHttp3CookieRaw> list=dao.queryBuilder().list();
  long now=System.currentTimeMillis();
  Map<String,List<CookieWithID>> result=new HashMap<>();
  for (  OkHttp3CookieRaw raw : list) {
    if (!raw.getPersistent() || raw.getExpiresAt() <= now) {
      dao.delete(raw);
      continue;
    }
    String name=raw.getName();
    String value=raw.getValue();
    String domain=raw.getDomain();
    if (name == null || value == null || domain == null) {
      dao.delete(raw);
      continue;
    }
    Cookie.Builder builder=new Cookie.Builder();
    builder.name(name);
    builder.value(value);
    builder.expiresAt(raw.getExpiresAt());
    if (raw.getHostOnly()) {
      builder.hostOnlyDomain(domain);
    }
 else {
      builder.domain(raw.getDomain());
    }
    builder.path(raw.getPath());
    if (raw.getSecure()) {
      builder.secure();
    }
    if (raw.getHttpOnly()) {
      builder.httpOnly();
    }
    List<CookieWithID> cookies=result.get(domain);
    if (cookies == null) {
      cookies=new ArrayList<>();
      result.put(domain,cookies);
    }
    cookies.add(new CookieWithID(raw.getId(),builder.build()));
  }
  return result;
}
Program: 60784
Project: 60784
Buggy source:
public void add(Cookie cookie){
  addInternal(CookieDB.cookiesDomain(cookie.domain()),cookie);
}

Fixed version (ground truth):
public void add(Cookie cookie){
  String domain=cookie.domain();
  if (hasExpired(cookie)) {
    removeInternal(cookie);
    return;
  }
  List<CookieWithID> cookies=map.get(domain);
  if (cookies == null) {
    cookies=new ArrayList<>();
    map.put(domain,cookies);
  }
 else {
    CookieWithID cwi=removeCookie(cookies,cookie.name());
    if (cwi != null) {
      CookieDB.removeCookie(cwi.id);
    }
  }
  long id=CookieDB.addCookie(cookie);
  cookies.add(new CookieWithID(id,cookie));
}
Program: 60785
Project: 60785
Buggy source:
private boolean hasExpired(Cookie cookie){
  return cookie.expiresAt() < System.currentTimeMillis();
}

Fixed version (ground truth):
private static boolean hasExpired(Cookie cookie){
  return cookie.expiresAt() < System.currentTimeMillis();
}
Program: 60786
Project: 60786
Buggy source:
public boolean contain(String url,String name){
  return containInternal(CookieDB.cookiesDomain(url),name);
}

Fixed version (ground truth):
public boolean contain(String host,String name){
  for (  String key : map.keySet()) {
    if (domainMatch(host,key)) {
      List<CookieWithID> cookies=map.get(key);
      if (containInternal(host,name,cookies)) {
        return true;
      }
    }
  }
  return false;
}
Program: 60787
Project: 60787
Buggy source:
private synchronized void removeInternal(String domain){
  List<CookieWithID> cookies=map.remove(domain);
  if (cookies != null) {
    for (    CookieWithID cwi : cookies) {
      CookieDB.removeCookie(cwi.id);
    }
    cookies.clear();
  }
}

Fixed version (ground truth):
private void removeInternal(String host,List<CookieWithID> cookies){
  for (Iterator<CookieWithID> i=cookies.iterator(); i.hasNext(); ) {
    CookieWithID cwi=i.next();
    Cookie cookie=cwi.cookie;
    if (domainMatch(cookie,host) || hasExpired(cookie)) {
      i.remove();
      CookieDB.removeCookie(cwi.id);
    }
  }
}
Program: 60788
Project: 60788
Buggy source:
public List<Cookie> get(HttpUrl url){
  List<Cookie> result=new ArrayList<>();
  String domain=CookieDB.cookiesDomain(url.url());
  List<CookieWithID> cookies=map.get(domain);
  if (cookies != null) {
    for (Iterator<CookieWithID> i=cookies.iterator(); i.hasNext(); ) {
      CookieWithID cwi=i.next();
      Cookie cookie=cwi.cookie;
      if (hasExpired(cookie)) {
        i.remove();
        CookieDB.removeCookie(cwi.id);
      }
 else       if (cookie.matches(url)) {
        result.add(cookie);
      }
    }
  }
  return Collections.unmodifiableList(result);
}

Fixed version (ground truth):
public List<Cookie> get(HttpUrl url){
  List<Cookie> result=new ArrayList<>();
  String host=url.host();
  for (  String key : map.keySet()) {
    if (domainMatch(host,key)) {
      List<CookieWithID> cookies=map.get(key);
      getInternal(url,cookies,result);
    }
  }
  return Collections.unmodifiableList(result);
}
Program: 60789
Project: 60789
Buggy source:
private boolean containInternal(String domain,String name){
  List<CookieWithID> cookies=map.get(domain);
  if (cookies != null) {
    for (int i=0, n=cookies.size(); i < n; i++) {
      CookieWithID cwi=cookies.get(i);
      if (cwi.cookie.name().equals(name)) {
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean containInternal(String host,String name,List<CookieWithID> cookies){
  for (int i=0, n=cookies.size(); i < n; i++) {
    Cookie cookie=cookies.get(i).cookie;
    if (domainMatch(cookie,host) && cookie.name().equals(name)) {
      return true;
    }
  }
  return false;
}
Program: 60790
Project: 60790
Buggy source:
public void remove(String url){
  removeInternal(CookieDB.cookiesDomain(url));
}

Fixed version (ground truth):
public void remove(String host){
  for (  String key : map.keySet()) {
    if (domainMatch(host,key)) {
      List<CookieWithID> cookies=map.get(key);
      removeInternal(host,cookies);
    }
  }
}
Program: 60791
Project: 60791
Buggy source:
/** 
 * Constructor called from   {@link #CREATOR}
 */
private SavedState(Parcel in){
  super(in);
  choiceMode=in.readInt();
  checkedItemCount=in.readInt();
  checkState=in.readSparseBooleanArray();
  final int N=in.readInt();
  if (N > 0) {
    checkIdState=new LongSparseArray<>();
    for (int i=0; i < N; i++) {
      final long key=in.readLong();
      final int value=in.readInt();
      checkIdState.put(key,value);
    }
  }
}

Fixed version (ground truth):
/** 
 * Constructor called from   {@link #CREATOR}
 */
private SavedState(Parcel in){
  Parcelable superState=in.readParcelable(RecyclerView.class.getClassLoader());
  mSuperState=superState != null ? superState : EMPTY_STATE;
  choiceMode=in.readInt();
  checkedItemCount=in.readInt();
  checkState=in.readSparseBooleanArray();
  final int N=in.readInt();
  if (N > 0) {
    checkIdState=new LongSparseArray<>();
    for (int i=0; i < N; i++) {
      final long key=in.readLong();
      final int value=in.readInt();
      checkIdState.put(key,value);
    }
  }
}
Program: 60792
Project: 60792
Buggy source:
@Override public void writeToParcel(@NonNull Parcel out,int flags){
  super.writeToParcel(out,flags);
  out.writeInt(choiceMode);
  out.writeInt(checkedItemCount);
  out.writeSparseBooleanArray(checkState);
  final int N=checkIdState != null ? checkIdState.size() : 0;
  out.writeInt(N);
  for (int i=0; i < N; i++) {
    out.writeLong(checkIdState.keyAt(i));
    out.writeInt(checkIdState.valueAt(i));
  }
}

Fixed version (ground truth):
@Override public void writeToParcel(@NonNull Parcel out,int flags){
  out.writeParcelable(mSuperState,flags);
  out.writeInt(choiceMode);
  out.writeInt(checkedItemCount);
  out.writeSparseBooleanArray(checkState);
  final int N=checkIdState != null ? checkIdState.size() : 0;
  out.writeInt(N);
  for (int i=0; i < N; i++) {
    out.writeLong(checkIdState.keyAt(i));
    out.writeInt(checkIdState.valueAt(i));
  }
}
Program: 60793
Project: 60793
Buggy source:
private void updateShownCount(){
  float step=mMax / mStarCount / 2;
  int shown=Math.round(mRating / step);
  if (shown >= mStarCount * 2) {
    mShownStarCount=mStarCount;
    mShownStarHalfCount=0;
    mShownStarOutlineCount=0;
  }
 else {
    mShownStarCount=shown / 2;
    mShownStarHalfCount=shown % 2;
    mShownStarOutlineCount=mStarCount - mShownStarCount - mShownStarHalfCount;
  }
}

Fixed version (ground truth):
private void updateShownCount(){
  float step=mMax / mStarCount / 2;
  int shown=(int)Math.ceil(mRating / step);
  if (shown >= mStarCount * 2) {
    mShownStarCount=mStarCount;
    mShownStarHalfCount=0;
    mShownStarOutlineCount=0;
  }
 else {
    mShownStarCount=shown / 2;
    mShownStarHalfCount=shown % 2;
    mShownStarOutlineCount=mStarCount - mShownStarCount - mShownStarHalfCount;
  }
}
Program: 60794
Project: 60794
Buggy source:
public void setRating(float rating){
  if (mRating != rating) {
    mRating=rating;
    int ratingInt=Math.round(rating * 2);
    if (mRatingInt != ratingInt) {
      mRatingInt=ratingInt;
      invalidate();
    }
  }
}

Fixed version (ground truth):
public void setRating(float rating){
  if (mRating != rating) {
    mRating=rating;
    int ratingInt=(int)Math.ceil(rating * 2);
    if (mRatingInt != ratingInt) {
      mRatingInt=ratingInt;
      invalidate();
    }
  }
}
Program: 60795
Project: 60795
Buggy source:
@Override public void onLayout(View view){
  onClose(enter,exitDialog,layout,cushion,frame,animatorCollection);
}

Fixed version (ground truth):
@Override public void onLayout(View view){
  stageLayout.removeOnLayoutListener(this);
  onClose(enter,exitDialog,layout,cushion,frame,animatorCollection);
}
Program: 60796
Project: 60796
Buggy source:
@Override public void close(@NonNull final Scene enter,@NonNull final Scene exit){
  AssertUtils.assertInstanceof("String_Node_Str",exit,SimpleDialog.class);
  final SimpleDialog exitDialog=(SimpleDialog)exit;
  final Set<Animator> animatorCollection=new HashSet<>();
  int bgColor=exitDialog.getBackgroundColor();
  int endBgColor=bgColor & 0xffffff;
  ObjectAnimator colorAnim=ObjectAnimator.ofInt(exit,"String_Node_Str",endBgColor);
  colorAnim.setEvaluator(ArgbEvaluator.getInstance());
  colorAnim.setDuration(ANIMATE_TIME);
  animatorCollection.add(colorAnim);
  colorAnim.setInterpolator(AnimationUtils.SLOW_FAST_INTERPOLATOR);
  final View layout=exitDialog.getLayout();
  final View cushion=exitDialog.getCushion();
  final View frame=exitDialog.getFrame();
  AssertUtils.assertNotNull("String_Node_Str",cushion);
  AssertUtils.assertNotNull("String_Node_Str",frame);
  final StageLayout stageLayout=enter.getStageLayout();
  if (stageLayout.isLayoutRequested()) {
    stageLayout.addOnLayoutListener(new StageLayout.OnLayoutListener(){
      @Override public void onLayout(      View view){
        onClose(enter,exitDialog,layout,cushion,frame,animatorCollection);
      }
    }
);
  }
 else {
    onClose(enter,exitDialog,layout,cushion,frame,animatorCollection);
  }
}

Fixed version (ground truth):
@Override public void close(@NonNull final Scene enter,@NonNull final Scene exit){
  AssertUtils.assertInstanceof("String_Node_Str",exit,SimpleDialog.class);
  final SimpleDialog exitDialog=(SimpleDialog)exit;
  final Set<Animator> animatorCollection=new HashSet<>();
  int bgColor=exitDialog.getBackgroundColor();
  int endBgColor=bgColor & 0xffffff;
  ObjectAnimator colorAnim=ObjectAnimator.ofInt(exit,"String_Node_Str",endBgColor);
  colorAnim.setEvaluator(ArgbEvaluator.getInstance());
  colorAnim.setDuration(ANIMATE_TIME);
  animatorCollection.add(colorAnim);
  colorAnim.setInterpolator(AnimationUtils.SLOW_FAST_INTERPOLATOR);
  final View layout=exitDialog.getLayout();
  final View cushion=exitDialog.getCushion();
  final View frame=exitDialog.getFrame();
  AssertUtils.assertNotNull("String_Node_Str",cushion);
  AssertUtils.assertNotNull("String_Node_Str",frame);
  final StageLayout stageLayout=enter.getStageLayout();
  if (stageLayout.isLayoutRequested()) {
    stageLayout.addOnLayoutListener(new StageLayout.OnLayoutListener(){
      @Override public void onLayout(      View view){
        stageLayout.removeOnLayoutListener(this);
        onClose(enter,exitDialog,layout,cushion,frame,animatorCollection);
      }
    }
);
  }
 else {
    onClose(enter,exitDialog,layout,cushion,frame,animatorCollection);
  }
}
Program: 60797
Project: 60797
Buggy source:
@Override protected Bitmap onGetBitmap(){
  Drawable drawable=ContextCompat.getDrawable(mContext,mResId);
  int width=mWidth;
  int height=mHeight;
  if (mWidth <= 0) {
    width=drawable.getIntrinsicWidth();
  }
  if (mHeight <= 0) {
    height=drawable.getIntrinsicHeight();
  }
  if (mWidth <= 0) {
    width=1;
  }
  if (mHeight <= 0) {
    height=1;
  }
  drawable.setBounds(0,0,width,height);
  Bitmap bitmap=Bitmap.createBitmap(width,height,Bitmap.Config.ARGB_8888);
  Canvas canvas=new Canvas(bitmap);
  drawable.draw(canvas);
  return bitmap;
}

Fixed version (ground truth):
@Override protected Bitmap onGetBitmap(){
  Drawable drawable=ContextCompat.getDrawable(mContext,mResId);
  int width=mWidth;
  int height=mHeight;
  if (width <= 0) {
    width=drawable.getIntrinsicWidth();
  }
  if (height <= 0) {
    height=drawable.getIntrinsicHeight();
  }
  if (width <= 0) {
    width=1;
  }
  if (height <= 0) {
    height=1;
  }
  drawable.setBounds(0,0,width,height);
  Bitmap bitmap=Bitmap.createBitmap(width,height,Bitmap.Config.ARGB_8888);
  Canvas canvas=new Canvas(bitmap);
  drawable.draw(canvas);
  return bitmap;
}
Program: 60798
Project: 60798
Buggy source:
@Override public void onCreate(){
  super.onCreate();
  Config.initialize(this);
  Conaco.Builder conacoBuilder=new Conaco.Builder();
  conacoBuilder.hasMemoryCache=true;
  conacoBuilder.memoryCacheMaxSize=getMemoryCacheMaxSize();
  conacoBuilder.hasDiskCache=true;
  conacoBuilder.diskCacheDir=new File(getCacheDir(),"String_Node_Str");
  conacoBuilder.diskCacheMaxSize=50 * 1024 * 1024;
  conacoBuilder.httpClient=EhOkHttpClient.getInstance();
  mConaco=conacoBuilder.build();
}

Fixed version (ground truth):
@Override public void onCreate(){
  super.onCreate();
  Config.initialize(this);
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
    CookieSyncManager.createInstance(this);
  }
  Conaco.Builder conacoBuilder=new Conaco.Builder();
  conacoBuilder.hasMemoryCache=true;
  conacoBuilder.memoryCacheMaxSize=getMemoryCacheMaxSize();
  conacoBuilder.hasDiskCache=true;
  conacoBuilder.diskCacheDir=new File(getCacheDir(),"String_Node_Str");
  conacoBuilder.diskCacheMaxSize=50 * 1024 * 1024;
  conacoBuilder.httpClient=EhOkHttpClient.getInstance();
  mConaco=conacoBuilder.build();
}
Program: 60799
Project: 60799
Buggy source:
public Row(String imageUrl){
  this.imageUrl=imageUrl;
  int index1=imageUrl.lastIndexOf('-');
  int index2=imageUrl.lastIndexOf('.');
  try {
    imageIndex=Integer.parseInt(imageUrl.substring(index1 + 1,index2)) - 1;
  }
 catch (  Exception e) {
    Log.w("String_Node_Str",e);
    imageIndex=-1;
  }
}

Fixed version (ground truth):
public Row(String imageUrl){
  this.imageUrl=imageUrl;
  int index1=imageUrl.lastIndexOf('-');
  int index2=imageUrl.lastIndexOf('.');
  try {
    imageIndex=Integer.parseInt(imageUrl.substring(index1 + 1,index2));
  }
 catch (  Exception e) {
    Log.w("String_Node_Str",e);
    imageIndex=-1;
  }
}
Program: 60800
Project: 60800
Buggy source:
private void init(Context context,AttributeSet attrs){
  final TypedArray a=context.obtainStyledAttributes(attrs,MAX_ATTRS);
  mMaxWidth=a.getDimensionPixelSize(0,-1);
  a.recycle();
  setOrientation(LinearLayout.VERTICAL);
  LayoutInflater.from(context).inflate(R.layout.widget_drawer_left_panel,this);
  mSuperUserPanel=(ViewGroup)getChildAt(0);
  mKKStatusBarBg=mSuperUserPanel.getChildAt(1);
  mUserPanel=(ViewGroup)mSuperUserPanel.getChildAt(2);
  mAvatar=(SimpleDraweeView)mUserPanel.getChildAt(0);
  mUsename=(TextView)mUserPanel.getChildAt(1);
  mAction=(TextView)mUserPanel.getChildAt(2);
  mDrawerListView=(DrawerListView)getChildAt(1);
  RippleSalon.addRipple(mAction,false);
  mAction.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      if (mHelper != null) {
        if (mSignIn) {
          mHelper.onClickSignOut();
        }
 else {
          mHelper.onClickSignIn();
        }
      }
    }
  }
);
  mSuperUserPanelHeight=mSuperUserPanel.getLayoutParams().height;
  mUserPanelOriginalPaddingTop=mUserPanel.getPaddingTop();
  mDrawerListViewOriginalPaddingBottom=mDrawerListView.getPaddingBottom();
  mSignIn=Config.getSignIn();
  if (mSignIn) {
    mAvatar.setImageURI(DEFAULT_AVATAR_URI);
    mUsename.setText(Config.getDisplayName());
    mAction.setText(mContext.getString(R.string.signout));
  }
 else {
    mAvatar.setImageURI(DEFAULT_AVATAR_URI);
    mUsename.setText("String_Node_Str");
    mAction.setText(mContext.getString(R.string.signin));
  }
}

Fixed version (ground truth):
private void init(Context context,AttributeSet attrs){
  final TypedArray a=context.obtainStyledAttributes(attrs,MAX_ATTRS);
  mMaxWidth=a.getDimensionPixelSize(0,-1);
  a.recycle();
  setOrientation(LinearLayout.VERTICAL);
  LayoutInflater.from(context).inflate(R.layout.widget_drawer_left_panel,this);
  mSuperUserPanel=(ViewGroup)getChildAt(0);
  mKKStatusBarBg=mSuperUserPanel.getChildAt(1);
  mUserPanel=(ViewGroup)mSuperUserPanel.getChildAt(2);
  mAvatar=(SimpleDraweeView)mUserPanel.getChildAt(0);
  mUsename=(TextView)mUserPanel.getChildAt(1);
  mAction=(TextView)mUserPanel.getChildAt(2);
  mDrawerListView=(DrawerListView)getChildAt(1);
  RippleSalon.addRipple(mAction,false);
  mAction.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      if (mHelper != null) {
        if (mSignIn) {
          mHelper.onClickSignOut();
        }
 else {
          mHelper.onClickSignIn();
        }
      }
    }
  }
);
  mSuperUserPanelHeight=mSuperUserPanel.getLayoutParams().height;
  mUserPanelOriginalPaddingTop=mUserPanel.getPaddingTop();
  mDrawerListViewOriginalPaddingBottom=mDrawerListView.getPaddingBottom();
  mSignIn=Config.getSignIn();
  if (mSignIn) {
    mAvatar.setImageURI(DEFAULT_AVATAR_URI);
    mUsename.setText(Config.getDisplayName());
    mAction.setText(getContext().getString(R.string.signout));
  }
 else {
    mAvatar.setImageURI(DEFAULT_AVATAR_URI);
    mUsename.setText("String_Node_Str");
    mAction.setText(getContext().getString(R.string.signin));
  }
}
Program: 60801
Project: 60801
Buggy source:
@Override public void onReceive(int id,Object obj){
  if (id == Constants.MESSENGER_ID_SIGN_IN_OR_OUT) {
    if (obj == null) {
      mSignIn=false;
      mAvatar.setImageURI(DEFAULT_AVATAR_URI);
      mUsename.setText("String_Node_Str");
      mAction.setText(mContext.getString(R.string.signin));
    }
 else     if (obj instanceof String) {
      mSignIn=true;
      mUsename.setText((String)obj);
      mAction.setText(mContext.getString(R.string.signout));
    }
  }
 else   if (id == Constants.MESSENGER_ID_USER_AVATAR) {
    if (mSignIn && obj instanceof Uri) {
      mAvatar.setImageURI((Uri)obj);
    }
  }
}

Fixed version (ground truth):
@Override public void onReceive(int id,Object obj){
  if (id == Constants.MESSENGER_ID_SIGN_IN_OR_OUT) {
    if (obj == null) {
      mSignIn=false;
      mAvatar.setImageURI(DEFAULT_AVATAR_URI);
      mUsename.setText("String_Node_Str");
      mAction.setText(getContext().getString(R.string.signin));
    }
 else     if (obj instanceof String) {
      mSignIn=true;
      mUsename.setText((String)obj);
      mAction.setText(getContext().getString(R.string.signout));
    }
  }
 else   if (id == Constants.MESSENGER_ID_USER_AVATAR) {
    if (mSignIn && obj instanceof Uri) {
      mAvatar.setImageURI((Uri)obj);
    }
  }
}
Program: 60802
Project: 60802
Buggy source:
public static Uri getResourcesDrawableUri(@IdRes int resId){
  return new Uri.Builder().scheme(UriUtil.LOCAL_RESOURCE_SCHEME).path(String.valueOf(resId)).build();
}

Fixed version (ground truth):
public static Uri getResourcesDrawableUri(@DrawableRes int resId){
  return new Uri.Builder().scheme(UriUtil.LOCAL_RESOURCE_SCHEME).path(String.valueOf(resId)).build();
}
Program: 60803
Project: 60803
Buggy source:
@Override protected void dispatchDraw(@NonNull Canvas canvas){
  int saveCount=0;
  final boolean clipToPadding=(mGroupFlags & CLIP_TO_PADDING_MASK) == CLIP_TO_PADDING_MASK;
  if (clipToPadding) {
    saveCount=canvas.save();
    final int scrollX=mScrollX;
    final int scrollY=mScrollY;
    canvas.clipRect(scrollX + mPaddingLeft,scrollY + mPaddingTop,scrollX + mRight - mLeft - mPaddingRight,scrollY + mBottom - mTop - mPaddingBottom);
    mGroupFlags&=~CLIP_TO_PADDING_MASK;
  }
  boolean drawSelector=mOnDrawSelectorListener == null || mSelectorPosition < 0 || mSelectorPosition >= mAdapter.getItemCount() || mOnDrawSelectorListener.beforeDrawSelector(mSelectorPosition);
  final boolean drawSelectorOnTop=mDrawSelectorOnTop;
  if (drawSelector && !drawSelectorOnTop) {
    drawSelector(canvas);
  }
  super.dispatchDraw(canvas);
  if (drawSelector && drawSelectorOnTop) {
    drawSelector(canvas);
  }
  if (clipToPadding) {
    canvas.restoreToCount(saveCount);
    mGroupFlags|=CLIP_TO_PADDING_MASK;
  }
}

Fixed version (ground truth):
@Override protected void dispatchDraw(@NonNull Canvas canvas){
  int saveCount=0;
  if (getClipToPadding()) {
    saveCount=canvas.save();
    final int scrollX=getScrollX();
    final int scrollY=getScrollY();
    canvas.clipRect(scrollX + getPaddingLeft(),scrollY + getPaddingTop(),scrollX + getRight() - getLeft() - getPaddingRight(),scrollY + getBottom() - getTop() - getPaddingBottom());
  }
  boolean drawSelector=mOnDrawSelectorListener == null || mSelectorPosition < 0 || mSelectorPosition >= mAdapter.getItemCount() || mOnDrawSelectorListener.beforeDrawSelector(mSelectorPosition);
  final boolean drawSelectorOnTop=mDrawSelectorOnTop;
  if (drawSelector && !drawSelectorOnTop) {
    drawSelector(canvas);
  }
  super.dispatchDraw(canvas);
  if (drawSelector && drawSelectorOnTop) {
    drawSelector(canvas);
  }
  if (getClipToPadding()) {
    canvas.restoreToCount(saveCount);
  }
}
Program: 60804
Project: 60804
Buggy source:
private void showImeAndSuggestionsList(boolean animation){
  InputMethodManager imm=(InputMethodManager)getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
  imm.showSoftInput(mEditText,0);
  updateSuggestions();
  if (animation) {
    ObjectAnimator oa=ObjectAnimator.ofFloat(this,"String_Node_Str",1f);
    oa.setDuration(ANIMATE_TIME);
    oa.addListener(new SimpleAnimatorListener(){
      @Override public void onAnimationStart(      Animator animation){
        ViewUtils.setVisibility(mList,View.VISIBLE);
        mInAnimation=true;
      }
      @Override public void onAnimationEnd(      Animator animation){
        mInAnimation=false;
      }
    }
);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
      oa.setAutoCancel(true);
    }
    oa.start();
  }
 else {
    setProgress(1f);
  }
}

Fixed version (ground truth):
private void showImeAndSuggestionsList(boolean animation){
  InputMethodManager imm=(InputMethodManager)getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
  imm.showSoftInput(mEditText,0);
  updateSuggestions();
  if (animation) {
    ObjectAnimator oa=ObjectAnimator.ofFloat(this,"String_Node_Str",1f);
    oa.setDuration(ANIMATE_TIME);
    oa.addListener(new SimpleAnimatorListener(){
      @Override public void onAnimationStart(      Animator animation){
        ViewUtils.setVisibility(mList,View.VISIBLE);
        mInAnimation=true;
      }
      @Override public void onAnimationEnd(      Animator animation){
        mInAnimation=false;
      }
    }
);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
      oa.setAutoCancel(true);
    }
    oa.start();
  }
 else {
    ViewUtils.setVisibility(mList,View.VISIBLE);
    setProgress(1f);
  }
}
Program: 60805
Project: 60805
Buggy source:
private void hideImeAndSuggestionsList(boolean animation){
  InputMethodManager imm=(InputMethodManager)getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
  imm.hideSoftInputFromWindow(this.getWindowToken(),0);
  if (animation) {
    ObjectAnimator oa=ObjectAnimator.ofFloat(this,"String_Node_Str",0f);
    oa.setDuration(ANIMATE_TIME);
    oa.addListener(new SimpleAnimatorListener(){
      @Override public void onAnimationStart(      Animator animation){
        mInAnimation=true;
      }
      @Override public void onAnimationEnd(      Animator animation){
        ViewUtils.setVisibility(mList,View.GONE);
        mInAnimation=false;
      }
    }
);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
      oa.setAutoCancel(true);
    }
    oa.start();
  }
 else {
    setProgress(0f);
  }
}

Fixed version (ground truth):
private void hideImeAndSuggestionsList(boolean animation){
  InputMethodManager imm=(InputMethodManager)getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
  imm.hideSoftInputFromWindow(this.getWindowToken(),0);
  if (animation) {
    ObjectAnimator oa=ObjectAnimator.ofFloat(this,"String_Node_Str",0f);
    oa.setDuration(ANIMATE_TIME);
    oa.addListener(new SimpleAnimatorListener(){
      @Override public void onAnimationStart(      Animator animation){
        mInAnimation=true;
      }
      @Override public void onAnimationEnd(      Animator animation){
        ViewUtils.setVisibility(mList,View.GONE);
        mInAnimation=false;
      }
    }
);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
      oa.setAutoCancel(true);
    }
    oa.start();
  }
 else {
    setProgress(0f);
    ViewUtils.setVisibility(mList,View.GONE);
  }
}
Program: 60806
Project: 60806
Buggy source:
public boolean put(String key,E value){
  DiskLruCache.Editor editor=null;
  OutputStream os=null;
  try {
    editor=mDiskLruCache.edit(key);
    if (editor == null) {
      return false;
    }
    os=editor.newOutputStream(0);
    if (os != null) {
      final BufferedOutputStream buffOut=new BufferedOutputStream(os,IO_BUFFER_SIZE);
      boolean result=mParent.write(buffOut,value);
      editor.commit();
      return result;
    }
 else {
      editor.abort();
      return false;
    }
  }
 catch (  IOException e) {
    Util.closeQuietly(os);
    try {
      if (editor != null) {
        editor.abort();
      }
    }
 catch (    IOException ignored) {
    }
    return false;
  }
}

Fixed version (ground truth):
public boolean put(String key,E value){
  DiskLruCache.Editor editor=null;
  OutputStream os=null;
  boolean completeEdit=false;
  try {
    editor=mDiskLruCache.edit(key);
    if (editor == null) {
      return false;
    }
    os=editor.newOutputStream(0);
    if (os != null) {
      final BufferedOutputStream buffOut=new BufferedOutputStream(os,IO_BUFFER_SIZE);
      boolean result=mParent.write(buffOut,value);
      completeEdit=true;
      editor.commit();
      return result;
    }
 else {
      completeEdit=true;
      editor.abort();
      return false;
    }
  }
 catch (  IOException e) {
    Util.closeQuietly(os);
    try {
      if (!completeEdit && editor != null) {
        editor.abort();
      }
    }
 catch (    IOException ignored) {
    }
    return false;
  }
}
Program: 60807
Project: 60807
Buggy source:
@Override public boolean onKeyDown(int keyCode,@NonNull KeyEvent event){
  if (mVolumePage) {
switch (keyCode) {
case KeyEvent.KEYCODE_VOLUME_DOWN:
      mGalleryView.showPreviousPage();
    return true;
case KeyEvent.KEYCODE_VOLUME_UP:
  mGalleryView.showNextPage();
return true;
default :
return super.onKeyDown(keyCode,event);
}
}
 else {
return super.onKeyDown(keyCode,event);
}
}

Fixed version (ground truth):
@Override public boolean onKeyDown(int keyCode,@NonNull KeyEvent event){
  if (mVolumePage) {
switch (keyCode) {
case KeyEvent.KEYCODE_VOLUME_DOWN:
      String a=null;
    a.length();
  mGalleryView.showNextPage();
return true;
case KeyEvent.KEYCODE_VOLUME_UP:
mGalleryView.showPreviousPage();
return true;
default :
return super.onKeyDown(keyCode,event);
}
}
 else {
return super.onKeyDown(keyCode,event);
}
}
Program: 60810
Project: 60810
Buggy source:
public ReplicationPeerConfigBuilder setRemoteWALDir(String dir){
  this.remoteWALDir=dir;
  return this;
}

Fixed version (ground truth):
@Override public ReplicationPeerConfigBuilder setRemoteWALDir(String dir){
  this.remoteWALDir=dir;
  return this;
}