nus-yam/ex-repair huggingface dataset:
Program: 34277
Project: 34277
Buggy source:
public void showPanel(){
  if (!isPanelHidden())   return;
  smoothSlideTo(0,0);
}

Fixed version (ground truth):
public void showPanel(){
  if (mSlideState != SlideState.HIDDEN)   return;
  mSlideableView.setVisibility(View.VISIBLE);
  requestLayout();
  smoothSlideTo(0,0);
}
Program: 34278
Project: 34278
Buggy source:
@Override public void onViewCaptured(View capturedChild,int activePointerId){
  setAllChildrenVisible();
}

Fixed version (ground truth):
@Override public void onViewCaptured(View capturedChild,int activePointerId){
}
Program: 34279
Project: 34279
Buggy source:
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  final int action=MotionEventCompat.getActionMasked(ev);
  if (!mIsSlidingEnabled || (mIsUnableToDrag && action != MotionEvent.ACTION_DOWN)) {
    mDragHelper.cancel();
    return super.onInterceptTouchEvent(ev);
  }
  if (action == MotionEvent.ACTION_CANCEL || action == MotionEvent.ACTION_UP) {
    mDragHelper.cancel();
    return false;
  }
  final float x=ev.getX();
  final float y=ev.getY();
  boolean interceptTap=false;
switch (action) {
case MotionEvent.ACTION_DOWN:
{
      mIsUnableToDrag=false;
      mInitialMotionX=x;
      mInitialMotionY=y;
      if (isDragViewUnder((int)x,(int)y) && !mIsUsingDragViewTouchEvents) {
        interceptTap=true;
      }
      break;
    }
case MotionEvent.ACTION_MOVE:
{
    final float adx=Math.abs(x - mInitialMotionX);
    final float ady=Math.abs(y - mInitialMotionY);
    final int dragSlop=mDragHelper.getTouchSlop();
    if (mIsUsingDragViewTouchEvents) {
      if (adx > mScrollTouchSlop && ady < mScrollTouchSlop) {
        return super.onInterceptTouchEvent(ev);
      }
 else       if (ady > mScrollTouchSlop) {
        interceptTap=isDragViewUnder((int)x,(int)y);
      }
    }
    if ((ady > dragSlop && adx > ady) || !isDragViewUnder((int)x,(int)y)) {
      mDragHelper.cancel();
      mIsUnableToDrag=true;
      return false;
    }
    break;
  }
}
final boolean interceptForDrag=mDragHelper.shouldInterceptTouchEvent(ev);
return interceptForDrag || interceptTap;
}

Fixed version (ground truth):
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  final int action=MotionEventCompat.getActionMasked(ev);
  if (!isEnabled() || !mIsSlidingEnabled || (mIsUnableToDrag && action != MotionEvent.ACTION_DOWN)) {
    mDragHelper.cancel();
    return super.onInterceptTouchEvent(ev);
  }
  if (action == MotionEvent.ACTION_CANCEL || action == MotionEvent.ACTION_UP) {
    mDragHelper.cancel();
    return false;
  }
  final float x=ev.getX();
  final float y=ev.getY();
  boolean interceptTap=false;
switch (action) {
case MotionEvent.ACTION_DOWN:
{
      mIsUnableToDrag=false;
      mInitialMotionX=x;
      mInitialMotionY=y;
      if (isDragViewUnder((int)x,(int)y) && !mIsUsingDragViewTouchEvents) {
        interceptTap=true;
      }
      break;
    }
case MotionEvent.ACTION_MOVE:
{
    final float adx=Math.abs(x - mInitialMotionX);
    final float ady=Math.abs(y - mInitialMotionY);
    final int dragSlop=mDragHelper.getTouchSlop();
    if (mIsUsingDragViewTouchEvents) {
      if (adx > mScrollTouchSlop && ady < mScrollTouchSlop) {
        return super.onInterceptTouchEvent(ev);
      }
 else       if (ady > mScrollTouchSlop) {
        interceptTap=isDragViewUnder((int)x,(int)y);
      }
    }
    if ((ady > dragSlop && adx > ady) || !isDragViewUnder((int)x,(int)y)) {
      mDragHelper.cancel();
      mIsUnableToDrag=true;
      return false;
    }
    break;
  }
}
final boolean interceptForDrag=mDragHelper.shouldInterceptTouchEvent(ev);
return interceptForDrag || interceptTap;
}
Program: 34281
Project: 34281
Buggy source:
public void hidePanel(){
  mIsPanelBeingHidden=true;
  int newTop=computePanelTopPosition(0.0f) + (mIsSlidingUp ? +mPanelHeight : -mPanelHeight);
  smoothSlideTo(computeSlideOffset(newTop),0);
}

Fixed version (ground truth):
public void hidePanel(){
  if (mSlideState == SlideState.DRAGGING || mSlideState == SlideState.HIDDEN)   return;
  int newTop=computePanelTopPosition(0.0f) + (mIsSlidingUp ? +mPanelHeight : -mPanelHeight);
  smoothSlideTo(computeSlideOffset(newTop),0);
}
Program: 34284
Project: 34284
Buggy source:
public void setActionBarTranslation(float y){
  int actionBarHeight=0;
  TypedValue tv=new TypedValue();
  if (getTheme().resolveAttribute(android.R.attr.actionBarSize,tv,true)) {
    actionBarHeight=TypedValue.complexToDimensionPixelSize(tv.data,getResources().getDisplayMetrics());
  }
  ViewGroup content=((ViewGroup)findViewById(android.R.id.content).getParent());
  int children=content.getChildCount();
  for (int i=0; i < children; i++) {
    View child=content.getChildAt(i);
    if (child.getId() != android.R.id.content) {
      if (y <= -actionBarHeight) {
        child.setVisibility(View.GONE);
      }
 else {
        child.setVisibility(View.VISIBLE);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
          child.setTranslationY(y);
        }
 else {
          AnimatorProxy.wrap(child).setTranslationY(y);
        }
      }
    }
  }
}

Fixed version (ground truth):
public void setActionBarTranslation(float y){
  int actionBarHeight=getActionBarHeight();
  ViewGroup content=((ViewGroup)findViewById(android.R.id.content).getParent());
  int children=content.getChildCount();
  for (int i=0; i < children; i++) {
    View child=content.getChildAt(i);
    if (child.getId() != android.R.id.content) {
      if (y <= -actionBarHeight) {
        child.setVisibility(View.GONE);
      }
 else {
        child.setVisibility(View.VISIBLE);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
          child.setTranslationY(y);
        }
 else {
          AnimatorProxy.wrap(child).setTranslationY(y);
        }
      }
    }
  }
}
Program: 34285
Project: 34285
Buggy source:
@Override protected void onSaveInstanceState(Bundle outState){
  super.onSaveInstanceState(outState);
  outState.putBoolean(SAVED_STATE_ACTION_BAR_HIDDEN,!getActionBar().isShowing());
}

Fixed version (ground truth):
@Override protected void onSaveInstanceState(Bundle outState){
  super.onSaveInstanceState(outState);
  outState.putBoolean(SAVED_STATE_ACTION_BAR_HIDDEN,mLayout.isExpanded());
}
Program: 34286
Project: 34286
Buggy source:
@Override public void onPanelSlide(View panel,float slideOffset){
  Log.i(TAG,"String_Node_Str" + slideOffset);
  setActionBarTranslation(layout.getCurrentParalaxOffset());
}

Fixed version (ground truth):
@Override public void onPanelSlide(View panel,float slideOffset){
  Log.i(TAG,"String_Node_Str" + slideOffset);
  setActionBarTranslation(mLayout.getCurrentParalaxOffset());
}
Program: 34287
Project: 34287
Buggy source:
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  final int action=MotionEventCompat.getActionMasked(ev);
  if (!mCanSlide || !mIsSlidingEnabled || (mIsUnableToDrag && action != MotionEvent.ACTION_DOWN)) {
    mDragHelper.cancel();
    return super.onInterceptTouchEvent(ev);
  }
  if (action == MotionEvent.ACTION_CANCEL || action == MotionEvent.ACTION_UP) {
    mDragHelper.cancel();
    return false;
  }
  final float x=ev.getX();
  final float y=ev.getY();
  boolean interceptTap=false;
switch (action) {
case MotionEvent.ACTION_DOWN:
{
      mIsUnableToDrag=false;
      mInitialMotionX=x;
      mInitialMotionY=y;
      if (isDragViewUnder((int)x,(int)y) && !mIsUsingDragViewTouchEvents) {
        interceptTap=true;
      }
      break;
    }
case MotionEvent.ACTION_MOVE:
{
    final float adx=Math.abs(x - mInitialMotionX);
    final float ady=Math.abs(y - mInitialMotionY);
    final int dragSlop=mDragHelper.getTouchSlop();
    if (mIsUsingDragViewTouchEvents) {
      if (adx > mScrollTouchSlop && ady < mScrollTouchSlop) {
        return super.onInterceptTouchEvent(ev);
      }
 else       if (ady > mScrollTouchSlop) {
        interceptTap=isDragViewUnder((int)x,(int)y);
      }
    }
    if (ady > dragSlop && adx > ady) {
      mDragHelper.cancel();
      mIsUnableToDrag=true;
      return false;
    }
    break;
  }
}
final boolean interceptForDrag=mDragHelper.shouldInterceptTouchEvent(ev);
return interceptForDrag || interceptTap;
}

Fixed version (ground truth):
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  final int action=MotionEventCompat.getActionMasked(ev);
  if (!mCanSlide || !mIsSlidingEnabled || (mIsUnableToDrag && action != MotionEvent.ACTION_DOWN)) {
    mDragHelper.cancel();
    return super.onInterceptTouchEvent(ev);
  }
  if (action == MotionEvent.ACTION_CANCEL || action == MotionEvent.ACTION_UP) {
    mDragHelper.cancel();
    return false;
  }
  final float x=ev.getX();
  final float y=ev.getY();
  boolean interceptTap=false;
switch (action) {
case MotionEvent.ACTION_DOWN:
{
      mIsUnableToDrag=false;
      mInitialMotionX=x;
      mInitialMotionY=y;
      if (isDragViewUnder((int)x,(int)y) && !mIsUsingDragViewTouchEvents) {
        interceptTap=true;
      }
      break;
    }
case MotionEvent.ACTION_MOVE:
{
    final float adx=Math.abs(x - mInitialMotionX);
    final float ady=Math.abs(y - mInitialMotionY);
    final int dragSlop=mDragHelper.getTouchSlop();
    if (mIsUsingDragViewTouchEvents) {
      if (adx > mScrollTouchSlop && ady < mScrollTouchSlop) {
        return super.onInterceptTouchEvent(ev);
      }
 else       if (ady > mScrollTouchSlop) {
        interceptTap=isDragViewUnder((int)x,(int)y);
      }
    }
    if ((ady > dragSlop && adx > ady) || !isDragViewUnder((int)x,(int)y)) {
      mDragHelper.cancel();
      mIsUnableToDrag=true;
      return false;
    }
    break;
  }
}
final boolean interceptForDrag=mDragHelper.shouldInterceptTouchEvent(ev);
return interceptForDrag || interceptTap;
}
Program: 34288
Project: 34288
Buggy source:
public void addConditions(List<Condition> conditions){
  conditions.addAll(conditions);
}

Fixed version (ground truth):
public void addConditions(List<Condition> conditions){
  this.conditions.addAll(conditions);
}
Program: 34290
Project: 34290
Buggy source:
@Override public ActionableResult rollback() throws Exception {
  Optional<Object> optionalOriginal=data.get(DataQueries.OriginalBlock);
  if (!optionalOriginal.isPresent()) {
    return ActionableResult.skipped(SkipReason.INVALID);
  }
  DataView finalBlock=((DataView)optionalOriginal.get()).copy();
  Optional<Object> optionalLocation=data.get(DataQueries.Location);
  if (!optionalLocation.isPresent()) {
    return ActionableResult.skipped(SkipReason.INVALID_LOCATION);
  }
  finalBlock=formatBlockData(finalBlock,optionalLocation);
  Optional<BlockSnapshot> optionalSnapshot=Prism.getGame().getRegistry().createBuilder(Builder.class).build(finalBlock);
  if (!optionalSnapshot.isPresent()) {
    return ActionableResult.skipped(SkipReason.INVALID);
  }
  BlockSnapshot snapshot=optionalSnapshot.get();
  if (BlockUtil.rejectIllegalApplierBlock(snapshot.getState().getType())) {
    return ActionableResult.skipped(SkipReason.ILLEGAL_BLOCK);
  }
  BlockSnapshot original=snapshot.getLocation().get().getBlock().snapshotFor(snapshot.getLocation().get());
  if (!optionalSnapshot.get().restore(true,BlockChangeFlag.NONE)) {
    return ActionableResult.skipped(SkipReason.UNKNOWN);
  }
  BlockSnapshot resultingBlock=snapshot.getLocation().get().getBlock().snapshotFor(snapshot.getLocation().get());
  return ActionableResult.success(new Transaction<>(original,resultingBlock));
}

Fixed version (ground truth):
@Override public ActionableResult rollback() throws Exception {
  Optional<Object> optionalOriginal=data.get(DataQueries.OriginalBlock);
  if (!optionalOriginal.isPresent()) {
    return ActionableResult.skipped(SkipReason.INVALID);
  }
  DataView finalBlock=((DataView)optionalOriginal.get()).copy();
  Optional<Object> optionalLocation=data.get(DataQueries.Location);
  if (!optionalLocation.isPresent()) {
    return ActionableResult.skipped(SkipReason.INVALID_LOCATION);
  }
  finalBlock=formatBlockData(finalBlock,optionalLocation);
  Optional<BlockSnapshot> optionalSnapshot=Prism.getGame().getRegistry().createBuilder(Builder.class).build(finalBlock);
  if (!optionalSnapshot.isPresent()) {
    return ActionableResult.skipped(SkipReason.INVALID);
  }
  BlockSnapshot snapshot=optionalSnapshot.get();
  if (!snapshot.getLocation().isPresent()) {
    return ActionableResult.skipped(SkipReason.INVALID_LOCATION);
  }
  Location<World> location=snapshot.getLocation().get();
  if (BlockUtil.rejectIllegalApplierBlock(snapshot.getState().getType())) {
    return ActionableResult.skipped(SkipReason.ILLEGAL_BLOCK);
  }
  BlockSnapshot original=location.getBlock().snapshotFor(location);
  if (!optionalSnapshot.get().restore(true,BlockChangeFlag.NONE)) {
    return ActionableResult.skipped(SkipReason.UNKNOWN);
  }
  BlockSnapshot resultingBlock=location.getBlock().snapshotFor(location);
  return ActionableResult.success(new Transaction<>(original,resultingBlock));
}
Program: 34291
Project: 34291
Buggy source:
@Override public ActionableResult restore() throws Exception {
  Optional<Object> optionalFinal=data.get(DataQueries.ReplacementBlock);
  if (!optionalFinal.isPresent()) {
    return ActionableResult.skipped(SkipReason.INVALID);
  }
  DataView finalBlock=((DataView)optionalFinal.get()).copy();
  Optional<Object> optionalLocation=data.get(DataQueries.Location);
  if (!optionalLocation.isPresent()) {
    return ActionableResult.skipped(SkipReason.INVALID_LOCATION);
  }
  finalBlock=formatBlockData(finalBlock,optionalLocation);
  Optional<BlockSnapshot> optionalSnapshot=Prism.getGame().getRegistry().createBuilder(Builder.class).build(finalBlock);
  if (!optionalSnapshot.isPresent()) {
    return ActionableResult.skipped(SkipReason.INVALID);
  }
  BlockSnapshot snapshot=optionalSnapshot.get();
  if (BlockUtil.rejectIllegalApplierBlock(snapshot.getState().getType())) {
    return ActionableResult.skipped(SkipReason.ILLEGAL_BLOCK);
  }
  BlockSnapshot original=snapshot.getLocation().get().getBlock().snapshotFor(snapshot.getLocation().get());
  if (!optionalSnapshot.get().restore(true,BlockChangeFlag.NONE)) {
    return ActionableResult.skipped(SkipReason.UNKNOWN);
  }
  BlockSnapshot resultingBlock=snapshot.getLocation().get().getBlock().snapshotFor(snapshot.getLocation().get());
  return ActionableResult.success(new Transaction<>(original,resultingBlock));
}

Fixed version (ground truth):
@Override public ActionableResult restore() throws Exception {
  Optional<Object> optionalFinal=data.get(DataQueries.ReplacementBlock);
  if (!optionalFinal.isPresent()) {
    return ActionableResult.skipped(SkipReason.INVALID);
  }
  DataView finalBlock=((DataView)optionalFinal.get()).copy();
  Optional<Object> optionalLocation=data.get(DataQueries.Location);
  if (!optionalLocation.isPresent()) {
    return ActionableResult.skipped(SkipReason.INVALID_LOCATION);
  }
  finalBlock=formatBlockData(finalBlock,optionalLocation);
  Optional<BlockSnapshot> optionalSnapshot=Prism.getGame().getRegistry().createBuilder(Builder.class).build(finalBlock);
  if (!optionalSnapshot.isPresent()) {
    return ActionableResult.skipped(SkipReason.INVALID);
  }
  BlockSnapshot snapshot=optionalSnapshot.get();
  if (!snapshot.getLocation().isPresent()) {
    return ActionableResult.skipped(SkipReason.INVALID_LOCATION);
  }
  Location<World> location=snapshot.getLocation().get();
  if (BlockUtil.rejectIllegalApplierBlock(snapshot.getState().getType())) {
    return ActionableResult.skipped(SkipReason.ILLEGAL_BLOCK);
  }
  BlockSnapshot original=location.getBlock().snapshotFor(location);
  if (!optionalSnapshot.get().restore(true,BlockChangeFlag.NONE)) {
    return ActionableResult.skipped(SkipReason.UNKNOWN);
  }
  BlockSnapshot resultingBlock=location.getBlock().snapshotFor(location);
  return ActionableResult.success(new Transaction<>(original,resultingBlock));
}
Program: 34293
Project: 34293
Buggy source:
/** 
 * Get a list of all LIQUID block types.
 * @return List<BlockType>
 */
public static List<BlockType> getLiquidBlockTypes(){
  List<BlockType> liquids=new ArrayList<>();
  Collection<BlockType> types=Prism.getGame().getRegistry().getAllOf(BlockType.class);
  for (  BlockType type : types) {
    Optional<MatterProperty> property=type.getProperty(MatterProperty.class);
    if (property.isPresent() && property.get().equals(Matter.LIQUID)) {
      liquids.add(type);
    }
  }
  liquids.add(BlockTypes.LAVA);
  liquids.add(BlockTypes.FLOWING_LAVA);
  liquids.add(BlockTypes.WATER);
  liquids.add(BlockTypes.FLOWING_WATER);
  return liquids;
}

Fixed version (ground truth):
/** 
 * Get a list of all LIQUID block types.
 * @return List<BlockType>
 */
public static List<BlockType> getLiquidBlockTypes(){
  List<BlockType> liquids=new ArrayList<>();
  Collection<BlockType> types=Prism.getGame().getRegistry().getAllOf(BlockType.class);
  for (  BlockType type : types) {
    Optional<MatterProperty> property=type.getProperty(MatterProperty.class);
    if (property.isPresent() && Objects.equals(property.get().getValue(),Matter.LIQUID)) {
      liquids.add(type);
    }
  }
  liquids.add(BlockTypes.LAVA);
  liquids.add(BlockTypes.FLOWING_LAVA);
  liquids.add(BlockTypes.WATER);
  liquids.add(BlockTypes.FLOWING_WATER);
  return liquids;
}
Program: 34295
Project: 34295
Buggy source:
/** 
 * Constructs an SQL query from a given QuerySession.
 * @param session QuerySession
 * @return SQLQuery
 */
public static SQLQuery from(QuerySession session){
  Builder query=SQLQuery.builder().select().from(tablePrefix + "String_Node_Str");
  if (!session.hasFlag(Flag.NO_GROUP)) {
    query.col("String_Node_Str").group("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  }
 else {
    query.col("String_Node_Str").leftJoin(tablePrefix + "String_Node_Str",tablePrefix + "String_Node_Str" + tablePrefix+ "String_Node_Str");
  }
  query.conditions(session.getQuery().getConditions());
  query.order("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  return query.build();
}

Fixed version (ground truth):
/** 
 * Constructs an SQL query from a given QuerySession.
 * @param session QuerySession
 * @return SQLQuery
 */
public static SQLQuery from(QuerySession session){
  Builder query=SQLQuery.builder().select().from(tablePrefix + "String_Node_Str");
  if (!session.hasFlag(Flag.NO_GROUP)) {
    query.col("String_Node_Str").group("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  }
 else {
    query.col("String_Node_Str").leftJoin(tablePrefix + "String_Node_Str",tablePrefix + "String_Node_Str" + tablePrefix+ "String_Node_Str");
  }
  query.conditions(session.getQuery().getConditions());
  query.order("String_Node_Str");
  if (session.hasFlag(Flag.NO_GROUP)) {
    query.order("String_Node_Str","String_Node_Str","String_Node_Str");
  }
  return query.build();
}
Program: 34297
Project: 34297
Buggy source:
@Override public void run(){
  Picasso.with(getActivity()).load(backdropUrl).into(coverImage,new com.squareup.picasso.Callback(){
    @Override public void onSuccess(){
      Animation fadeInAnim=AnimationUtils.loadAnimation(getActivity(),R.anim.fade_in);
      mainInfoBlockColorFade.start();
      td.startTransition(500);
      coverImage.setVisibility(View.VISIBLE);
      coverImage.startAnimation(fadeInAnim);
    }
    @Override public void onError(){
    }
  }
);
}

Fixed version (ground truth):
@Override public void run(){
  Picasso.with(getActivity()).load(backdropUrl).into(coverImage,new com.squareup.picasso.Callback(){
    @Override public void onSuccess(){
      if (getActivity() == null)       return;
      Animation fadeInAnim=AnimationUtils.loadAnimation(getActivity(),android.R.anim.fade_in);
      mainInfoBlockColorFade.start();
      td.startTransition(500);
      coverImage.setVisibility(View.VISIBLE);
      coverImage.startAnimation(fadeInAnim);
    }
    @Override public void onError(){
    }
  }
);
}
Program: 34298
Project: 34298
Buggy source:
@Override public void onSuccess(){
  Animation fadeInAnim=AnimationUtils.loadAnimation(getActivity(),R.anim.fade_in);
  mainInfoBlockColorFade.start();
  td.startTransition(500);
  coverImage.setVisibility(View.VISIBLE);
  coverImage.startAnimation(fadeInAnim);
}

Fixed version (ground truth):
@Override public void onSuccess(){
  if (getActivity() == null)   return;
  Animation fadeInAnim=AnimationUtils.loadAnimation(getActivity(),android.R.anim.fade_in);
  mainInfoBlockColorFade.start();
  td.startTransition(500);
  coverImage.setVisibility(View.VISIBLE);
  coverImage.startAnimation(fadeInAnim);
}
Program: 34299
Project: 34299
Buggy source:
public void setFragment(Fragment fragment){
  try {
    mHandler.post(new Runnable(){
      @Override public void run(){
        progressBar.setVisibility(View.GONE);
      }
    }
);
    DialogFragment dialogFragment=(DialogFragment)getSupportFragmentManager().findFragmentByTag("String_Node_Str");
    if (dialogFragment != null)     dialogFragment.dismiss();
    fragment.setArguments(mExtras);
    FragmentTransaction fragmentTransaction=getSupportFragmentManager().beginTransaction();
    if (mCurrentFragment.equals("String_Node_Str")) {
      mHandler.post(new Runnable(){
        @Override public void run(){
          toolbar.setNavigationIcon(R.drawable.abc_ic_ab_back_mtrl_am_alpha);
        }
      }
);
      fragmentTransaction.setCustomAnimations(R.anim.still,R.anim.slide_down);
    }
 else     if (mTopView.equals("String_Node_Str")) {
      mHandler.post(new Runnable(){
        @Override public void run(){
          toolbar.setNavigationIcon(R.drawable.abc_ic_clear_mtrl_alpha);
        }
      }
);
      fragmentTransaction.setCustomAnimations(R.anim.slide_up,R.anim.still);
    }
 else {
      fragmentTransaction.setCustomAnimations(R.anim.fade_in,R.anim.fade_out);
    }
    fragmentTransaction.replace(R.id.frameLayout,fragment);
    fragmentTransaction.commit();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void setFragment(Fragment fragment){
  try {
    mHandler.post(new Runnable(){
      @Override public void run(){
        progressBar.setVisibility(View.GONE);
      }
    }
);
    DialogFragment dialogFragment=(DialogFragment)getSupportFragmentManager().findFragmentByTag("String_Node_Str");
    if (dialogFragment != null)     dialogFragment.dismiss();
    fragment.setArguments(mExtras);
    FragmentTransaction fragmentTransaction=getSupportFragmentManager().beginTransaction();
    if (mCurrentFragment.equals("String_Node_Str")) {
      mHandler.post(new Runnable(){
        @Override public void run(){
          toolbar.setNavigationIcon(R.drawable.abc_ic_ab_back_mtrl_am_alpha);
        }
      }
);
      fragmentTransaction.setCustomAnimations(R.anim.still,R.anim.slide_down);
    }
 else     if (mTopView.equals("String_Node_Str")) {
      mHandler.post(new Runnable(){
        @Override public void run(){
          toolbar.setNavigationIcon(R.drawable.abc_ic_clear_mtrl_alpha);
        }
      }
);
      fragmentTransaction.setCustomAnimations(R.anim.slide_up,R.anim.still);
    }
 else {
      fragmentTransaction.setCustomAnimations(R.anim.fade_open,R.anim.fade_close);
    }
    fragmentTransaction.replace(R.id.frameLayout,fragment);
    fragmentTransaction.commit();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 34301
Project: 34301
Buggy source:
private void updateViews(){
  if (Version.compare(getClient().getVersion(),"String_Node_Str")) {
    if (mPlaying) {
      playPauseButton.setImageResource(R.drawable.ic_av_pause);
    }
 else {
      playPauseButton.setImageResource(R.drawable.ic_av_play);
    }
    if (mFullscreen) {
      fullscreenBlockImage.setImageResource(R.drawable.ic_av_small_screen);
    }
 else {
      fullscreenBlockImage.setImageResource(R.drawable.ic_av_full_screen);
    }
  }
}

Fixed version (ground truth):
private void updateViews(){
  if (Version.compare(getClient().getVersion(),"String_Node_Str")) {
    if (playPauseButton != null) {
      if (mPlaying) {
        playPauseButton.setImageResource(R.drawable.ic_av_pause);
      }
 else {
        playPauseButton.setImageResource(R.drawable.ic_av_play);
      }
    }
    if (fullscreenBlockImage != null) {
      if (mFullscreen) {
        fullscreenBlockImage.setImageResource(R.drawable.ic_av_small_screen);
      }
 else {
        fullscreenBlockImage.setImageResource(R.drawable.ic_av_full_screen);
      }
    }
  }
}
Program: 34302
Project: 34302
Buggy source:
private void showNoConnection(){
  setFragment(new ConnectionLostFragment(),true);
  mCurrentFragment="String_Node_Str";
  runOnUiThread(new Runnable(){
    @Override public void run(){
      ActionBarBackground.fadeDrawable(ControllerActivity.this,new ColorDrawable(getResources().getColor(R.color.primary)));
    }
  }
);
}

Fixed version (ground truth):
private void showNoConnection(){
  setFragment(new ConnectionLostFragment(),true);
  mCurrentFragment="String_Node_Str";
  mHandler.post(new Runnable(){
    @Override public void run(){
      ActionBarBackground.fadeDrawable(ControllerActivity.this,new ColorDrawable(getResources().getColor(R.color.primary)));
    }
  }
);
}
Program: 34303
Project: 34303
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_framelayout);
  ButterKnife.inject(this);
  Intent intent=getIntent();
  mExtras=intent.getExtras();
  if (mExtras != null && mExtras.containsKey(KEY_IP) && mExtras.containsKey(KEY_PORT) && mExtras.containsKey(KEY_USERNAME) && mExtras.containsKey(KEY_PASSWORD) && mExtras.containsKey(KEY_NAME)) {
    mRpc=new PopcornTimeRpcClient(mExtras.getString(KEY_IP),mExtras.getString(KEY_PORT),mExtras.getString(KEY_USERNAME),mExtras.getString(KEY_PASSWORD));
    getSupportActionBar().setTitle(getString(R.string.connected_to) + "String_Node_Str" + mExtras.getString(KEY_NAME));
  }
 else {
    finish();
  }
  getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  getSupportActionBar().setLogo(R.drawable.ic_logo);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_framelayout);
  ButterKnife.inject(this);
  Intent intent=getIntent();
  mExtras=intent.getExtras();
  if (mExtras != null && mExtras.containsKey(KEY_IP) && mExtras.containsKey(KEY_PORT) && mExtras.containsKey(KEY_USERNAME) && mExtras.containsKey(KEY_PASSWORD) && mExtras.containsKey(KEY_NAME)) {
    mRpc=new PopcornTimeRpcClient(mExtras.getString(KEY_IP),mExtras.getString(KEY_PORT),mExtras.getString(KEY_USERNAME),mExtras.getString(KEY_PASSWORD));
    getSupportActionBar().setTitle(getString(R.string.connected_to) + "String_Node_Str" + mExtras.getString(KEY_NAME));
  }
 else {
    finish();
  }
  mHandler=new Handler(getMainLooper());
  getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  getSupportActionBar().setLogo(R.drawable.ic_logo);
}
Program: 34304
Project: 34304
Buggy source:
public void setFragment(Fragment fragment,boolean fade){
  try {
    runOnUiThread(new Runnable(){
      @Override public void run(){
        progressBar.setVisibility(View.GONE);
      }
    }
);
    SubtitleSelectorDialogFragment subsFragment=(SubtitleSelectorDialogFragment)getSupportFragmentManager().findFragmentByTag("String_Node_Str");
    if (subsFragment != null)     subsFragment.dismiss();
    PlayerSelectorDialogFragment playerFragment=(PlayerSelectorDialogFragment)getSupportFragmentManager().findFragmentByTag("String_Node_Str");
    if (playerFragment != null)     playerFragment.dismiss();
    fragment.setArguments(mExtras);
    FragmentTransaction fragmentTransaction=getSupportFragmentManager().beginTransaction();
    if (fade)     fragmentTransaction.setCustomAnimations(R.anim.fade_in,R.anim.fade_out);
    fragmentTransaction.replace(R.id.frameLayout,fragment);
    fragmentTransaction.commit();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void setFragment(Fragment fragment,boolean fade){
  try {
    mHandler.post(new Runnable(){
      @Override public void run(){
        progressBar.setVisibility(View.GONE);
      }
    }
);
    SubtitleSelectorDialogFragment subsFragment=(SubtitleSelectorDialogFragment)getSupportFragmentManager().findFragmentByTag("String_Node_Str");
    if (subsFragment != null)     subsFragment.dismiss();
    PlayerSelectorDialogFragment playerFragment=(PlayerSelectorDialogFragment)getSupportFragmentManager().findFragmentByTag("String_Node_Str");
    if (playerFragment != null)     playerFragment.dismiss();
    fragment.setArguments(mExtras);
    FragmentTransaction fragmentTransaction=getSupportFragmentManager().beginTransaction();
    if (fade)     fragmentTransaction.setCustomAnimations(R.anim.fade_in,R.anim.fade_out);
    fragmentTransaction.replace(R.id.frameLayout,fragment);
    fragmentTransaction.commit();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 34306
Project: 34306
Buggy source:
@Override public void onAttach(Activity activity){
  super.onAttach(activity);
  try {
    mFadingHelper=new FadingActionBarHelper().actionBarBackground(ActionBarBackground.getColoredBackground(getResources().getColor(R.color.primary))).headerLayout(R.layout.fragment_detailheader).contentLayout(R.layout.fragment_moviecontroller);
    mFadingHelper.initActionBar(activity);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  getClient().getSelection(mSelectionCallback);
}

Fixed version (ground truth):
@Override public void onAttach(Activity activity){
  super.onAttach(activity);
  try {
    mFadingHelper=new FadingActionBarHelper().actionBarBackground(ActionBarBackground.getColoredBackground(getResources().getColor(R.color.primary))).headerLayout(R.layout.fragment_detailheader).contentLayout(R.layout.fragment_moviecontroller);
    mFadingHelper.initActionBar(activity);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 34307
Project: 34307
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,@Nullable ViewGroup container,@Nullable Bundle savedInstanceState){
  View v=mFadingHelper.createView(inflater);
  ButterKnife.inject(this,v);
  Drawable playButtonDrawable=PixelUtils.changeDrawableColor(getActivity(),R.drawable.ic_av_play_button,getResources().getColor(R.color.primary));
  if (mPlayButtonDrawable == null)   playButton.setImageDrawable(playButtonDrawable);
  playButton.setOnClickListener(mOnClickListener);
  trailerBlock.setOnClickListener(mOnClickListener);
  subtitlesBlock.setOnClickListener(mOnClickListener);
  favouriteBlock.setOnClickListener(mOnClickListener);
  qualityBlock.setOnClickListener(mOnClickListener);
  playerBlock.setOnClickListener(mOnClickListener);
  if (!Version.compare(getClient().getVersion(),"String_Node_Str")) {
    playerBlock.setVisibility(View.GONE);
    trailerBlock.setVisibility(View.GONE);
    synopsisBlock.setVisibility(View.GONE);
  }
  return v;
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,@Nullable ViewGroup container,@Nullable Bundle savedInstanceState){
  View v=mFadingHelper.createView(inflater);
  ButterKnife.inject(this,v);
  Drawable playButtonDrawable=PixelUtils.changeDrawableColor(getActivity(),R.drawable.ic_av_play_button,getResources().getColor(R.color.primary));
  if (mPlayButtonDrawable == null)   playButton.setImageDrawable(playButtonDrawable);
  playButton.setOnClickListener(mOnClickListener);
  trailerBlock.setOnClickListener(mOnClickListener);
  subtitlesBlock.setOnClickListener(mOnClickListener);
  favouriteBlock.setOnClickListener(mOnClickListener);
  qualityBlock.setOnClickListener(mOnClickListener);
  playerBlock.setOnClickListener(mOnClickListener);
  if (!Version.compare(getClient().getVersion(),"String_Node_Str")) {
    playerBlock.setVisibility(View.GONE);
    trailerBlock.setVisibility(View.GONE);
    synopsisBlock.setVisibility(View.GONE);
  }
  getClient().getSelection(mSelectionCallback);
  return v;
}
Program: 34308
Project: 34308
Buggy source:
@Override public void onSuccess(){
  mainInfoBlockColorFade.start();
  td.startTransition(500);
  mFadingHelper.actionBarBackground(ActionBarBackground.getColoredBackground(color)).initActionBar(getActivity());
}

Fixed version (ground truth):
@Override public void onSuccess(){
  Animation fadeInAnim=AnimationUtils.loadAnimation(getActivity(),R.anim.fade_in);
  mainInfoBlockColorFade.start();
  td.startTransition(500);
  coverImage.setVisibility(View.VISIBLE);
  coverImage.startAnimation(fadeInAnim);
  mFadingHelper.actionBarBackground(ActionBarBackground.getColoredBackground(color)).initActionBar(getActivity());
}
Program: 34309
Project: 34309
Buggy source:
@Override public void onCompleted(Exception e,PopcornTimeRpcClient.RpcResponse result){
  try {
    if (result != null && e == null) {
      mFullscreen=(Boolean)result.getMapResult().get("String_Node_Str");
      updateViews();
    }
  }
 catch (  Exception exception) {
    exception.printStackTrace();
  }
  mHandler.postDelayed(mFullscreenRunnable,1000);
}

Fixed version (ground truth):
@Override public void onCompleted(Exception e,PopcornTimeRpcClient.RpcResponse result){
  try {
    if (result != null && e == null) {
      mFullscreen=(Boolean)result.getMapResult().get("String_Node_Str");
      mHandler.post(new Runnable(){
        @Override public void run(){
          updateViews();
        }
      }
);
    }
  }
 catch (  Exception exception) {
    exception.printStackTrace();
  }
  mHandler.postDelayed(mFullscreenRunnable,1000);
}
Program: 34310
Project: 34310
Buggy source:
/** 
 * Send JSON RPC request to the instance
 * @param rpc Request data
 * @param callback Callback for the request
 * @return ResponseFuture
 */
private Call request(final RpcRequest rpc,final Callback callback){
  RequestBody requestBody=RequestBody.create(MEDIA_TYPE_JSON,mGson.toJson(rpc));
  Request request=new Request.Builder().url(mUrl).header("String_Node_Str",Credentials.basic(mUsername,mPassword)).post(requestBody).build();
  Call call=mClient.newCall(request);
  call.enqueue(new com.squareup.okhttp.Callback(){
    @Override public void onFailure(    Request request,    IOException e){
      callback.onCompleted(e,null);
    }
    @Override public void onResponse(    Response response) throws IOException {
      RpcResponse result=null;
      Exception e=null;
      try {
        if (response != null && response.isSuccessful()) {
          String responseStr=response.body().string();
          LogUtils.d("String_Node_Str","String_Node_Str" + responseStr);
          result=mGson.fromJson(responseStr,RpcResponse.class);
          LinkedTreeMap<String,Object> map=result.getMapResult();
          if (map.containsKey("String_Node_Str")) {
            mVersion=(String)map.get("String_Node_Str");
          }
        }
      }
 catch (      Exception ex) {
        ex.printStackTrace();
        e=ex;
        mVersion="String_Node_Str";
        if (rpc.id == RequestId.GET_SELECTION.ordinal()) {
          mVersion="String_Node_Str";
        }
      }
      callback.onCompleted(e,result);
    }
  }
);
  return call;
}

Fixed version (ground truth):
/** 
 * Send JSON RPC request to the instance
 * @param rpc Request data
 * @param callback Callback for the request
 * @return ResponseFuture
 */
private Call request(final RpcRequest rpc,final Callback callback){
  RequestBody requestBody=RequestBody.create(MEDIA_TYPE_JSON,mGson.toJson(rpc));
  Request request=new Request.Builder().url(mUrl).header("String_Node_Str",Credentials.basic(mUsername,mPassword)).post(requestBody).build();
  Call call=mClient.newCall(request);
  call.enqueue(new com.squareup.okhttp.Callback(){
    @Override public void onFailure(    Request request,    IOException e){
      callback.onCompleted(e,null);
    }
    @Override public void onResponse(    Response response) throws IOException {
      RpcResponse result=null;
      Exception e=null;
      try {
        if (response != null && response.isSuccessful()) {
          String responseStr=response.body().string();
          result=mGson.fromJson(responseStr,RpcResponse.class);
          LinkedTreeMap<String,Object> map=result.getMapResult();
          if (map.containsKey("String_Node_Str")) {
            mVersion=(String)map.get("String_Node_Str");
          }
        }
      }
 catch (      Exception ex) {
        ex.printStackTrace();
        e=ex;
        mVersion="String_Node_Str";
        if (rpc.id == RequestId.GET_SELECTION.ordinal()) {
          mVersion="String_Node_Str";
        }
      }
      callback.onCompleted(e,result);
    }
  }
);
  return call;
}
Program: 34311
Project: 34311
Buggy source:
@Override public void onResponse(Response response) throws IOException {
  RpcResponse result=null;
  Exception e=null;
  try {
    if (response != null && response.isSuccessful()) {
      String responseStr=response.body().string();
      LogUtils.d("String_Node_Str","String_Node_Str" + responseStr);
      result=mGson.fromJson(responseStr,RpcResponse.class);
      LinkedTreeMap<String,Object> map=result.getMapResult();
      if (map.containsKey("String_Node_Str")) {
        mVersion=(String)map.get("String_Node_Str");
      }
    }
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    e=ex;
    mVersion="String_Node_Str";
    if (rpc.id == RequestId.GET_SELECTION.ordinal()) {
      mVersion="String_Node_Str";
    }
  }
  callback.onCompleted(e,result);
}

Fixed version (ground truth):
@Override public void onResponse(Response response) throws IOException {
  RpcResponse result=null;
  Exception e=null;
  try {
    if (response != null && response.isSuccessful()) {
      String responseStr=response.body().string();
      result=mGson.fromJson(responseStr,RpcResponse.class);
      LinkedTreeMap<String,Object> map=result.getMapResult();
      if (map.containsKey("String_Node_Str")) {
        mVersion=(String)map.get("String_Node_Str");
      }
    }
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    e=ex;
    mVersion="String_Node_Str";
    if (rpc.id == RequestId.GET_SELECTION.ordinal()) {
      mVersion="String_Node_Str";
    }
  }
  callback.onCompleted(e,result);
}
Program: 34312
Project: 34312
Buggy source:
public void runViewstackRunnable(){
  getSupportFragmentManager().popBackStack();
  mRpc.ping(new FutureCallback<PopcornTimeRpcClient.RpcResponse>(){
    @Override public void onCompleted(    Exception e,    PopcornTimeRpcClient.RpcResponse result){
      if (e == null) {
        mGetViewstackRunnable.run();
      }
 else {
        e.printStackTrace();
        setFragment(new ConnectionLostFragment(),true);
        mCurrentFragment="String_Node_Str";
      }
    }
  }
);
}

Fixed version (ground truth):
public void runViewstackRunnable(){
  try {
    getSupportFragmentManager().popBackStack();
    mRpc.ping(new FutureCallback<PopcornTimeRpcClient.RpcResponse>(){
      @Override public void onCompleted(      Exception e,      PopcornTimeRpcClient.RpcResponse result){
        if (e == null) {
          mGetViewstackRunnable.run();
        }
 else {
          e.printStackTrace();
          setFragment(new ConnectionLostFragment(),true);
          mCurrentFragment="String_Node_Str";
        }
      }
    }
);
  }
 catch (  Exception e) {
  }
}
Program: 34314
Project: 34314
Buggy source:
private static BufferedReader skipBOM(InputStreamReader xmlBuffer) throws SdmxException {
  BufferedReader br=new BufferedReader(xmlBuffer);
  logger.fine(xmlBuffer.getEncoding());
  try {
    char[] cbuf=new char[1];
    br.mark(1);
    br.read(cbuf,0,1);
    logger.fine(String.format("String_Node_Str",Integer.toHexString(cbuf[0])));
    if ((byte)cbuf[0] == (byte)0xfeff) {
      logger.fine("String_Node_Str");
    }
 else {
      br.reset();
    }
  }
 catch (  IOException e) {
    throw new SdmxException("String_Node_Str");
  }
  return br;
}

Fixed version (ground truth):
public static BufferedReader skipBOM(InputStreamReader xmlBuffer) throws SdmxException {
  BufferedReader br=new BufferedReader(xmlBuffer);
  logger.fine(xmlBuffer.getEncoding());
  try {
    char[] cbuf=new char[1];
    br.mark(1);
    br.read(cbuf,0,1);
    logger.fine(String.format("String_Node_Str",Integer.toHexString(cbuf[0])));
    if ((byte)cbuf[0] == (byte)0xfeff) {
      logger.fine("String_Node_Str");
    }
 else {
      br.reset();
    }
  }
 catch (  IOException e) {
    throw new SdmxException("String_Node_Str");
  }
  return br;
}
Program: 34316
Project: 34316
Buggy source:
public void reverse(){
  Collections.reverse(this.observations);
  Collections.reverse(this.timeSlots);
}

Fixed version (ground truth):
public void reverse(){
  Collections.reverse(this.observations);
  Collections.reverse(this.timeSlots);
  for (Iterator<String> iterator=obsLevelAttributes.keySet().iterator(); iterator.hasNext(); ) {
    String key=(String)iterator.next();
    ArrayList<String> attrs=obsLevelAttributes.get(key);
    Collections.reverse(attrs);
    obsLevelAttributes.put(key,attrs);
  }
}
Program: 34320
Project: 34320
Buggy source:
/** 
 * 反注册组件
 * @param classname 组件名
 */
public static void unregisterComponent(@Nullable String classname){
  if (TextUtils.isEmpty(classname)) {
    return;
  }
  if (components.keySet().contains(classname)) {
    components.get(classname).onStop();
    components.remove(classname);
    return;
  }
}

Fixed version (ground truth):
/** 
 * 反注册组件
 * @param classname 组件名
 */
public static void unregisterComponent(@Nullable String classname){
  if (TextUtils.isEmpty(classname)) {
    return;
  }
  if (components.keySet().contains(classname)) {
    components.get(classname).onStop();
    components.remove(classname);
    return;
  }
  try {
    Class clazz=Class.forName(classname);
    IApplicationLike applicationLike=(IApplicationLike)clazz.newInstance();
    applicationLike.onStop();
    components.remove(classname);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 34321
Project: 34321
Buggy source:
public static void registerComponent(String classname){
  try {
    Class clazz=Class.forName(classname);
    IApplicationLike applicationLike=(IApplicationLike)clazz.newInstance();
    applicationLike.onCreate();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * 注册组件
 * @param classname 组件名
 */
public static void registerComponent(@Nullable String classname){
  if (TextUtils.isEmpty(classname)) {
    return;
  }
  if (components.keySet().contains(classname)) {
    return;
  }
  try {
    Class clazz=Class.forName(classname);
    IApplicationLike applicationLike=(IApplicationLike)clazz.newInstance();
    applicationLike.onCreate();
    components.put(classname,applicationLike);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 34322
Project: 34322
Buggy source:
public static void unregisterComponent(String classname){
  try {
    Class clazz=Class.forName(classname);
    IApplicationLike applicationLike=(IApplicationLike)clazz.newInstance();
    applicationLike.onStop();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * 反注册组件
 * @param classname 组件名
 */
public static void unregisterComponent(@Nullable String classname){
  if (TextUtils.isEmpty(classname)) {
    return;
  }
  if (components.keySet().contains(classname)) {
    components.get(classname).onStop();
    components.remove(classname);
    return;
  }
}
Program: 34323
Project: 34323
Buggy source:
@Override public boolean verifyUri(Uri uri){
  String scheme=uri.getScheme();
  String host=uri.getHost();
  if (SCHME.equals(scheme) && SHAREHOST.contains(host)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean verifyUri(Uri uri){
  String scheme=uri.getScheme();
  String host=uri.getHost();
  if (SCHME.equals(scheme)) {
    for (    String str : HOSTS) {
      if (str.equals(host)) {
        return true;
      }
    }
  }
  return false;
}
Program: 34324
Project: 34324
Buggy source:
private boolean thriftIsSetCall(Symbol.MethodSymbol symbol,Types types){
  Preconditions.checkNotNull(tbaseType);
  return tbaseType.isPresent() && symbol.getSimpleName().toString().startsWith("String_Node_Str") && types.isSubtype(symbol.owner.type,tbaseType.get());
}

Fixed version (ground truth):
private boolean thriftIsSetCall(Symbol.MethodSymbol symbol,Types types){
  Preconditions.checkNotNull(tbaseType);
  return tbaseType.isPresent() && symbol.getSimpleName().toString().startsWith("String_Node_Str") && symbol.getParameters().length() == 0 && types.isSubtype(symbol.owner.type,tbaseType.get());
}
Program: 34325
Project: 34325
Buggy source:
private static Pair<Element,Element> getFieldAndSetterForProperty(Symbol.MethodSymbol symbol,String capPropName){
  Element field=null;
  Element getter=null;
  String fieldName=capPropName.toLowerCase();
  String getterName="String_Node_Str" + capPropName;
  for (  Symbol elem : symbol.owner.getEnclosedElements()) {
    if (elem.getKind().isField() && elem.getSimpleName().toString().equals(fieldName)) {
      if (field != null) {
        throw new RuntimeException("String_Node_Str" + fieldName);
      }
      field=elem;
    }
 else     if (elem.getKind().equals(ElementKind.METHOD) && elem.getSimpleName().toString().equals(getterName)) {
      if (getter != null) {
        throw new RuntimeException("String_Node_Str" + getterName);
      }
      getter=elem;
    }
  }
  if (field == null) {
    throw new IllegalStateException("String_Node_Str" + fieldName);
  }
  if (getter == null) {
    throw new IllegalStateException("String_Node_Str" + getterName);
  }
  return Pair.of(field,getter);
}

Fixed version (ground truth):
/** 
 * Returns the field (if it exists and is visible) and the setter for a property. If the field is not available, the first element of the returned pair is   {@code null}.
 */
private Pair<Element,Element> getFieldAndSetterForProperty(Symbol.MethodSymbol symbol,String capPropName){
  Element field=null;
  Element getter=null;
  String fieldName=capPropName.toLowerCase();
  String getterName="String_Node_Str" + capPropName;
  for (  Symbol elem : symbol.owner.getEnclosedElements()) {
    if (elem.getKind().isField() && elem.getSimpleName().toString().equals(fieldName)) {
      if (field != null) {
        throw new RuntimeException("String_Node_Str" + fieldName);
      }
      field=elem;
    }
 else     if (elem.getKind().equals(ElementKind.METHOD) && elem.getSimpleName().toString().equals(getterName)) {
      if (getter != null) {
        throw new RuntimeException("String_Node_Str" + getterName);
      }
      getter=elem;
    }
  }
  if (getter == null) {
    throw new IllegalStateException("String_Node_Str" + getterName);
  }
  return Pair.of(field,getter);
}
Program: 34326
Project: 34326
Buggy source:
@Override public void onMatchTopLevelClass(NullAway analysis,ClassTree tree,VisitorState state,Symbol.ClassSymbol classSymbol){
  if (tbaseType == null) {
    tbaseType=Optional.ofNullable(state.getTypeFromString(TBASE_NAME));
  }
}

Fixed version (ground truth):
@Override public void onMatchTopLevelClass(NullAway analysis,ClassTree tree,VisitorState state,Symbol.ClassSymbol classSymbol){
  if (tbaseType == null) {
    tbaseType=getErasedTypeFromName(TBASE_NAME,state);
  }
}