nus-yam/ex-repair huggingface dataset:
Program: 70513
Project: 70513
Buggy source:
public FreezePower(AbstractCreature owner){
  this.name="String_Node_Str";
  this.ID="String_Node_Str";
  this.owner=owner;
  this.amount=-1;
  this.updateDescription();
  this.type=AbstractPower.PowerType.DEBUFF;
  this.img=BlackMageMod.getTexture("String_Node_Str");
  moveByte=1;
  moveIntent=AbstractMonster.Intent.UNKNOWN;
  if (owner instanceof AbstractMonster) {
    AbstractMonster m=(AbstractMonster)owner;
    moveByte=Byte.valueOf(m.nextMove);
    moveIntent=AbstractMonster.Intent.valueOf(m.intent.name());
    m.setMove(Byte.MAX_VALUE,AbstractMonster.Intent.STUN);
    m.createIntent();
    AbstractDungeon.actionManager.addToBottom(new SetMoveAction(m,Byte.MAX_VALUE,AbstractMonster.Intent.STUN));
  }
}

Fixed version (ground truth):
public FreezePower(AbstractCreature owner){
  this.name="String_Node_Str";
  this.ID="String_Node_Str";
  this.owner=owner;
  this.amount=-1;
  this.updateDescription();
  this.type=AbstractPower.PowerType.DEBUFF;
  this.img=BlackMageMod.getTexture("String_Node_Str");
  moveByte=1;
  moveIntent=AbstractMonster.Intent.UNKNOWN;
  if (owner instanceof AbstractMonster && !owner.hasPower("String_Node_Str")) {
    AbstractMonster m=(AbstractMonster)owner;
    moveByte=Byte.valueOf(m.nextMove);
    moveIntent=AbstractMonster.Intent.valueOf(m.intent.name());
    m.setMove(Byte.MAX_VALUE,AbstractMonster.Intent.STUN);
    m.createIntent();
    AbstractDungeon.actionManager.addToBottom(new SetMoveAction(m,Byte.MAX_VALUE,AbstractMonster.Intent.STUN));
  }
}
Program: 70514
Project: 70514
Buggy source:
public void stackPower(int stackAmount){
  this.amount+=stackAmount;
  if (this.amount >= 5) {
    this.flash();
    AbstractDungeon.actionManager.addToBottom(new GainBlockAction(owner,owner,5));
    this.amount=1;
  }
}

Fixed version (ground truth):
public void stackPower(int stackAmount){
  this.amount+=stackAmount;
  if (this.amount >= cap) {
    this.flash();
    AbstractDungeon.actionManager.addToBottom(new GainBlockAction(owner,owner,5));
    this.amount=1;
  }
}
Program: 70515
Project: 70515
Buggy source:
@Override public void updateDescription(){
  if (this.amount > 0) {
    this.description=("String_Node_Str" + DESCRIPTIONS[0] + this.amount+ "String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void updateDescription(){
  if (this.amount > 0) {
    this.description=("String_Node_Str" + DESCRIPTIONS[0] + this.amount+ "String_Node_Str"+ cap+ "String_Node_Str");
  }
}
Program: 70516
Project: 70516
Buggy source:
private void createGetHandledValuesMethod(TypeSpec.Builder builder,Set<KnitModelMirror> modelMirrors){
  int c;
  StringBuilder stringBuilder;
  ParameterizedTypeName returnTypeForGeneratedVals=ParameterizedTypeName.get(TYPE_NAME_LIST,TYPE_NAME_STRING);
  MethodSpec.Builder getGeneratedValuesMethodBuilder=MethodSpec.methodBuilder("String_Node_Str").addParameter(TYPE_NAME_CLASS,"String_Node_Str").addAnnotation(Override.class).returns(returnTypeForGeneratedVals).addModifiers(Modifier.PUBLIC);
  for (  KnitModelMirror knitModelMirror : modelMirrors) {
    c=0;
    stringBuilder=new StringBuilder();
    stringBuilder.append("String_Node_Str");
    for (    String field : knitModelMirror.vals) {
      stringBuilder.append("String_Node_Str");
      stringBuilder.append(field);
      stringBuilder.append("String_Node_Str");
      if (c < knitModelMirror.vals.size() - 1) {
        stringBuilder.append("String_Node_Str");
      }
      c++;
    }
    stringBuilder.append("String_Node_Str");
    getGeneratedValuesMethodBuilder.beginControlFlow("String_Node_Str",knitModelMirror.enclosingClass.getQualifiedName(),"String_Node_Str");
    getGeneratedValuesMethodBuilder.addStatement("String_Node_Str",stringBuilder.toString());
    getGeneratedValuesMethodBuilder.endControlFlow();
  }
  getGeneratedValuesMethodBuilder.addStatement("String_Node_Str");
  builder.addMethod(getGeneratedValuesMethodBuilder.build());
}

Fixed version (ground truth):
private void createGetHandledValuesMethod(TypeSpec.Builder builder,Set<KnitModelMirror> modelMirrors){
  int c;
  StringBuilder stringBuilder;
  ParameterizedTypeName returnTypeForGeneratedVals=ParameterizedTypeName.get(TYPE_NAME_LIST,TYPE_NAME_STRING);
  MethodSpec.Builder getGeneratedValuesMethodBuilder=MethodSpec.methodBuilder("String_Node_Str").addParameter(TYPE_NAME_CLASS,"String_Node_Str").addAnnotation(Override.class).returns(returnTypeForGeneratedVals).addModifiers(Modifier.PUBLIC);
  for (  KnitModelMirror knitModelMirror : modelMirrors) {
    c=0;
    stringBuilder=new StringBuilder();
    stringBuilder.append("String_Node_Str");
    for (    String field : knitModelMirror.vals) {
      stringBuilder.append("String_Node_Str");
      stringBuilder.append(field);
      stringBuilder.append("String_Node_Str");
      c++;
      if (c < knitModelMirror.vals.size() - 1) {
        stringBuilder.append("String_Node_Str");
      }
    }
    stringBuilder.append("String_Node_Str");
    getGeneratedValuesMethodBuilder.beginControlFlow("String_Node_Str",knitModelMirror.enclosingClass.getQualifiedName(),"String_Node_Str");
    getGeneratedValuesMethodBuilder.addStatement("String_Node_Str",stringBuilder.toString());
    getGeneratedValuesMethodBuilder.endControlFlow();
  }
  getGeneratedValuesMethodBuilder.addStatement("String_Node_Str");
  builder.addMethod(getGeneratedValuesMethodBuilder.build());
}
Program: 70517
Project: 70517
Buggy source:
private void createGetAllMethod(TypeSpec.Builder builder,Set<KnitModelMirror> modelMirrors){
  WildcardTypeName wildcardTypeName=WildcardTypeName.subtypeOf(ClassName.bestGuess(KnitFileStrings.KNIT_MODEL));
  ParameterizedTypeName classTypeName=ParameterizedTypeName.get(TYPE_NAME_CLASS,wildcardTypeName);
  ParameterizedTypeName returnTypeForGetAll=ParameterizedTypeName.get(TYPE_NAME_LIST,classTypeName);
  int c=0;
  StringBuilder stringBuilder=new StringBuilder();
  stringBuilder.append("String_Node_Str");
  for (  KnitModelMirror modelMirror : modelMirrors) {
    stringBuilder.append(modelMirror.enclosingClass.getQualifiedName());
    stringBuilder.append("String_Node_Str");
    stringBuilder.append("String_Node_Str");
    if (c < modelMirrors.size() - 1) {
      stringBuilder.append("String_Node_Str");
    }
    c++;
  }
  stringBuilder.append("String_Node_Str");
  builder.addMethod(MethodSpec.methodBuilder("String_Node_Str").addAnnotation(Override.class).returns(returnTypeForGetAll).addStatement("String_Node_Str" + stringBuilder.toString()).addModifiers(Modifier.PUBLIC).build());
}

Fixed version (ground truth):
private void createGetAllMethod(TypeSpec.Builder builder,Set<KnitModelMirror> modelMirrors){
  WildcardTypeName wildcardTypeName=WildcardTypeName.subtypeOf(ClassName.bestGuess(KnitFileStrings.KNIT_MODEL));
  ParameterizedTypeName classTypeName=ParameterizedTypeName.get(TYPE_NAME_CLASS,wildcardTypeName);
  ParameterizedTypeName returnTypeForGetAll=ParameterizedTypeName.get(TYPE_NAME_LIST,classTypeName);
  int c=0;
  StringBuilder stringBuilder=new StringBuilder();
  stringBuilder.append("String_Node_Str");
  for (  KnitModelMirror modelMirror : modelMirrors) {
    stringBuilder.append(modelMirror.enclosingClass.getQualifiedName());
    stringBuilder.append("String_Node_Str");
    stringBuilder.append("String_Node_Str");
    c++;
    if (c < modelMirrors.size() - 1) {
      stringBuilder.append("String_Node_Str");
    }
  }
  stringBuilder.append("String_Node_Str");
  builder.addMethod(MethodSpec.methodBuilder("String_Node_Str").addAnnotation(Override.class).returns(returnTypeForGetAll).addStatement("String_Node_Str" + stringBuilder.toString()).addModifiers(Modifier.PUBLIC).build());
}
Program: 70518
Project: 70518
Buggy source:
private void createGetRequiredValuesMethod(TypeSpec.Builder builder,Set<KnitModelMirror> modelMirrors){
  int c;
  StringBuilder stringBuilder;
  ParameterizedTypeName returnTypeForGeneratedVals=ParameterizedTypeName.get(TYPE_NAME_LIST,TYPE_NAME_STRING);
  MethodSpec.Builder getRequiredValuesMethodBuilder=MethodSpec.methodBuilder("String_Node_Str").addParameter(TYPE_NAME_CLASS,"String_Node_Str").addAnnotation(Override.class).returns(returnTypeForGeneratedVals).addModifiers(Modifier.PUBLIC);
  for (  KnitModelMirror knitModelMirror : modelMirrors) {
    c=0;
    stringBuilder=new StringBuilder();
    stringBuilder.append("String_Node_Str");
    for (    String field : knitModelMirror.reqs) {
      stringBuilder.append("String_Node_Str");
      stringBuilder.append(field);
      stringBuilder.append("String_Node_Str");
      if (c < knitModelMirror.vals.size() - 1) {
        stringBuilder.append("String_Node_Str");
      }
      c++;
    }
    stringBuilder.append("String_Node_Str");
    getRequiredValuesMethodBuilder.beginControlFlow("String_Node_Str",knitModelMirror.enclosingClass.getQualifiedName(),"String_Node_Str");
    getRequiredValuesMethodBuilder.addStatement("String_Node_Str",stringBuilder.toString());
    getRequiredValuesMethodBuilder.endControlFlow();
  }
  getRequiredValuesMethodBuilder.addStatement("String_Node_Str");
  builder.addMethod(getRequiredValuesMethodBuilder.build());
}

Fixed version (ground truth):
private void createGetRequiredValuesMethod(TypeSpec.Builder builder,Set<KnitModelMirror> modelMirrors){
  int c;
  StringBuilder stringBuilder;
  ParameterizedTypeName returnTypeForGeneratedVals=ParameterizedTypeName.get(TYPE_NAME_LIST,TYPE_NAME_STRING);
  MethodSpec.Builder getRequiredValuesMethodBuilder=MethodSpec.methodBuilder("String_Node_Str").addParameter(TYPE_NAME_CLASS,"String_Node_Str").addAnnotation(Override.class).returns(returnTypeForGeneratedVals).addModifiers(Modifier.PUBLIC);
  for (  KnitModelMirror knitModelMirror : modelMirrors) {
    c=0;
    stringBuilder=new StringBuilder();
    stringBuilder.append("String_Node_Str");
    for (    String field : knitModelMirror.reqs) {
      stringBuilder.append("String_Node_Str");
      stringBuilder.append(field);
      stringBuilder.append("String_Node_Str");
      if (c < knitModelMirror.reqs.size() - 1) {
        stringBuilder.append("String_Node_Str");
      }
      c++;
    }
    stringBuilder.append("String_Node_Str");
    getRequiredValuesMethodBuilder.beginControlFlow("String_Node_Str",knitModelMirror.enclosingClass.getQualifiedName(),"String_Node_Str");
    getRequiredValuesMethodBuilder.addStatement("String_Node_Str",stringBuilder.toString());
    getRequiredValuesMethodBuilder.endControlFlow();
  }
  getRequiredValuesMethodBuilder.addStatement("String_Node_Str");
  builder.addMethod(getRequiredValuesMethodBuilder.build());
}
Program: 70519
Project: 70519
Buggy source:
@Override public void onResponse(Call<StackAnswer> call,Response<StackAnswer> response){
  Log.e("String_Node_Str","String_Node_Str" + response.code());
  if (response.code() == 400) {
    if (!response.isSuccessful()) {
      Log.e("String_Node_Str","String_Node_Str");
      JSONObject jsonObject=null;
      Log.e("String_Node_Str","String_Node_Str" + response.errorBody().toString());
    }
    if (response.isSuccessful()) {
      StackAnswer stackAnswer=response.body();
      Log.e("String_Node_Str","String_Node_Str" + stackAnswer.getItems().get(0).getLink());
    }
 else     Log.e("String_Node_Str","String_Node_Str" + response.message());
  }
}

Fixed version (ground truth):
@Override public void onResponse(Call<StackAnswer> call,Response<StackAnswer> response){
  Log.e("String_Node_Str","String_Node_Str" + response.code());
  if (response.isSuccessful()) {
    StackAnswer stackAnswer=response.body();
    Log.e("String_Node_Str","String_Node_Str" + stackAnswer.getItems().get(0).getLink());
  }
 else   Log.e("String_Node_Str","String_Node_Str");
}
Program: 70520
Project: 70520
Buggy source:
@Override public int onStartCommand(Intent intent,int flags,int startId){
  Log.e("String_Node_Str","String_Node_Str");
  APIService service=Client.getService();
  Call<StackAnswer> call=service.getAnswer("String_Node_Str","String_Node_Str");
  call.enqueue(new Callback<StackAnswer>(){
    @Override public void onResponse(    Call<StackAnswer> call,    Response<StackAnswer> response){
      Log.e("String_Node_Str","String_Node_Str" + response.code());
      if (response.code() == 400) {
        if (!response.isSuccessful()) {
          Log.e("String_Node_Str","String_Node_Str");
          JSONObject jsonObject=null;
          Log.e("String_Node_Str","String_Node_Str" + response.errorBody().toString());
        }
        if (response.isSuccessful()) {
          StackAnswer stackAnswer=response.body();
          Log.e("String_Node_Str","String_Node_Str" + stackAnswer.getItems().get(0).getLink());
        }
 else         Log.e("String_Node_Str","String_Node_Str" + response.message());
      }
    }
    @Override public void onFailure(    Call<StackAnswer> call,    Throwable t){
      Log.e("String_Node_Str","String_Node_Str");
    }
  }
);
  return START_STICKY;
}

Fixed version (ground truth):
@Override public int onStartCommand(Intent intent,int flags,int startId){
  Log.e("String_Node_Str","String_Node_Str");
  APIService service=Client.getService();
  Call<StackAnswer> call=service.getAnswer();
  call.enqueue(new Callback<StackAnswer>(){
    @Override public void onResponse(    Call<StackAnswer> call,    Response<StackAnswer> response){
      Log.e("String_Node_Str","String_Node_Str" + response.code());
      if (response.isSuccessful()) {
        StackAnswer stackAnswer=response.body();
        Log.e("String_Node_Str","String_Node_Str" + stackAnswer.getItems().get(0).getLink());
      }
 else       Log.e("String_Node_Str","String_Node_Str");
    }
    @Override public void onFailure(    Call<StackAnswer> call,    Throwable t){
      Log.e("String_Node_Str","String_Node_Str");
    }
  }
);
  return START_STICKY;
}
Program: 70521
Project: 70521
Buggy source:
public void uncaughtException(final Thread thread,final Throwable ex){
  Log.e("String_Node_Str","String_Node_Str");
  Intent intent=new Intent(context,MyService.class);
  context.startService(intent);
  Log.e("String_Node_Str","String_Node_Str");
  androidDefaultUEH.uncaughtException(thread,ex);
}

Fixed version (ground truth):
public void uncaughtException(final Thread thread,final Throwable ex){
  Intent intent=new Intent(context,MyService.class);
  context.startService(intent);
  androidDefaultUEH.uncaughtException(thread,ex);
}
Program: 70522
Project: 70522
Buggy source:
@GET("String_Node_Str") Call<StackAnswer> getAnswer(@Query("String_Node_Str") String title,@Query("String_Node_Str") String site);

Fixed version (ground truth):
@GET("String_Node_Str" + "String_Node_Str") Call<StackAnswer> getAnswer();
Program: 70525
Project: 70525
Buggy source:
@Override public void onClick(View v){
  lastOpenId=ProfileSetupActivity.PROFILE_SETUP_WITH_GOOGLE;
  lastOpen=bind.google;
  dialog.show();
  startActivityForResult(Auth.GoogleSignInApi.getSignInIntent(client),GOOGLE_REQUEST_CODE);
}

Fixed version (ground truth):
@Override public void onClick(View v){
  lastOpenImg=bind.googleImg;
  lastOpenTv=bind.googleTv;
  lastOpenId=ProfileSetupActivity.PROFILE_SETUP_WITH_GOOGLE;
  dialog.show();
  startActivityForResult(Auth.GoogleSignInApi.getSignInIntent(client),GOOGLE_REQUEST_CODE);
}
Program: 70526
Project: 70526
Buggy source:
@Override public void onDataChange(DataSnapshot dataSnapshot){
  dialog.cancel();
  if (dataSnapshot.getValue() == null) {
    if (lastOpen == null) {
      startActivity(new Intent(SigninActivity.this,ProfileSetupActivity.class));
      return;
    }
    Intent i=new Intent(SigninActivity.this,ProfileSetupActivity.class);
    i.putExtra(ProfileSetupActivity.EXTRA_SETUP_METHOD,lastOpenId);
    startActivity(i,ActivityOptionsCompat.makeSceneTransitionAnimation(SigninActivity.this,lastOpen,"String_Node_Str").toBundle());
  }
 else {
    startActivity(new Intent(SigninActivity.this,MainActivity.class));
  }
  finish();
}

Fixed version (ground truth):
@Override public void onDataChange(DataSnapshot dataSnapshot){
  dialog.cancel();
  if (dataSnapshot.getValue() == null) {
    if (lastOpenImg == null || lastOpenTv == null) {
      startActivity(new Intent(SigninActivity.this,ProfileSetupActivity.class));
      return;
    }
    Intent i=new Intent(SigninActivity.this,ProfileSetupActivity.class);
    i.putExtra(ProfileSetupActivity.EXTRA_SETUP_METHOD,lastOpenId);
    startActivity(i,ActivityOptionsCompat.makeSceneTransitionAnimation(SigninActivity.this,new Pair<View,String>(lastOpenImg,"String_Node_Str"),new Pair<View,String>(lastOpenTv,"String_Node_Str")).toBundle());
  }
 else {
    startActivity(new Intent(SigninActivity.this,MainActivity.class));
  }
  finish();
}
Program: 70527
Project: 70527
Buggy source:
private void googleSetup(){
  GoogleSignInOptions gso=new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN).requestIdToken(getString(R.string.default_web_client_id)).requestEmail().build();
  client=new GoogleApiClient.Builder(this).enableAutoManage(this,new GoogleApiClient.OnConnectionFailedListener(){
    @Override public void onConnectionFailed(    @NonNull ConnectionResult connectionResult){
      dialog.cancel();
      showToast(R.string.error);
    }
  }
).addApi(Auth.GOOGLE_SIGN_IN_API,gso).build();
  bind.googleBtn.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      lastOpenId=ProfileSetupActivity.PROFILE_SETUP_WITH_GOOGLE;
      lastOpen=bind.google;
      dialog.show();
      startActivityForResult(Auth.GoogleSignInApi.getSignInIntent(client),GOOGLE_REQUEST_CODE);
    }
  }
);
}

Fixed version (ground truth):
private void googleSetup(){
  GoogleSignInOptions gso=new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN).requestIdToken(getString(R.string.default_web_client_id)).requestEmail().build();
  client=new GoogleApiClient.Builder(this).enableAutoManage(this,new GoogleApiClient.OnConnectionFailedListener(){
    @Override public void onConnectionFailed(    @NonNull ConnectionResult connectionResult){
      dialog.cancel();
      showToast(R.string.error);
    }
  }
).addApi(Auth.GOOGLE_SIGN_IN_API,gso).build();
  bind.google.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      lastOpenImg=bind.googleImg;
      lastOpenTv=bind.googleTv;
      lastOpenId=ProfileSetupActivity.PROFILE_SETUP_WITH_GOOGLE;
      dialog.show();
      startActivityForResult(Auth.GoogleSignInApi.getSignInIntent(client),GOOGLE_REQUEST_CODE);
    }
  }
);
}
Program: 70528
Project: 70528
Buggy source:
private void twitterSetup(){
  TwitterConfig config=new TwitterConfig.Builder(this).twitterAuthConfig(new TwitterAuthConfig(getResources().getString(R.string.com_twitter_sdk_android_CONSUMER_KEY),getResources().getString(R.string.com_twitter_sdk_android_CONSUMER_SECRET))).build();
  Twitter.initialize(config);
  twitterClient=new TwitterAuthClient();
  bind.twitterBtn.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      lastOpenId=ProfileSetupActivity.PROFILE_SETUP_WITH_TWITTER;
      lastOpen=bind.twitter;
      twitterClient.authorize(SigninActivity.this,new Callback<TwitterSession>(){
        @Override public void success(        Result<TwitterSession> result){
          TwitterAuthToken token=result.data.getAuthToken();
          auth.signInWithCredential(TwitterAuthProvider.getCredential(token.token,token.secret)).addOnCompleteListener(signInCallback);
        }
        @Override public void failure(        TwitterException exception){
          showToast(R.string.error);
          dialog.cancel();
        }
      }
);
    }
  }
);
}

Fixed version (ground truth):
private void twitterSetup(){
  TwitterConfig config=new TwitterConfig.Builder(this).twitterAuthConfig(new TwitterAuthConfig(getResources().getString(R.string.com_twitter_sdk_android_CONSUMER_KEY),getResources().getString(R.string.com_twitter_sdk_android_CONSUMER_SECRET))).build();
  Twitter.initialize(config);
  twitterClient=new TwitterAuthClient();
  bind.twitter.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      lastOpenId=ProfileSetupActivity.PROFILE_SETUP_WITH_TWITTER;
      lastOpenImg=bind.twitterImg;
      lastOpenTv=bind.twitterTv;
      twitterClient.authorize(SigninActivity.this,new Callback<TwitterSession>(){
        @Override public void success(        Result<TwitterSession> result){
          TwitterAuthToken token=result.data.getAuthToken();
          auth.signInWithCredential(TwitterAuthProvider.getCredential(token.token,token.secret)).addOnCompleteListener(signInCallback);
        }
        @Override public void failure(        TwitterException exception){
          showToast(R.string.error);
          dialog.cancel();
        }
      }
);
    }
  }
);
}
Program: 70530
Project: 70530
Buggy source:
@Override public void onComplete(@NonNull Task<AuthResult> task){
  final FirebaseUser user=auth.getCurrentUser();
  if (task.isSuccessful() && user != null) {
    database.getReference().child("String_Node_Str").child(user.getUid()).child("String_Node_Str").addListenerForSingleValueEvent(new ValueEventListener(){
      @Override public void onDataChange(      DataSnapshot dataSnapshot){
        dialog.cancel();
        if (dataSnapshot.getValue() == null) {
          if (lastOpen == null) {
            startActivity(new Intent(SigninActivity.this,ProfileSetupActivity.class));
            return;
          }
          Intent i=new Intent(SigninActivity.this,ProfileSetupActivity.class);
          i.putExtra(ProfileSetupActivity.EXTRA_SETUP_METHOD,lastOpenId);
          startActivity(i,ActivityOptionsCompat.makeSceneTransitionAnimation(SigninActivity.this,lastOpen,"String_Node_Str").toBundle());
        }
 else {
          startActivity(new Intent(SigninActivity.this,MainActivity.class));
        }
        finish();
      }
      @Override public void onCancelled(      DatabaseError databaseError){
        dialog.cancel();
      }
    }
);
  }
 else {
    dialog.cancel();
    showToast(R.string.error);
    bind.password.setText("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void onComplete(@NonNull Task<AuthResult> task){
  final FirebaseUser user=auth.getCurrentUser();
  if (task.isSuccessful() && user != null) {
    database.getReference().child("String_Node_Str").child(user.getUid()).child("String_Node_Str").addListenerForSingleValueEvent(new ValueEventListener(){
      @Override public void onDataChange(      DataSnapshot dataSnapshot){
        dialog.cancel();
        if (dataSnapshot.getValue() == null) {
          if (lastOpenImg == null || lastOpenTv == null) {
            startActivity(new Intent(SigninActivity.this,ProfileSetupActivity.class));
            return;
          }
          Intent i=new Intent(SigninActivity.this,ProfileSetupActivity.class);
          i.putExtra(ProfileSetupActivity.EXTRA_SETUP_METHOD,lastOpenId);
          startActivity(i,ActivityOptionsCompat.makeSceneTransitionAnimation(SigninActivity.this,new Pair<View,String>(lastOpenImg,"String_Node_Str"),new Pair<View,String>(lastOpenTv,"String_Node_Str")).toBundle());
        }
 else {
          startActivity(new Intent(SigninActivity.this,MainActivity.class));
        }
        finish();
      }
      @Override public void onCancelled(      DatabaseError databaseError){
        dialog.cancel();
      }
    }
);
  }
 else {
    dialog.cancel();
    showToast(R.string.error);
    bind.password.setText("String_Node_Str");
  }
}
Program: 70531
Project: 70531
Buggy source:
private void loginSetup(){
  bind.login.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      lastOpenId=ProfileSetupActivity.PROFILE_SETUP_WITH_EMAIL_AND_PASSWORD;
      lastOpen=bind.login;
      AlertDialog.Builder builder=new AlertDialog.Builder(SigninActivity.this);
      View view=getLayoutInflater().inflate(R.layout.dialog_email_password_holder,null);
      final EditText emailHolder=(EditText)view.findViewById(R.id.email_holder);
      final EditText passwordHolder=(EditText)view.findViewById(R.id.password_holder);
      final TextView done=(TextView)view.findViewById(R.id.done);
      builder.setView(view);
      final AlertDialog d=builder.create();
      d.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
      d.show();
      done.setOnClickListener(new View.OnClickListener(){
        @Override public void onClick(        View v){
          dialog.show();
          d.cancel();
          emailPasswordSignin(emailHolder.getText().toString(),passwordHolder.getText().toString());
        }
      }
);
    }
  }
);
}

Fixed version (ground truth):
private void loginSetup(){
  bind.loginImg.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      lastOpenId=ProfileSetupActivity.PROFILE_SETUP_WITH_EMAIL_AND_PASSWORD;
      lastOpenImg=bind.loginImg;
      AlertDialog.Builder builder=new AlertDialog.Builder(SigninActivity.this);
      View view=getLayoutInflater().inflate(R.layout.dialog_email_password_holder,null);
      final EditText emailHolder=(EditText)view.findViewById(R.id.email_holder);
      final EditText passwordHolder=(EditText)view.findViewById(R.id.password_holder);
      final TextView done=(TextView)view.findViewById(R.id.done);
      builder.setView(view);
      final AlertDialog d=builder.create();
      d.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
      d.show();
      done.setOnClickListener(new View.OnClickListener(){
        @Override public void onClick(        View v){
          dialog.show();
          d.cancel();
          emailPasswordSignin(emailHolder.getText().toString(),passwordHolder.getText().toString());
        }
      }
);
    }
  }
);
}
Program: 70532
Project: 70532
Buggy source:
private void showLoginText(){
  bind.loginTv.setX(bind.area.getMeasuredWidth() / 2 - bind.loginTv.getMeasuredWidth() / 2);
  bind.loginTv.setY(3 * bind.area.getMeasuredHeight() / 4 + bind.login.getMeasuredHeight() / 2 + bind.loginTv.getMeasuredHeight() / 2);
  bind.loginTv.setVisibility(View.VISIBLE);
  ObjectAnimator animator=ObjectAnimator.ofFloat(bind.loginTv,"String_Node_Str",0f,1f).setDuration(Const.LOGIN_SHOW_DURATION);
  ObjectAnimator animatorScaleX=ObjectAnimator.ofFloat(bind.loginTv,"String_Node_Str",0.7f,1f).setDuration(Const.LOGIN_SHOW_DURATION);
  ObjectAnimator animatorScaleY=ObjectAnimator.ofFloat(bind.loginTv,"String_Node_Str",0.7f,1f).setDuration(Const.LOGIN_SHOW_DURATION);
  animator.setInterpolator(new AccelerateInterpolator());
  animatorScaleX.setInterpolator(new DecelerateInterpolator());
  animatorScaleY.setInterpolator(new DecelerateInterpolator());
  animator.start();
  animatorScaleX.start();
  animatorScaleY.start();
}

Fixed version (ground truth):
private void showLoginText(){
  bind.loginTv.setX(bind.area.getMeasuredWidth() / 2 - bind.loginTv.getMeasuredWidth() / 2);
  bind.loginTv.setY(3 * bind.area.getMeasuredHeight() / 4 + bind.loginImg.getMeasuredHeight() / 2 + bind.loginTv.getMeasuredHeight() / 2);
  bind.loginTv.setVisibility(View.VISIBLE);
  ObjectAnimator animator=ObjectAnimator.ofFloat(bind.loginTv,"String_Node_Str",0f,1f).setDuration(Const.LOGIN_SHOW_DURATION);
  ObjectAnimator animatorScaleX=ObjectAnimator.ofFloat(bind.loginTv,"String_Node_Str",0.7f,1f).setDuration(Const.LOGIN_SHOW_DURATION);
  ObjectAnimator animatorScaleY=ObjectAnimator.ofFloat(bind.loginTv,"String_Node_Str",0.7f,1f).setDuration(Const.LOGIN_SHOW_DURATION);
  animator.setInterpolator(new AccelerateInterpolator());
  animatorScaleX.setInterpolator(new DecelerateInterpolator());
  animatorScaleY.setInterpolator(new DecelerateInterpolator());
  animator.start();
  animatorScaleX.start();
  animatorScaleY.start();
}
Program: 70533
Project: 70533
Buggy source:
private void phoneSetup(){
  bind.phoneBtn.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      lastOpenId=ProfileSetupActivity.PROFILE_SETUP_WITH_PHONE;
      lastOpen=bind.phone;
      AlertDialog.Builder builder=new AlertDialog.Builder(SigninActivity.this);
      View view=getLayoutInflater().inflate(R.layout.dialog_phone_holder,null);
      final EditText phoneHolder=(EditText)view.findViewById(R.id.phone_holder);
      final TextView done=(TextView)view.findViewById(R.id.done);
      builder.setView(view);
      final AlertDialog d=builder.create();
      d.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
      d.show();
      done.setOnClickListener(new View.OnClickListener(){
        @Override public void onClick(        View v){
          d.cancel();
          phoneSignin(phoneHolder.getText().toString());
        }
      }
);
    }
  }
);
}

Fixed version (ground truth):
private void phoneSetup(){
  bind.phone.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      lastOpenId=ProfileSetupActivity.PROFILE_SETUP_WITH_PHONE;
      lastOpenImg=bind.phoneImg;
      lastOpenTv=bind.phoneTv;
      AlertDialog.Builder builder=new AlertDialog.Builder(SigninActivity.this);
      View view=getLayoutInflater().inflate(R.layout.dialog_phone_holder,null);
      final EditText phoneHolder=(EditText)view.findViewById(R.id.phone_holder);
      final TextView done=(TextView)view.findViewById(R.id.done);
      builder.setView(view);
      final AlertDialog d=builder.create();
      d.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
      d.show();
      done.setOnClickListener(new View.OnClickListener(){
        @Override public void onClick(        View v){
          d.cancel();
          phoneSignin(phoneHolder.getText().toString());
        }
      }
);
    }
  }
);
}
Program: 70534
Project: 70534
Buggy source:
private void facebookSetup(){
  callbackManager=CallbackManager.Factory.create();
  loginManager=LoginManager.getInstance();
  loginManager.registerCallback(callbackManager,new FacebookCallback<LoginResult>(){
    @Override public void onSuccess(    LoginResult loginResult){
      auth.signInWithCredential(FacebookAuthProvider.getCredential(loginResult.getAccessToken().getToken())).addOnCompleteListener(signInCallback);
    }
    @Override public void onCancel(){
      dialog.cancel();
    }
    @Override public void onError(    FacebookException error){
      showToast(R.string.error);
      dialog.cancel();
    }
  }
);
  bind.facebookBtn.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      lastOpenId=ProfileSetupActivity.PROFILE_SETUP_WITH_FACEBOOK;
      lastOpen=bind.facebook;
      loginManager.logInWithReadPermissions(SigninActivity.this,Arrays.asList("String_Node_Str","String_Node_Str"));
    }
  }
);
}

Fixed version (ground truth):
private void facebookSetup(){
  callbackManager=CallbackManager.Factory.create();
  loginManager=LoginManager.getInstance();
  loginManager.registerCallback(callbackManager,new FacebookCallback<LoginResult>(){
    @Override public void onSuccess(    LoginResult loginResult){
      auth.signInWithCredential(FacebookAuthProvider.getCredential(loginResult.getAccessToken().getToken())).addOnCompleteListener(signInCallback);
    }
    @Override public void onCancel(){
      dialog.cancel();
    }
    @Override public void onError(    FacebookException error){
      showToast(R.string.error);
      dialog.cancel();
    }
  }
);
  bind.facebook.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      lastOpenId=ProfileSetupActivity.PROFILE_SETUP_WITH_FACEBOOK;
      lastOpenImg=bind.facebookImg;
      lastOpenTv=bind.facebookTv;
      loginManager.logInWithReadPermissions(SigninActivity.this,Arrays.asList("String_Node_Str","String_Node_Str"));
    }
  }
);
}
Program: 70535
Project: 70535
Buggy source:
public Message(String owner_id,String owner_nickname,String content){
  this.owner_nickname=owner_nickname;
  this.content=content;
  this.owner_id=owner_id;
  date=new SimpleDateFormat("String_Node_Str").format(new Date()).toString();
}

Fixed version (ground truth):
public Message(String owner_id,String owner_nickname,String content,String owner_photo_url){
  this.owner_nickname=owner_nickname;
  this.content=content;
  this.owner_id=owner_id;
  this.owner_photo_url=owner_photo_url;
  date=new SimpleDateFormat("String_Node_Str").format(new Date()).toString();
}
Program: 70537
Project: 70537
Buggy source:
public void createMessage(String content){
  String key=db.getReference().child("String_Node_Str").push().getKey();
  db.getReference().child("String_Node_Str").child(chatId).child("String_Node_Str").push().setValue(key);
  db.getReference().child("String_Node_Str").child(key).setValue(new Message(auth.getCurrentUser().getUid(),auth.getCurrentUser().getDisplayName(),content));
}

Fixed version (ground truth):
public void createMessage(String content){
  String key=db.getReference().child("String_Node_Str").push().getKey();
  db.getReference().child("String_Node_Str").child(chatId).child("String_Node_Str").push().setValue(key);
  db.getReference().child("String_Node_Str").child(key).setValue(new Message(auth.getCurrentUser().getUid(),auth.getCurrentUser().getDisplayName(),content,auth.getCurrentUser().getPhotoUrl().toString()));
}
Program: 70538
Project: 70538
Buggy source:
public MessageAdapter(RecyclerView view,String auth){
  this.view=view;
  this.auth=auth;
  list=new ArrayList<>();
}

Fixed version (ground truth):
public MessageAdapter(Context context,RecyclerView view,String auth){
  this.view=view;
  this.auth=auth;
  list=new ArrayList<>();
  this.context=context;
}
Program: 70539
Project: 70539
Buggy source:
public void bind(Chat chat){
  chatId=chat.getChat_id();
  bind.chatName.setText(chat.getChat_name());
  bind.lastMessage.setText(chat.getLast_message());
  bind.time.setText(chat.getTime());
}

Fixed version (ground truth):
public void bind(Chat chat){
  chatId=chat.getChat_id();
  bind.chatName.setText(chat.getChat_name());
  bind.lastMessage.setText(chat.getLast_message());
  bind.time.setText(chat.getTime());
  if (chat.getPhoto_url() != null) {
    Picasso.with(context).load(chat.getPhoto_url()).resize(ImageUtils.SIZE_XL,ImageUtils.SIZE_XL).into(bind.photo);
  }
}
Program: 70542
Project: 70542
Buggy source:
public void bindData(BlogPost post){
  this.post=post;
  bind.nickname.setText(post.getOwner_name());
  bind.content.setText(UtilsManager.cut(post.getContent(),500));
  bind.date.setText(post.getDate());
  bind.like.setText(context.getResources().getString(R.string.like_cnt,post.getLike()));
  bind.comment.setText(context.getResources().getString(R.string.comment_cnt,post.getComment()));
  bind.view.setText(context.getResources().getString(R.string.view_cnt,post.getView()));
  if (post.getOwner_photo_url() != null)   Picasso.with(context).load(post.getOwner_photo_url()).into(bind.photo);
}

Fixed version (ground truth):
public void bindData(BlogPost post){
  this.post=post;
  bind.nickname.setText(post.getOwner_name());
  bind.content.setText(UtilsManager.cut(post.getContent(),500));
  bind.date.setText(post.getDate());
  bind.like.setText(context.getResources().getString(R.string.like_cnt,post.getLike()));
  bind.comment.setText(context.getResources().getString(R.string.comment_cnt,post.getComment()));
  bind.view.setText(context.getResources().getString(R.string.view_cnt,post.getView()));
  if (post.getOwner_photo_url() != null)   Picasso.with(context).load(post.getOwner_photo_url()).resize(ImageUtils.SIZE_L,ImageUtils.SIZE_L).into(bind.photo);
}
Program: 70544
Project: 70544
Buggy source:
public void bind(User user){
  this.user=user;
  bind.userName.setText(user.getName());
  bind.userEmail.setText(user.getEmail());
  if (user.getPhoto_url() != null)   Picasso.with(context).load(user.getPhoto_url()).into(bind.photo);
}

Fixed version (ground truth):
public void bind(User user){
  this.user=user;
  bind.userName.setText(user.getName());
  bind.userEmail.setText(user.getEmail());
  if (user.getPhoto_url() != null)   Picasso.with(context).load(user.getPhoto_url()).resize(ImageUtils.SIZE_XXL,ImageUtils.SIZE_XXL).into(bind.photo);
}
Program: 70546
Project: 70546
Buggy source:
public void bind(Comment comment){
  this.comment=comment;
  bind.nickname.setText(comment.getOwner_name());
  bind.context.setText(comment.getContext());
  bind.nickname.setOnClickListener(onClickShowUser);
  bind.photo.setOnClickListener(onClickShowUser);
  if (comment.getOwner_photo_url() != null)   Picasso.with(context).load(comment.getOwner_photo_url()).into(bind.photo);
}

Fixed version (ground truth):
public void bind(Comment comment){
  this.comment=comment;
  bind.nickname.setText(comment.getOwner_name());
  bind.context.setText(comment.getContext());
  bind.nickname.setOnClickListener(onClickShowUser);
  bind.photo.setOnClickListener(onClickShowUser);
  if (comment.getOwner_photo_url() != null)   Picasso.with(context).load(comment.getOwner_photo_url()).resize(ImageUtils.SIZE_L,ImageUtils.SIZE_L).into(bind.photo);
}
Program: 70547
Project: 70547
Buggy source:
public void bind(User user){
  bind.nickname.setText(user.getName());
  if (user.getPhoto_url() != null)   Picasso.with(context).load(user.getPhoto_url()).into(bind.photo);
}

Fixed version (ground truth):
public void bind(User user){
  bind.nickname.setText(user.getName());
  if (user.getPhoto_url() != null)   Picasso.with(context).load(user.getPhoto_url()).resize(ImageUtils.SIZE_XXL,ImageUtils.SIZE_XXL).into(bind.photo);
}
Program: 70549
Project: 70549
Buggy source:
@Override public void onClick(View v){
  db.getReference().child("String_Node_Str").child(user.getUid()).child("String_Node_Str").child(auth.getCurrentUser().getUid()).addListenerForSingleValueEvent(new ValueEventListener(){
    @Override public void onDataChange(    DataSnapshot dataSnapshot){
      if (dataSnapshot.getValue() == null) {
        String key=db.getReference().child("String_Node_Str").push().getKey();
        db.getReference().child("String_Node_Str").child(user.getUid()).child("String_Node_Str").child(auth.getCurrentUser().getUid()).setValue(key);
        db.getReference().child("String_Node_Str").child(auth.getCurrentUser().getUid()).child("String_Node_Str").child(user.getUid()).setValue(key);
        db.getReference().child("String_Node_Str").child(key).child("String_Node_Str").push().setValue(user.getUid());
        db.getReference().child("String_Node_Str").child(key).child("String_Node_Str").push().setValue(auth.getCurrentUser().getUid());
        startActivity(ChatActivity.getIntent(key,ProfileActivity.this));
      }
 else {
        startActivity(ChatActivity.getIntent((String)dataSnapshot.getValue(),ProfileActivity.this));
      }
    }
    @Override public void onCancelled(    DatabaseError databaseError){
    }
  }
);
}

Fixed version (ground truth):
@Override public void onClick(View v){
  db.getReference().child("String_Node_Str").child(user.getUid()).child("String_Node_Str").child(auth.getCurrentUser().getUid()).addListenerForSingleValueEvent(new ValueEventListener(){
    @Override public void onDataChange(    DataSnapshot dataSnapshot){
      if (dataSnapshot.getValue() == null) {
        String key=db.getReference().child("String_Node_Str").push().getKey();
        db.getReference().child("String_Node_Str").child(user.getUid()).child("String_Node_Str").child(auth.getCurrentUser().getUid()).setValue(key);
        db.getReference().child("String_Node_Str").child(auth.getCurrentUser().getUid()).child("String_Node_Str").child(user.getUid()).setValue(key);
        db.getReference().child("String_Node_Str").child(key).child("String_Node_Str").push().setValue(user.getUid());
        db.getReference().child("String_Node_Str").child(key).child("String_Node_Str").setValue(user.getPhoto_url());
        db.getReference().child("String_Node_Str").child(key).child("String_Node_Str").push().setValue(auth.getCurrentUser().getUid());
        startActivity(ChatActivity.getIntent(key,ProfileActivity.this));
      }
 else {
        startActivity(ChatActivity.getIntent((String)dataSnapshot.getValue(),ProfileActivity.this));
      }
    }
    @Override public void onCancelled(    DatabaseError databaseError){
    }
  }
);
}
Program: 70550
Project: 70550
Buggy source:
@Override public void onDataChange(DataSnapshot dataSnapshot){
  if (dataSnapshot.getValue() == null) {
    String key=db.getReference().child("String_Node_Str").push().getKey();
    db.getReference().child("String_Node_Str").child(user.getUid()).child("String_Node_Str").child(auth.getCurrentUser().getUid()).setValue(key);
    db.getReference().child("String_Node_Str").child(auth.getCurrentUser().getUid()).child("String_Node_Str").child(user.getUid()).setValue(key);
    db.getReference().child("String_Node_Str").child(key).child("String_Node_Str").push().setValue(user.getUid());
    db.getReference().child("String_Node_Str").child(key).child("String_Node_Str").push().setValue(auth.getCurrentUser().getUid());
    startActivity(ChatActivity.getIntent(key,ProfileActivity.this));
  }
 else {
    startActivity(ChatActivity.getIntent((String)dataSnapshot.getValue(),ProfileActivity.this));
  }
}

Fixed version (ground truth):
@Override public void onDataChange(DataSnapshot dataSnapshot){
  if (dataSnapshot.getValue() == null) {
    String key=db.getReference().child("String_Node_Str").push().getKey();
    db.getReference().child("String_Node_Str").child(user.getUid()).child("String_Node_Str").child(auth.getCurrentUser().getUid()).setValue(key);
    db.getReference().child("String_Node_Str").child(auth.getCurrentUser().getUid()).child("String_Node_Str").child(user.getUid()).setValue(key);
    db.getReference().child("String_Node_Str").child(key).child("String_Node_Str").push().setValue(user.getUid());
    db.getReference().child("String_Node_Str").child(key).child("String_Node_Str").setValue(user.getPhoto_url());
    db.getReference().child("String_Node_Str").child(key).child("String_Node_Str").push().setValue(auth.getCurrentUser().getUid());
    startActivity(ChatActivity.getIntent(key,ProfileActivity.this));
  }
 else {
    startActivity(ChatActivity.getIntent((String)dataSnapshot.getValue(),ProfileActivity.this));
  }
}
Program: 70551
Project: 70551
Buggy source:
private void showUserProfile(final String uid){
  dialog.show();
  db.getReference().child("String_Node_Str").child(uid).addListenerForSingleValueEvent(new ValueEventListener(){
    @Override public void onDataChange(    DataSnapshot dataSnapshot){
      user=dataSnapshot.getValue(User.class);
      user.setUid(uid);
      bind.userEmail.setText(user.getEmail());
      bind.userName.setText(user.getName());
      if (user.getPhoto_url() != null)       Picasso.with(ProfileActivity.this).load(user.getPhoto_url()).into(bind.photo);
      setupStatus();
      dialog.cancel();
      loadPosts();
    }
    @Override public void onCancelled(    DatabaseError databaseError){
      dialog.cancel();
      Toast.makeText(ProfileActivity.this,getResources().getString(R.string.error),Toast.LENGTH_SHORT).show();
    }
  }
);
}

Fixed version (ground truth):
private void showUserProfile(final String uid){
  dialog.show();
  db.getReference().child("String_Node_Str").child(uid).addListenerForSingleValueEvent(new ValueEventListener(){
    @Override public void onDataChange(    DataSnapshot dataSnapshot){
      user=dataSnapshot.getValue(User.class);
      user.setUid(uid);
      bind.userEmail.setText(user.getEmail());
      bind.userName.setText(user.getName());
      if (user.getPhoto_url() != null)       Picasso.with(ProfileActivity.this).load(user.getPhoto_url()).resize(ImageUtils.SIZE_XXL,ImageUtils.SIZE_XXL).into(bind.photo);
      setupStatus();
      dialog.cancel();
      loadPosts();
    }
    @Override public void onCancelled(    DatabaseError databaseError){
      dialog.cancel();
      Toast.makeText(ProfileActivity.this,getResources().getString(R.string.error),Toast.LENGTH_SHORT).show();
    }
  }
);
}
Program: 70552
Project: 70552
Buggy source:
private void phoneSignin(String number){
  dialog.show();
  PhoneAuthProvider.getInstance().verifyPhoneNumber(number,60,TimeUnit.SECONDS,this,new PhoneAuthProvider.OnVerificationStateChangedCallbacks(){
    @Override public void onVerificationCompleted(    PhoneAuthCredential phoneAuthCredential){
      auth.signInWithCredential(phoneAuthCredential).addOnCompleteListener(signInCallback);
    }
    @Override public void onVerificationFailed(    FirebaseException e){
      showToast(R.string.error);
    }
  }
);
}

Fixed version (ground truth):
private void phoneSignin(String number){
  if (number.isEmpty())   return;
  dialog.show();
  PhoneAuthProvider.getInstance().verifyPhoneNumber(number,60,TimeUnit.SECONDS,this,new PhoneAuthProvider.OnVerificationStateChangedCallbacks(){
    @Override public void onVerificationCompleted(    PhoneAuthCredential phoneAuthCredential){
      auth.signInWithCredential(phoneAuthCredential).addOnCompleteListener(signInCallback);
    }
    @Override public void onVerificationFailed(    FirebaseException e){
      showToast(R.string.error);
    }
  }
);
}
Program: 70555
Project: 70555
Buggy source:
public long[] fetchTsIndexs(){
  Set<Long> indexSET=tsSegments.keySet();
  if (indexSET.size() < 3) {
    return null;
  }
  Long[] indexArr=indexSET.toArray(new Long[indexSET.size()]);
  Arrays.sort(indexArr);
  if (indexArr.length > 5) {
    Long[] tmpArr=new Long[5];
    System.arraycopy(indexArr,indexArr.length - 5,tmpArr,0,5);
    return ArrayUtils.toPrimitive(tmpArr);
  }
 else {
    return ArrayUtils.toPrimitive(indexArr);
  }
}

Fixed version (ground truth):
public long[] fetchTsIndexs(){
  Set<Long> indexSET=ImmutableSet.copyOf(tsSegments.keySet());
  if (indexSET.size() < 3) {
    return null;
  }
  Long[] indexArr=indexSET.toArray(new Long[indexSET.size()]);
  Arrays.sort(indexArr);
  if (indexArr.length > 5) {
    Long[] tmpArr=new Long[5];
    System.arraycopy(indexArr,indexArr.length - 5,tmpArr,0,5);
    return ArrayUtils.toPrimitive(tmpArr);
  }
 else {
    return ArrayUtils.toPrimitive(indexArr);
  }
}
Program: 70556
Project: 70556
Buggy source:
private boolean isFilter(ChannelHandlerContext ctx,MessageEvent messageEvent,IRequestHandler requestHandler){
  List<IFilter> filters=filterChain.get(requestHandler.getType());
  for (  IFilter filter : filters) {
    if (filter.doFilter(ctx,messageEvent)) {
      continue;
    }
 else {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean isFilter(ChannelHandlerContext ctx,MessageEvent messageEvent,IRequestHandler requestHandler){
  List<IFilter> filters=filterChain.get(requestHandler.getType());
  if (filters != null) {
    for (    IFilter filter : filters) {
      if (filter.doFilter(ctx,messageEvent)) {
        continue;
      }
 else {
        return false;
      }
    }
  }
  return true;
}
Program: 70557
Project: 70557
Buggy source:
public TsSegment fetchTsSegmentByIndex(long index){
  if (index < 0)   return null;
  TsSegment tsSegment=null;
  if (index < 4) {
    String type="String_Node_Str";
switch (streamType) {
case HlsLiveStreamType.YUV:
case HlsLiveStreamType.H264:
      type="String_Node_Str";
    break;
case HlsLiveStreamType.AAC_H264_MIXED:
  type="String_Node_Str";
break;
}
List<TsSegment> adTsSegments=adsMagr.getAdsTsSegments(type,sampleRate,sampleSizeInBits,channels,fps);
tsSegment=adTsSegments.get((int)index - 1);
}
 else {
tsSegment=tsSegments.get(index);
}
if (tsSegment != null) {
tsSegment.setLasttime(System.currentTimeMillis());
}
return tsSegment;
}

Fixed version (ground truth):
public TsSegment fetchTsSegmentByIndex(long index){
  if (index < 0)   return null;
  TsSegment tsSegment=null;
  if (index < 4) {
    String type="String_Node_Str";
switch (streamType) {
case HlsLiveStreamType.YUV:
case HlsLiveStreamType.H264:
      type="String_Node_Str";
    break;
case HlsLiveStreamType.AAC_H264_MIXED:
  type="String_Node_Str";
break;
}
List<TsSegment> adTsSegments=AdsMagr.getAdsTsSegments(type,sampleRate,sampleSizeInBits,channels,fps);
tsSegment=adTsSegments.get((int)index - 1);
}
 else {
tsSegment=tsSegments.get(index);
}
if (tsSegment != null) {
tsSegment.setLasttime(System.currentTimeMillis());
}
return tsSegment;
}
Program: 70558
Project: 70558
Buggy source:
public static boolean isHasAds(){
  return isHasAds;
}

Fixed version (ground truth):
public static boolean isHasAds(){
  if (isLoading.get()) {
    return false;
  }
  return isHasAds;
}