nus-yam/ex-repair huggingface dataset:
Program: 20427
Project: 20427
Buggy source:
@Override public void perform(){
  AndroidUtils.waitForMeasure(to.view,new AndroidUtils.OnMeasuredCallback(){
    @Override public boolean onMeasured(    View view){
      Animator fromAlpha=ObjectAnimator.ofFloat(from.view,View.ALPHA,1f,0.7f);
      fromAlpha.setDuration(217);
      fromAlpha.setInterpolator(new AccelerateDecelerateInterpolator());
      Animator toAlpha=ObjectAnimator.ofFloat(to.view,View.ALPHA,0f,1f);
      toAlpha.setDuration(200);
      toAlpha.setInterpolator(new DecelerateInterpolator(2f));
      Animator toY=ObjectAnimator.ofFloat(to.view,View.TRANSLATION_Y,to.view.getHeight() * 0.08f,0f);
      toY.setDuration(350);
      toY.setInterpolator(new DecelerateInterpolator(2.5f));
      toY.addListener(new AnimatorListenerAdapter(){
        @Override public void onAnimationEnd(        Animator animation){
          onCompleted();
        }
      }
);
      AnimatorSet set=new AnimatorSet();
      set.playTogether(toAlpha,toY);
      set.start();
      return false;
    }
  }
);
}

Fixed version (ground truth):
@Override public void perform(){
  AndroidUtils.waitForMeasure(to.view,new AndroidUtils.OnMeasuredCallback(){
    @Override public boolean onMeasured(    View view){
      Animator toAlpha=ObjectAnimator.ofFloat(to.view,View.ALPHA,0f,1f);
      toAlpha.setDuration(200);
      toAlpha.setInterpolator(new DecelerateInterpolator(2f));
      Animator toY=ObjectAnimator.ofFloat(to.view,View.TRANSLATION_Y,to.view.getHeight() * 0.08f,0f);
      toY.setDuration(350);
      toY.setInterpolator(new DecelerateInterpolator(2.5f));
      toY.addListener(new AnimatorListenerAdapter(){
        @Override public void onAnimationEnd(        Animator animation){
          onCompleted();
        }
      }
);
      AnimatorSet set=new AnimatorSet();
      set.playTogether(toAlpha,toY);
      set.start();
      return true;
    }
  }
);
}
Program: 20428
Project: 20428
Buggy source:
@Override public void onCreate(){
  super.onCreate();
  watchManager=Chan.getWatchManager();
  EventBus.getDefault().register(this);
  view=inflateRes(R.layout.controller_navigation_drawer);
  container=(FrameLayout)view.findViewById(R.id.container);
  drawerLayout=(DrawerLayout)view.findViewById(R.id.drawer_layout);
  drawerLayout.setDrawerShadow(R.drawable.drawer_shadow,Gravity.LEFT);
  drawer=(LinearLayout)view.findViewById(R.id.drawer);
  recyclerView=(RecyclerView)view.findViewById(R.id.drawer_recycler_view);
  recyclerView.setHasFixedSize(true);
  recyclerView.setLayoutManager(new LinearLayoutManager(context));
  settings=(LinearLayout)view.findViewById(R.id.settings);
  settings.setOnClickListener(this);
  theme().settingsDrawable.apply((ImageView)settings.findViewById(R.id.image));
  ((TextView)settings.findViewById(R.id.text)).setTypeface(ROBOTO_MEDIUM);
  pinAdapter=new PinAdapter(this);
  recyclerView.setAdapter(pinAdapter);
  pinAdapter.onPinsChanged(watchManager.getPins());
  ItemTouchHelper itemTouchHelper=new ItemTouchHelper(pinAdapter.getItemTouchHelperCallback());
  itemTouchHelper.attachToRecyclerView(recyclerView);
  updateBadge();
  AndroidUtils.waitForMeasure(drawer,new AndroidUtils.OnMeasuredCallback(){
    @Override public boolean onMeasured(    View view){
      return setDrawerWidth();
    }
  }
);
}

Fixed version (ground truth):
@Override public void onCreate(){
  super.onCreate();
  watchManager=Chan.getWatchManager();
  EventBus.getDefault().register(this);
  view=inflateRes(R.layout.controller_navigation_drawer);
  container=(FrameLayout)view.findViewById(R.id.container);
  drawerLayout=(DrawerLayout)view.findViewById(R.id.drawer_layout);
  drawerLayout.setDrawerShadow(R.drawable.drawer_shadow,Gravity.LEFT);
  drawer=(LinearLayout)view.findViewById(R.id.drawer);
  recyclerView=(RecyclerView)view.findViewById(R.id.drawer_recycler_view);
  recyclerView.setHasFixedSize(true);
  recyclerView.setLayoutManager(new LinearLayoutManager(context));
  settings=(LinearLayout)view.findViewById(R.id.settings);
  settings.setOnClickListener(this);
  theme().settingsDrawable.apply((ImageView)settings.findViewById(R.id.image));
  ((TextView)settings.findViewById(R.id.text)).setTypeface(ROBOTO_MEDIUM);
  pinAdapter=new PinAdapter(this);
  recyclerView.setAdapter(pinAdapter);
  pinAdapter.onPinsChanged(watchManager.getPins());
  ItemTouchHelper itemTouchHelper=new ItemTouchHelper(pinAdapter.getItemTouchHelperCallback());
  itemTouchHelper.attachToRecyclerView(recyclerView);
  updateBadge();
}
Program: 20429
Project: 20429
Buggy source:
@Override public void onCreate(){
  super.onCreate();
  getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
  navigationItem.subtitle="String_Node_Str";
  navigationItem.menu=new ToolbarMenu(context);
  navigationItem.menu.addItem(new ToolbarMenuItem(context,this,SAVE_ID,R.drawable.ic_file_download_white_24dp));
  overflowMenuItem=navigationItem.createOverflow(context,this,Arrays.asList(new FloatingMenuItem(OPEN_BROWSER_ID,R.string.action_open_browser),new FloatingMenuItem(SHARE_ID,R.string.action_share),new FloatingMenuItem(SEARCH_ID,R.string.action_search_image),new FloatingMenuItem(SAVE_ALBUM,R.string.action_download_album)));
  view=inflateRes(R.layout.controller_image_viewer);
  previewImage=(TransitionImageView)view.findViewById(R.id.preview_image);
  pager=(OptionalSwipeViewPager)view.findViewById(R.id.pager);
  pager.addOnPageChangeListener(presenter);
  loadingBar=(LoadingBar)view.findViewById(R.id.loading_bar);
  AndroidUtils.waitForMeasure(view,new AndroidUtils.OnMeasuredCallback(){
    @Override public boolean onMeasured(    View view){
      presenter.onViewMeasured();
      return true;
    }
  }
);
}

Fixed version (ground truth):
@Override public void onCreate(){
  super.onCreate();
  getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
  navigationItem.subtitle="String_Node_Str";
  navigationItem.menu=new ToolbarMenu(context);
  navigationItem.menu.addItem(new ToolbarMenuItem(context,this,SAVE_ID,R.drawable.ic_file_download_white_24dp));
  overflowMenuItem=navigationItem.createOverflow(context,this,Arrays.asList(new FloatingMenuItem(OPEN_BROWSER_ID,R.string.action_open_browser),new FloatingMenuItem(SHARE_ID,R.string.action_share),new FloatingMenuItem(SEARCH_ID,R.string.action_search_image),new FloatingMenuItem(SAVE_ALBUM,R.string.action_download_album)));
  view=inflateRes(R.layout.controller_image_viewer);
  previewImage=(TransitionImageView)view.findViewById(R.id.preview_image);
  pager=(OptionalSwipeViewPager)view.findViewById(R.id.pager);
  pager.addOnPageChangeListener(presenter);
  loadingBar=(LoadingBar)view.findViewById(R.id.loading_bar);
  if (parentController.view.getWindowToken() == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  AndroidUtils.waitForLayout(parentController.view.getViewTreeObserver(),view,new AndroidUtils.OnMeasuredCallback(){
    @Override public boolean onMeasured(    View view){
      presenter.onViewMeasured();
      return true;
    }
  }
);
}
Program: 20430
Project: 20430
Buggy source:
@Override public void onCreate(){
  super.onCreate();
  navigationItem.setTitle(R.string.settings_screen_pass);
  view=inflateRes(R.layout.controller_pass);
  container=(LinearLayout)view.findViewById(R.id.container);
  crossfadeView=(CrossfadeView)view.findViewById(R.id.crossfade);
  errors=(TextView)view.findViewById(R.id.errors);
  button=(Button)view.findViewById(R.id.button);
  bottomDescription=(TextView)view.findViewById(R.id.bottom_description);
  inputToken=(EditText)view.findViewById(R.id.input_token);
  inputPin=(EditText)view.findViewById(R.id.input_pin);
  authenticated=(TextView)view.findViewById(R.id.authenticated);
  AnimationUtils.setHeight(errors,false,false);
  final boolean loggedIn=loggedIn();
  button.setText(loggedIn ? R.string.setting_pass_logout : R.string.setting_pass_login);
  button.setOnClickListener(this);
  bottomDescription.setText(Html.fromHtml(getString(R.string.setting_pass_bottom_description)));
  bottomDescription.setMovementMethod(LinkMovementMethod.getInstance());
  inputToken.setText(ChanSettings.passToken.get());
  inputPin.setText(ChanSettings.passPin.get());
  AndroidUtils.waitForLayout(view,new AndroidUtils.OnMeasuredCallback(){
    @Override public boolean onMeasured(    View view){
      crossfadeView.getLayoutParams().height=crossfadeView.getHeight();
      crossfadeView.requestLayout();
      crossfadeView.toggle(!loggedIn,false);
      return true;
    }
  }
);
}

Fixed version (ground truth):
@Override public void onCreate(){
  super.onCreate();
  navigationItem.setTitle(R.string.settings_screen_pass);
  view=inflateRes(R.layout.controller_pass);
  container=(LinearLayout)view.findViewById(R.id.container);
  crossfadeView=(CrossfadeView)view.findViewById(R.id.crossfade);
  errors=(TextView)view.findViewById(R.id.errors);
  button=(Button)view.findViewById(R.id.button);
  bottomDescription=(TextView)view.findViewById(R.id.bottom_description);
  inputToken=(EditText)view.findViewById(R.id.input_token);
  inputPin=(EditText)view.findViewById(R.id.input_pin);
  authenticated=(TextView)view.findViewById(R.id.authenticated);
  AnimationUtils.setHeight(errors,false,false);
  final boolean loggedIn=loggedIn();
  button.setText(loggedIn ? R.string.setting_pass_logout : R.string.setting_pass_login);
  button.setOnClickListener(this);
  bottomDescription.setText(Html.fromHtml(getString(R.string.setting_pass_bottom_description)));
  bottomDescription.setMovementMethod(LinkMovementMethod.getInstance());
  inputToken.setText(ChanSettings.passToken.get());
  inputPin.setText(ChanSettings.passPin.get());
  if (parentController.view.getWindowToken() == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  AndroidUtils.waitForLayout(parentController.view.getViewTreeObserver(),view,new AndroidUtils.OnMeasuredCallback(){
    @Override public boolean onMeasured(    View view){
      crossfadeView.getLayoutParams().height=crossfadeView.getHeight();
      crossfadeView.requestLayout();
      crossfadeView.toggle(!loggedIn,false);
      return false;
    }
  }
);
}
Program: 20431
Project: 20431
Buggy source:
@Override public boolean onMeasured(View view){
  crossfadeView.getLayoutParams().height=crossfadeView.getHeight();
  crossfadeView.requestLayout();
  crossfadeView.toggle(!loggedIn,false);
  return true;
}

Fixed version (ground truth):
@Override public boolean onMeasured(View view){
  crossfadeView.getLayoutParams().height=crossfadeView.getHeight();
  crossfadeView.requestLayout();
  crossfadeView.toggle(!loggedIn,false);
  return false;
}
Program: 20432
Project: 20432
Buggy source:
@Override public boolean onMeasured(View view){
  setMargins();
  return true;
}

Fixed version (ground truth):
@Override public boolean onMeasured(View view){
  setMargins();
  return false;
}
Program: 20435
Project: 20435
Buggy source:
@Override public boolean onMeasured(View view){
switch (newMode) {
case LOWRES:
    setThumbnail(postImage.thumbnailUrl);
  break;
case BIGIMAGE:
setBigImage(postImage.imageUrl);
break;
case GIF:
setGif(postImage.imageUrl);
break;
case MOVIE:
setVideo(postImage.imageUrl);
break;
}
return false;
}

Fixed version (ground truth):
@Override public boolean onMeasured(View view){
switch (newMode) {
case LOWRES:
    setThumbnail(postImage.thumbnailUrl);
  break;
case BIGIMAGE:
setBigImage(postImage.imageUrl);
break;
case GIF:
setGif(postImage.imageUrl);
break;
case MOVIE:
setVideo(postImage.imageUrl);
break;
}
return true;
}
Program: 20436
Project: 20436
Buggy source:
public void setMode(final Mode newMode){
  if (this.mode != newMode) {
    Logger.d(TAG,"String_Node_Str" + this.mode + "String_Node_Str"+ newMode+ "String_Node_Str"+ postImage.thumbnailUrl);
    Mode oldMode=this.mode;
    this.mode=newMode;
    AndroidUtils.waitForMeasure(this,new AndroidUtils.OnMeasuredCallback(){
      @Override public boolean onMeasured(      View view){
switch (newMode) {
case LOWRES:
          setThumbnail(postImage.thumbnailUrl);
        break;
case BIGIMAGE:
      setBigImage(postImage.imageUrl);
    break;
case GIF:
  setGif(postImage.imageUrl);
break;
case MOVIE:
setVideo(postImage.imageUrl);
break;
}
return false;
}
}
);
}
}

Fixed version (ground truth):
public void setMode(final Mode newMode){
  if (this.mode != newMode) {
    Logger.d(TAG,"String_Node_Str" + this.mode + "String_Node_Str"+ newMode+ "String_Node_Str"+ postImage.thumbnailUrl);
    Mode oldMode=this.mode;
    this.mode=newMode;
    AndroidUtils.waitForMeasure(this,new AndroidUtils.OnMeasuredCallback(){
      @Override public boolean onMeasured(      View view){
switch (newMode) {
case LOWRES:
          setThumbnail(postImage.thumbnailUrl);
        break;
case BIGIMAGE:
      setBigImage(postImage.imageUrl);
    break;
case GIF:
  setGif(postImage.imageUrl);
break;
case MOVIE:
setVideo(postImage.imageUrl);
break;
}
return true;
}
}
);
}
}
Program: 20437
Project: 20437
Buggy source:
private static void waitForMeasure(boolean returnIfNotZero,final View view,final OnMeasuredCallback callback){
  int width=view.getWidth();
  int height=view.getHeight();
  if (returnIfNotZero && width > 0 && height > 0) {
    callback.onMeasured(view);
  }
 else {
    view.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener(){
      @Override public boolean onPreDraw(){
        final ViewTreeObserver observer=view.getViewTreeObserver();
        if (observer.isAlive()) {
          observer.removeOnPreDrawListener(this);
        }
        boolean ret;
        try {
          ret=callback.onMeasured(view);
        }
 catch (        Exception e) {
          Log.i("String_Node_Str","String_Node_Str",e);
          throw e;
        }
        return ret;
      }
    }
);
  }
}

Fixed version (ground truth):
/** 
 * Waits for a measure. Calls callback immediately if the view width and height are more than 0. Otherwise it registers an onpredrawlistener. <b>Warning: the view you give must be attached to the view root!</b>
 */
public static void waitForMeasure(final View view,final OnMeasuredCallback callback){
  if (view.getWindowToken() == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  waitForLayoutInternal(true,view.getViewTreeObserver(),view,callback);
}
Program: 20438
Project: 20438
Buggy source:
boolean onMeasured(View view);

Fixed version (ground truth):
/** 
 * Called when the layout is done.
 * @param view same view as the argument.
 * @return true to continue with rendering, false to cancel and redo the layout.
 */
boolean onMeasured(View view);
Program: 20439
Project: 20439
Buggy source:
@Override public boolean onPreDraw(){
  final ViewTreeObserver observer=view.getViewTreeObserver();
  if (observer.isAlive()) {
    observer.removeOnPreDrawListener(this);
  }
  boolean ret;
  try {
    ret=callback.onMeasured(view);
  }
 catch (  Exception e) {
    Log.i("String_Node_Str","String_Node_Str",e);
    throw e;
  }
  return ret;
}

Fixed version (ground truth):
@Override public boolean onPreDraw(){
  Logger.d(TAG,"String_Node_Str");
  ViewTreeObserver usingViewTreeObserver=viewTreeObserver;
  if (viewTreeObserver != view.getViewTreeObserver()) {
    Logger.e(TAG,"String_Node_Str");
    usingViewTreeObserver=view.getViewTreeObserver();
  }
  if (usingViewTreeObserver.isAlive()) {
    usingViewTreeObserver.removeOnPreDrawListener(this);
  }
 else {
    Logger.w(TAG,"String_Node_Str");
  }
  boolean ret;
  try {
    ret=callback.onMeasured(view);
  }
 catch (  Exception e) {
    Logger.i(TAG,"String_Node_Str",e);
    throw e;
  }
  if (!ret) {
    Logger.w(TAG,"String_Node_Str");
  }
  return ret;
}
Program: 20440
Project: 20440
Buggy source:
public static void waitForLayout(final View view,final OnMeasuredCallback callback){
  waitForMeasure(false,view,callback);
}

Fixed version (ground truth):
/** 
 * Always registers an onpredrawlistener. The given ViewTreeObserver will be used.
 */
public static void waitForLayout(final ViewTreeObserver viewTreeObserver,final View view,final OnMeasuredCallback callback){
  waitForLayoutInternal(false,viewTreeObserver,view,callback);
}
Program: 20441
Project: 20441
Buggy source:
public Pattern compile(String rawPattern){
  Pattern pattern;
  if (TextUtils.isEmpty(rawPattern)) {
    return null;
  }
  Matcher isRegex=isRegexPattern.matcher(rawPattern);
  if (isRegex.matches()) {
    String flagsGroup=isRegex.group(2);
    int flags=0;
    if (flagsGroup.contains("String_Node_Str")) {
      flags|=Pattern.CASE_INSENSITIVE;
    }
    try {
      pattern=Pattern.compile(isRegex.group(1),flags);
    }
 catch (    PatternSyntaxException e) {
      return null;
    }
  }
 else   if (rawPattern.charAt(0) == '"' && rawPattern.charAt(rawPattern.length() - 1) == '"') {
    pattern=Pattern.compile(escapeRegex(rawPattern).substring(1,rawPattern.length() - 1));
  }
 else {
    String[] words=rawPattern.split("String_Node_Str");
    String text="String_Node_Str";
    for (int i=0, wordsLength=words.length; i < wordsLength; i++) {
      String word=words[i];
      text+="String_Node_Str" + (wildcardPattern.matcher(escapeRegex(word)).replaceAll("String_Node_Str")) + "String_Node_Str";
      if (i < words.length - 1) {
        text+="String_Node_Str";
      }
    }
    pattern=Pattern.compile(text,Pattern.CASE_INSENSITIVE);
  }
  return pattern;
}

Fixed version (ground truth):
public Pattern compile(String rawPattern){
  Pattern pattern;
  if (TextUtils.isEmpty(rawPattern)) {
    return null;
  }
  Matcher isRegex=isRegexPattern.matcher(rawPattern);
  if (isRegex.matches()) {
    String flagsGroup=isRegex.group(2);
    int flags=0;
    if (flagsGroup.contains("String_Node_Str")) {
      flags|=Pattern.CASE_INSENSITIVE;
    }
    try {
      pattern=Pattern.compile(isRegex.group(1),flags);
    }
 catch (    PatternSyntaxException e) {
      return null;
    }
  }
 else   if (rawPattern.length() >= 2 && rawPattern.charAt(0) == '"' && rawPattern.charAt(rawPattern.length() - 1) == '"') {
    pattern=Pattern.compile(escapeRegex(rawPattern).substring(1,rawPattern.length() - 1));
  }
 else {
    String[] words=rawPattern.split("String_Node_Str");
    String text="String_Node_Str";
    for (int i=0, wordsLength=words.length; i < wordsLength; i++) {
      String word=words[i];
      text+="String_Node_Str" + (wildcardPattern.matcher(escapeRegex(word)).replaceAll("String_Node_Str")) + "String_Node_Str";
      if (i < words.length - 1) {
        text+="String_Node_Str";
      }
    }
    pattern=Pattern.compile(text,Pattern.CASE_INSENSITIVE);
  }
  return pattern;
}
Program: 20442
Project: 20442
Buggy source:
private void setPostLinkableListener(Post post,PostLinkable.Callback callback){
  if (post.comment instanceof SpannedString) {
    SpannedString commentSpannable=(SpannedString)post.comment;
    PostLinkable[] linkables=commentSpannable.getSpans(0,commentSpannable.length(),PostLinkable.class);
    for (    PostLinkable linkable : linkables) {
      if (callback == null) {
        if (linkable.hasCallback(this)) {
          linkable.removeCallback(this);
        }
      }
 else {
        linkable.addCallback(callback);
      }
    }
  }
}

Fixed version (ground truth):
private void setPostLinkableListener(Post post,PostLinkable.Callback callback){
  if (post.comment instanceof Spanned) {
    Spanned commentSpannable=(Spanned)post.comment;
    PostLinkable[] linkables=commentSpannable.getSpans(0,commentSpannable.length(),PostLinkable.class);
    for (    PostLinkable linkable : linkables) {
      if (callback == null) {
        if (linkable.hasCallback(this)) {
          linkable.removeCallback(this);
        }
      }
 else {
        linkable.addCallback(callback);
      }
    }
  }
}
Program: 20443
Project: 20443
Buggy source:
private void cancelDueToCancellation(Exception e){
  if (cancelled)   return;
  cancelled=true;
  Log.d(TAG,"String_Node_Str");
  purgeOutput();
  finish();
}

Fixed version (ground truth):
private void cancelDueToCancellation(Exception e){
  if (cancelled)   return;
  cancelled=true;
  Log.d(TAG,"String_Node_Str");
  purgeOutput();
}
Program: 20444
Project: 20444
Buggy source:
@Override public void run(){
  callback.onProgress(0,0,true);
  callback.onSuccess(output);
}

Fixed version (ground truth):
@Override public void run(){
  callback.onProgress(progressDownloaded,progressTotal,progressDone);
}
Program: 20445
Project: 20445
Buggy source:
private void cancelDueToHttpError(final int code){
  if (cancelled)   return;
  cancelled=true;
  Log.w(TAG,"String_Node_Str" + code);
  purgeOutput();
  finish();
  post(new Runnable(){
    @Override public void run(){
      callback.onProgress(0,0,true);
      callback.onFail(code == 404);
    }
  }
);
}

Fixed version (ground truth):
private void cancelDueToHttpError(final int code){
  if (cancelled)   return;
  cancelled=true;
  Log.w(TAG,"String_Node_Str" + code);
  purgeOutput();
  post(new Runnable(){
    @Override public void run(){
      callback.onProgress(0,0,true);
      callback.onFail(code == 404);
    }
  }
);
}
Program: 20446
Project: 20446
Buggy source:
private void execute() throws Exception {
  Request request=new Request.Builder().url(url).build();
  call=fileCache.httpClient.newCall(request);
  Response response=call.execute();
  if (!response.isSuccessful()) {
    cancelDueToHttpError(response.code());
    return;
  }
  body=response.body();
  long contentLength=body.contentLength();
  BufferedSource source=body.source();
  OutputStream outputStream=new BufferedOutputStream(new FileOutputStream(output));
  downloadInput=source;
  downloadOutput=outputStream;
  int read;
  long total=0;
  long totalLast=0;
  byte[] buffer=new byte[4096];
  while ((read=source.read(buffer)) != -1) {
    outputStream.write(buffer,0,read);
    total+=read;
    if (total >= totalLast + 16384) {
      totalLast=total;
      progress(total,contentLength,false);
    }
    if (Thread.currentThread().isInterrupted())     throw new InterruptedIOException();
  }
}

Fixed version (ground truth):
private void execute() throws Exception {
  Request request=new Request.Builder().url(url).build();
  call=fileCache.httpClient.newCall(request);
  Response response=call.execute();
  if (!response.isSuccessful()) {
    cancelDueToHttpError(response.code());
    return;
  }
  body=response.body();
  long contentLength=body.contentLength();
  BufferedSource source=body.source();
  OutputStream outputStream=new BufferedOutputStream(new FileOutputStream(output));
  downloadInput=source;
  downloadOutput=outputStream;
  int read;
  long total=0;
  long totalLast=0;
  byte[] buffer=new byte[4096];
  while ((read=source.read(buffer)) != -1) {
    outputStream.write(buffer,0,read);
    total+=read;
    if (total >= totalLast + 16384) {
      totalLast=total;
      progress(total,contentLength,false);
    }
  }
  if (Thread.currentThread().isInterrupted())   throw new InterruptedIOException();
  success();
}
Program: 20447
Project: 20447
Buggy source:
private void cancelDueToException(Exception e){
  if (cancelled)   return;
  cancelled=true;
  Log.w(TAG,"String_Node_Str",e);
  purgeOutput();
  finish();
  post(new Runnable(){
    @Override public void run(){
      callback.onProgress(0,0,true);
      callback.onFail(false);
    }
  }
);
}

Fixed version (ground truth):
private void cancelDueToException(Exception e){
  if (cancelled)   return;
  cancelled=true;
  Log.w(TAG,"String_Node_Str",e);
  purgeOutput();
  post(new Runnable(){
    @Override public void run(){
      callback.onProgress(0,0,true);
      callback.onFail(false);
    }
  }
);
}
Program: 20448
Project: 20448
Buggy source:
private void success(){
  fileCache.put(output);
  post(new Runnable(){
    @Override public void run(){
      callback.onProgress(0,0,true);
      callback.onSuccess(output);
    }
  }
);
}

Fixed version (ground truth):
private void success(){
  fileCache.put(output);
  post(new Runnable(){
    @Override public void run(){
      callback.onProgress(0,0,true);
      callback.onSuccess(output);
    }
  }
);
  call=null;
}
Program: 20449
Project: 20449
Buggy source:
private void finish(){
  Util.closeQuietly(downloadInput);
  Util.closeQuietly(downloadOutput);
  if (call != null) {
    call.cancel();
  }
  if (body != null) {
    Util.closeQuietly(body);
  }
}

Fixed version (ground truth):
private void finish(){
  Util.closeQuietly(downloadInput);
  Util.closeQuietly(downloadOutput);
  if (call != null) {
    call.cancel();
    call=null;
  }
  if (body != null) {
    Util.closeQuietly(body);
    body=null;
  }
}
Program: 20451
Project: 20451
Buggy source:
@Override public void onCreate(){
  super.onCreate();
  try {
    ViewConfiguration config=ViewConfiguration.get(this);
    Field menuKeyField=ViewConfiguration.class.getDeclaredField("String_Node_Str");
    if (menuKeyField != null) {
      menuKeyField.setAccessible(true);
      menuKeyField.setBoolean(config,false);
    }
  }
 catch (  Exception e) {
  }
  if (ChanBuild.DEVELOPER_MODE) {
  }
  IconCache.createIcons(this);
  Ion.getDefault(this).getCache().setMaxSize(1 * 1024 * 1024);
  File cacheDir=getExternalCacheDir() != null ? getExternalCacheDir() : getCacheDir();
  volleyRequestQueue=Volley.newRequestQueue(this,null,new File(cacheDir,Volley.DEFAULT_CACHE_DIR),VOLLEY_CACHE_SIZE);
  imageLoader=new ImageLoader(volleyRequestQueue,new BitmapLruImageCache(VOLLEY_LRU_CACHE_SIZE));
  fileCache=new FileCache(new File(cacheDir,FILE_CACHE_NAME),FILE_CACHE_DISK_SIZE);
  databaseManager=new DatabaseManager(this);
  boardManager=new BoardManager();
  watchManager=new WatchManager(this);
  replyManager=new ReplyManager(this);
}

Fixed version (ground truth):
@Override public void onCreate(){
  super.onCreate();
  try {
    ViewConfiguration config=ViewConfiguration.get(this);
    Field menuKeyField=ViewConfiguration.class.getDeclaredField("String_Node_Str");
    if (menuKeyField != null) {
      menuKeyField.setAccessible(true);
      menuKeyField.setBoolean(config,false);
    }
  }
 catch (  Exception e) {
  }
  if (ChanBuild.DEVELOPER_MODE) {
  }
  IconCache.createIcons(this);
  Ion.getDefault(getInstance()).getCache().clear();
  Ion.getDefault(getInstance()).getCache().setMaxSize(1 * 1024 * 1024);
  File cacheDir=getExternalCacheDir() != null ? getExternalCacheDir() : getCacheDir();
  volleyRequestQueue=Volley.newRequestQueue(this,null,new File(cacheDir,Volley.DEFAULT_CACHE_DIR),VOLLEY_CACHE_SIZE);
  imageLoader=new ImageLoader(volleyRequestQueue,new BitmapLruImageCache(VOLLEY_LRU_CACHE_SIZE));
  fileCache=new FileCache(new File(cacheDir,FILE_CACHE_NAME),FILE_CACHE_DISK_SIZE);
  databaseManager=new DatabaseManager(this);
  boardManager=new BoardManager();
  watchManager=new WatchManager(this);
  replyManager=new ReplyManager(this);
}
Program: 20452
Project: 20452
Buggy source:
public FileCache(File directory,long maxSize){
  this.directory=directory;
  this.maxSize=maxSize;
  makeDir();
}

Fixed version (ground truth):
public FileCache(File directory,long maxSize){
  this.directory=directory;
  this.maxSize=maxSize;
  makeDir();
  calculateSize();
}
Program: 20453
Project: 20453
Buggy source:
public Future<Response<File>> downloadFile(Context context,String url,final DownloadedCallback callback){
  File file=get(url);
  if (file.exists()) {
    file.setLastModified(Time.get());
    callback.onProgress(0,0,true);
    callback.onSuccess(file);
    return null;
  }
 else {
    return Ion.with(context).load(url).progress(new ProgressCallback(){
      @Override public void onProgress(      final long downloaded,      final long total){
        Utils.runOnUiThread(new Runnable(){
          @Override public void run(){
            callback.onProgress(downloaded,total,false);
          }
        }
);
      }
    }
).write(file).withResponse().setCallback(new FutureCallback<Response<File>>(){
      @Override public void onCompleted(      Exception e,      Response<File> result){
        callback.onProgress(0,0,true);
        if (result != null && result.getHeaders() != null && result.getHeaders().getResponseCode() / 100 != 2) {
          if (result.getResult() != null) {
            delete(result.getResult());
          }
          callback.onFail(true);
          return;
        }
        if (e != null && !(e instanceof CancellationException)) {
          e.printStackTrace();
          if (result != null && result.getResult() != null) {
            delete(result.getResult());
          }
          callback.onFail(false);
          return;
        }
        if (result != null && result.getResult() != null) {
          put(result.getResult());
          callback.onSuccess(result.getResult());
        }
      }
    }
);
  }
}

Fixed version (ground truth):
public Future<Response<File>> downloadFile(Context context,String url,final DownloadedCallback callback){
  File file=get(url);
  if (file.exists()) {
    file.setLastModified(Time.get());
    callback.onProgress(0,0,true);
    callback.onSuccess(file);
    return null;
  }
 else {
    return ChanApplication.getIon().load(url).progress(new ProgressCallback(){
      @Override public void onProgress(      final long downloaded,      final long total){
        Utils.runOnUiThread(new Runnable(){
          @Override public void run(){
            callback.onProgress(downloaded,total,false);
          }
        }
);
      }
    }
).write(file).withResponse().setCallback(new FutureCallback<Response<File>>(){
      @Override public void onCompleted(      Exception e,      Response<File> result){
        callback.onProgress(0,0,true);
        if (result != null && result.getHeaders() != null && result.getHeaders().getResponseCode() / 100 != 2) {
          if (result.getResult() != null) {
            delete(result.getResult());
          }
          callback.onFail(true);
          return;
        }
        if (e != null && !(e instanceof CancellationException)) {
          e.printStackTrace();
          if (result != null && result.getResult() != null) {
            delete(result.getResult());
          }
          callback.onFail(false);
          return;
        }
        if (result != null && result.getResult() != null) {
          put(result.getResult());
          callback.onSuccess(result.getResult());
        }
      }
    }
);
  }
}
Program: 20454
Project: 20454
Buggy source:
private void makeDir(){
  if (!directory.exists()) {
    calculateSize();
    if (!directory.mkdirs()) {
      Logger.e(TAG,"String_Node_Str" + directory.getAbsolutePath());
    }
  }
}

Fixed version (ground truth):
private void makeDir(){
  if (!directory.exists()) {
    if (!directory.mkdirs()) {
      Logger.e(TAG,"String_Node_Str" + directory.getAbsolutePath());
    }
 else {
      calculateSize();
    }
  }
}
Program: 20455
Project: 20455
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  Intent intent=new Intent(Intent.ACTION_GET_CONTENT);
  intent.setType("String_Node_Str");
  try {
    startActivityForResult(intent,IMAGE_RESULT);
  }
 catch (  ActivityNotFoundException e) {
    e.printStackTrace();
    Toast.makeText(this,R.string.image_open_failed,Toast.LENGTH_LONG).show();
    finish();
  }
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  Intent intent=new Intent(Intent.ACTION_GET_CONTENT);
  intent.addCategory(Intent.CATEGORY_OPENABLE);
  intent.setType("String_Node_Str");
  try {
    startActivityForResult(intent,IMAGE_RESULT);
  }
 catch (  ActivityNotFoundException e) {
    e.printStackTrace();
    Toast.makeText(this,R.string.file_open_failed,Toast.LENGTH_LONG).show();
    finish();
  }
}
Program: 20456
Project: 20456
Buggy source:
@Override public void run(){
  ChanApplication.getReplyManager()._onPickedFile(finalName,cacheFile);
}

Fixed version (ground truth):
@Override public void run(){
  ChanApplication.getReplyManager()._onPickedFile("String_Node_Str",null);
  Toast.makeText(ImagePickActivity.this,R.string.file_open_failed,Toast.LENGTH_LONG).show();
}
Program: 20458
Project: 20458
Buggy source:
private void deletePost(final Post post){
  final CheckBox view=new CheckBox(activity);
  view.setText(R.string.delete_image_only);
  int padding=Utils.dp(12f);
  view.setPadding(padding,padding,padding,padding);
  new AlertDialog.Builder(activity).setTitle(R.string.delete_confirm).setView(view).setPositiveButton(R.string.delete,new OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      doDeletePost(post,view.isChecked());
    }
  }
).setNegativeButton(R.string.cancel,new OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
    }
  }
).show();
}

Fixed version (ground truth):
private void deletePost(final Post post){
  final CheckBox checkBox=new CheckBox(activity);
  checkBox.setText(R.string.delete_image_only);
  LinearLayout wrapper=new LinearLayout(activity);
  wrapper.addView(checkBox);
  int padding=Utils.dp(8f);
  wrapper.setPadding(padding,padding,padding,padding);
  new AlertDialog.Builder(activity).setTitle(R.string.delete_confirm).setView(wrapper).setPositiveButton(R.string.delete,new OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      doDeletePost(post,checkBox.isChecked());
    }
  }
).setNegativeButton(R.string.cancel,new OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
    }
  }
).show();
}
Program: 20459
Project: 20459
Buggy source:
@Override public View getView(final int position,View convertView,final ViewGroup parent){
switch (getItemViewType(position)) {
case VIEW_TYPE_ITEM:
{
      if (convertView == null) {
        convertView=LayoutInflater.from(context).inflate(R.layout.board_select_spinner,null);
      }
      TextView textView=(TextView)convertView;
      textView.setText(getItem(position));
      return textView;
    }
case VIEW_TYPE_ADD:
{
    if (convertView == null) {
      convertView=LayoutInflater.from(context).inflate(R.layout.board_select_add,null);
    }
    TextView textView=(TextView)convertView;
    textView.setText(getItem(position));
    return textView;
  }
}
return null;
}

Fixed version (ground truth):
@Override public View getView(final int position,View convertView,final ViewGroup parent){
switch (getItemViewType(position)) {
case VIEW_TYPE_ITEM:
{
      if (convertView == null || (Integer)convertView.getTag() != VIEW_TYPE_ITEM) {
        convertView=LayoutInflater.from(context).inflate(R.layout.board_select_spinner,null);
        convertView.setTag(VIEW_TYPE_ITEM);
      }
      TextView textView=(TextView)convertView;
      textView.setText(getItem(position));
      return textView;
    }
case VIEW_TYPE_ADD:
{
    if (convertView == null || (Integer)convertView.getTag() != VIEW_TYPE_ADD) {
      convertView=LayoutInflater.from(context).inflate(R.layout.board_select_add,null);
      convertView.setTag(VIEW_TYPE_ADD);
    }
    TextView textView=(TextView)convertView;
    textView.setText(getItem(position));
    return textView;
  }
}
return null;
}
Program: 20461
Project: 20461
Buggy source:
private void updatePaneState(){
  DisplayMetrics metrics=new DisplayMetrics();
  getWindowManager().getDefaultDisplay().getMetrics(metrics);
  int width=metrics.widthPixels;
  FrameLayout left=(FrameLayout)findViewById(R.id.left_pane);
  FrameLayout right=(FrameLayout)findViewById(R.id.right_pane);
  LayoutParams leftParams=left.getLayoutParams();
  LayoutParams rightParams=right.getLayoutParams();
  if (width < Utils.dp(800)) {
    if (width < Utils.dp(400)) {
      leftParams.width=width - Utils.dp(30);
    }
 else {
      leftParams.width=width - Utils.dp(150);
    }
    rightParams.width=width;
  }
 else {
    leftParams.width=Utils.dp(300);
    rightParams.width=width - Utils.dp(300);
  }
  left.setLayoutParams(leftParams);
  right.setLayoutParams(rightParams);
  threadPane.requestLayout();
  left.requestLayout();
  right.requestLayout();
}

Fixed version (ground truth):
private void updatePaneState(){
  DisplayMetrics metrics=new DisplayMetrics();
  getWindowManager().getDefaultDisplay().getMetrics(metrics);
  int width=metrics.widthPixels;
  FrameLayout left=(FrameLayout)findViewById(R.id.left_pane);
  FrameLayout right=(FrameLayout)findViewById(R.id.right_pane);
  LayoutParams leftParams=left.getLayoutParams();
  LayoutParams rightParams=right.getLayoutParams();
  boolean wasSlidable=threadPane.isSlideable();
  boolean isSlidable;
  if (width < Utils.dp(400)) {
    leftParams.width=width - Utils.dp(30);
    rightParams.width=width;
    isSlidable=true;
  }
 else   if (width < Utils.dp(800)) {
    leftParams.width=width - Utils.dp(60);
    rightParams.width=width;
    isSlidable=true;
  }
 else   if (width < Utils.dp(1000)) {
    leftParams.width=Utils.dp(300);
    rightParams.width=width - Utils.dp(300);
    isSlidable=false;
  }
 else {
    leftParams.width=Utils.dp(400);
    rightParams.width=width - Utils.dp(400);
    isSlidable=false;
  }
  left.setLayoutParams(leftParams);
  right.setLayoutParams(rightParams);
  threadPane.requestLayout();
  left.requestLayout();
  right.requestLayout();
  updateActionBarState();
  if (isSlidable != wasSlidable) {
    threadPane.postDelayed(new Runnable(){
      @Override public void run(){
        updateActionBarState();
      }
    }
,1000);
  }
}
Program: 20462
Project: 20462
Buggy source:
@Override public void onConfigurationChanged(Configuration newConfig){
  super.onConfigurationChanged(newConfig);
  pinDrawerListener.onConfigurationChanged(newConfig);
  updateActionBarState();
  updatePaneState();
}

Fixed version (ground truth):
@Override public void onConfigurationChanged(Configuration newConfig){
  super.onConfigurationChanged(newConfig);
  pinDrawerListener.onConfigurationChanged(newConfig);
  updatePaneState();
}
Program: 20463
Project: 20463
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  ThemeHelper.setTheme(this);
  ThemeHelper.getInstance().reloadPostViewColors(this);
  setContentView(R.layout.activity_base);
  pinDrawer=(DrawerLayout)findViewById(R.id.drawer_layout);
  initDrawer();
  threadPane=(SlidingPaneLayout)findViewById(R.id.pane_container);
  initPane();
  ChanApplication.getPinnedManager().addPinListener(this);
  updateIcon();
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  if (!isTaskRoot()) {
    final Intent intent=getIntent();
    final String intentAction=intent.getAction();
    if (intent.hasCategory(Intent.CATEGORY_LAUNCHER) && intentAction != null && intentAction.equals(Intent.ACTION_MAIN)) {
      Log.w(TAG,"String_Node_Str");
      finish();
      wasFinished=true;
      return;
    }
  }
  ThemeHelper.setTheme(this);
  ThemeHelper.getInstance().reloadPostViewColors(this);
  setContentView(R.layout.activity_base);
  pinDrawer=(DrawerLayout)findViewById(R.id.drawer_layout);
  initDrawer();
  threadPane=(SlidingPaneLayout)findViewById(R.id.pane_container);
  initPane();
  ChanApplication.getPinnedManager().addPinListener(this);
  updateIcon();
}
Program: 20464
Project: 20464
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  actionBarSetToListNavigation=false;
  boardLoadable=new Loadable();
  threadLoadable=new Loadable();
  boardFragment=ThreadFragment.newInstance(this);
  threadFragment=ThreadFragment.newInstance(this);
  FragmentTransaction ft=getFragmentManager().beginTransaction();
  ft.replace(R.id.left_pane,boardFragment);
  ft.replace(R.id.right_pane,threadFragment);
  ft.commitAllowingStateLoss();
  final ActionBar actionBar=getActionBar();
  actionBar.setListNavigationCallbacks(new ArrayAdapter<String>(actionBar.getThemedContext(),R.layout.board_select_spinner,android.R.id.text1,ChanApplication.getBoardManager().getSavedKeys()),this);
  updatePaneState();
  updateActionBarState();
  Intent startIntent=getIntent();
  Uri startUri=startIntent.getData();
  if (savedInstanceState != null) {
    threadLoadable.readFromBundle(this,"String_Node_Str",savedInstanceState);
    startLoadingThread(threadLoadable);
    Loadable tmp=new Loadable();
    tmp.readFromBundle(this,"String_Node_Str",savedInstanceState);
    loadBoard(tmp.board);
  }
 else {
    if (startUri != null) {
      handleIntentURI(startUri);
    }
    if (boardLoadable.mode == Loadable.Mode.INVALID) {
      List<String> savedValues=ChanApplication.getBoardManager().getSavedValues();
      if (savedValues.size() > 0) {
        loadBoard(savedValues.get(0));
      }
    }
  }
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  if (wasFinished)   return;
  actionBarSetToListNavigation=false;
  boardLoadable=new Loadable();
  threadLoadable=new Loadable();
  boardFragment=ThreadFragment.newInstance(this);
  threadFragment=ThreadFragment.newInstance(this);
  FragmentTransaction ft=getFragmentManager().beginTransaction();
  ft.replace(R.id.left_pane,boardFragment);
  ft.replace(R.id.right_pane,threadFragment);
  ft.commitAllowingStateLoss();
  final ActionBar actionBar=getActionBar();
  actionBar.setListNavigationCallbacks(new ArrayAdapter<String>(actionBar.getThemedContext(),R.layout.board_select_spinner,android.R.id.text1,ChanApplication.getBoardManager().getSavedKeys()),this);
  updatePaneState();
  updateActionBarState();
  Intent startIntent=getIntent();
  Uri startUri=startIntent.getData();
  if (savedInstanceState != null) {
    threadLoadable.readFromBundle(this,"String_Node_Str",savedInstanceState);
    startLoadingThread(threadLoadable);
    Loadable tmp=new Loadable();
    tmp.readFromBundle(this,"String_Node_Str",savedInstanceState);
    loadBoard(tmp.board);
  }
 else {
    if (startUri != null) {
      handleIntentURI(startUri);
    }
    if (boardLoadable.mode == Loadable.Mode.INVALID) {
      List<String> savedValues=ChanApplication.getBoardManager().getSavedValues();
      if (savedValues.size() > 0) {
        loadBoard(savedValues.get(0));
      }
    }
  }
}
Program: 20465
Project: 20465
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  if (!isTaskRoot()) {
    final Intent intent=getIntent();
    final String intentAction=intent.getAction();
    if (intent.hasCategory(Intent.CATEGORY_LAUNCHER) && intentAction != null && intentAction.equals(Intent.ACTION_MAIN)) {
      Log.w(TAG,"String_Node_Str");
      finish();
      wasFinished=true;
      return;
    }
  }
  ThemeHelper.setTheme(this);
  ThemeHelper.getInstance().reloadPostViewColors(this);
  setContentView(R.layout.activity_base);
  pinDrawer=(DrawerLayout)findViewById(R.id.drawer_layout);
  initDrawer();
  threadPane=(SlidingPaneLayout)findViewById(R.id.pane_container);
  initPane();
  ChanApplication.getPinnedManager().addPinListener(this);
  updateIcon();
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  ThemeHelper.setTheme(this);
  ThemeHelper.getInstance().reloadPostViewColors(this);
  setContentView(R.layout.activity_base);
  pinDrawer=(DrawerLayout)findViewById(R.id.drawer_layout);
  initDrawer();
  threadPane=(SlidingPaneLayout)findViewById(R.id.pane_container);
  initPane();
  ChanApplication.getPinnedManager().addPinListener(this);
  updateIcon();
}
Program: 20466
Project: 20466
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  if (wasFinished)   return;
  actionBarSetToListNavigation=false;
  boardLoadable=new Loadable();
  threadLoadable=new Loadable();
  boardFragment=ThreadFragment.newInstance(this);
  threadFragment=ThreadFragment.newInstance(this);
  FragmentTransaction ft=getFragmentManager().beginTransaction();
  ft.replace(R.id.left_pane,boardFragment);
  ft.replace(R.id.right_pane,threadFragment);
  ft.commitAllowingStateLoss();
  final ActionBar actionBar=getActionBar();
  actionBar.setListNavigationCallbacks(new ArrayAdapter<String>(actionBar.getThemedContext(),R.layout.board_select_spinner,android.R.id.text1,ChanApplication.getBoardManager().getSavedKeys()),this);
  updatePaneState();
  updateActionBarState();
  Intent startIntent=getIntent();
  Uri startUri=startIntent.getData();
  if (savedInstanceState != null) {
    threadLoadable.readFromBundle(this,"String_Node_Str",savedInstanceState);
    startLoadingThread(threadLoadable);
    Loadable tmp=new Loadable();
    tmp.readFromBundle(this,"String_Node_Str",savedInstanceState);
    loadBoard(tmp.board);
  }
 else {
    if (startUri != null) {
      handleIntentURI(startUri);
    }
    if (boardLoadable.mode == Loadable.Mode.INVALID) {
      List<String> savedValues=ChanApplication.getBoardManager().getSavedValues();
      if (savedValues.size() > 0) {
        loadBoard(savedValues.get(0));
      }
    }
  }
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  actionBarSetToListNavigation=false;
  boardLoadable=new Loadable();
  threadLoadable=new Loadable();
  boardFragment=ThreadFragment.newInstance(this);
  threadFragment=ThreadFragment.newInstance(this);
  FragmentTransaction ft=getFragmentManager().beginTransaction();
  ft.replace(R.id.left_pane,boardFragment);
  ft.replace(R.id.right_pane,threadFragment);
  ft.commitAllowingStateLoss();
  final ActionBar actionBar=getActionBar();
  actionBar.setListNavigationCallbacks(new ArrayAdapter<String>(actionBar.getThemedContext(),R.layout.board_select_spinner,android.R.id.text1,ChanApplication.getBoardManager().getSavedKeys()),this);
  updatePaneState();
  updateActionBarState();
  Intent startIntent=getIntent();
  Uri startUri=startIntent.getData();
  if (savedInstanceState != null) {
    threadLoadable.readFromBundle(this,"String_Node_Str",savedInstanceState);
    startLoadingThread(threadLoadable);
    Loadable tmp=new Loadable();
    tmp.readFromBundle(this,"String_Node_Str",savedInstanceState);
    loadBoard(tmp.board);
  }
 else {
    if (startUri != null) {
      handleIntentURI(startUri);
    }
    if (boardLoadable.mode == Loadable.Mode.INVALID) {
      List<String> savedValues=ChanApplication.getBoardManager().getSavedValues();
      if (savedValues.size() > 0) {
        loadBoard(savedValues.get(0));
      }
    }
  }
}
Program: 20467
Project: 20467
Buggy source:
private void showPostInfo(Post post){
  String text="String_Node_Str";
  if (post.hasImage) {
    text+="String_Node_Str" + post.filename + "String_Node_Str"+ post.ext+ "String_Node_Str"+ post.imageWidth+ "String_Node_Str"+ post.imageHeight+ "String_Node_Str";
  }
  text+="String_Node_Str" + post.date;
  if (!TextUtils.isEmpty(post.id)) {
    text+="String_Node_Str" + post.id;
  }
  if (!TextUtils.isEmpty(post.email)) {
    text+="String_Node_Str" + post.email;
  }
  if (!TextUtils.isEmpty(post.tripcode)) {
    text+="String_Node_Str" + post.tripcode;
  }
  if (!TextUtils.isEmpty(post.countryName)) {
    text+="String_Node_Str" + post.countryName;
  }
  if (!TextUtils.isEmpty(post.capcode)) {
    text+="String_Node_Str" + post.capcode;
  }
  AlertDialog dialog=new AlertDialog.Builder(activity).setTitle(R.string.post_info).setMessage(text).setNeutralButton(android.R.string.ok,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
    }
  }
).create();
  dialog.show();
}

Fixed version (ground truth):
private void showPostInfo(Post post){
  String text="String_Node_Str";
  if (post.hasImage) {
    text+="String_Node_Str" + post.filename + "String_Node_Str"+ post.ext+ "String_Node_Str"+ post.imageWidth+ "String_Node_Str"+ post.imageHeight+ "String_Node_Str"+ Utils.getReadableFileSize(post.fileSize,false)+ "String_Node_Str";
  }
  text+="String_Node_Str" + post.date;
  if (!TextUtils.isEmpty(post.id)) {
    text+="String_Node_Str" + post.id;
  }
  if (!TextUtils.isEmpty(post.email)) {
    text+="String_Node_Str" + post.email;
  }
  if (!TextUtils.isEmpty(post.tripcode)) {
    text+="String_Node_Str" + post.tripcode;
  }
  if (!TextUtils.isEmpty(post.countryName)) {
    text+="String_Node_Str" + post.countryName;
  }
  if (!TextUtils.isEmpty(post.capcode)) {
    text+="String_Node_Str" + post.capcode;
  }
  AlertDialog dialog=new AlertDialog.Builder(activity).setTitle(R.string.post_info).setMessage(text).setNeutralButton(android.R.string.ok,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
    }
  }
).create();
  dialog.show();
}