nus-yam/ex-repair huggingface dataset:
Program: 41368
Project: 41368
Buggy source:
/** 
 * {@inheritDoc}
 */
public SparkJobResult startJob(String data,Map<String,String> params) throws SparkJobServerClientException {
  try {
    if (params == null || params.isEmpty()) {
      throw new SparkJobServerClientException("String_Node_Str");
    }
    if (params.containsKey(ISparkJobServerClientConstants.PARAM_APP_NAME) && params.containsKey(ISparkJobServerClientConstants.PARAM_CLASS_PATH)) {
      StringBuffer postUrlBuff=new StringBuffer(jobServerUrl);
      postUrlBuff.append("String_Node_Str");
      int num=params.size();
      for (      String key : params.keySet()) {
        postUrlBuff.append(key).append('=').append(params.get(key));
        num--;
        if (num > 0) {
          postUrlBuff.append('&');
        }
      }
      HttpPost postMethod=new HttpPost(postUrlBuff.toString());
      if (data != null) {
        StringEntity strEntity=new StringEntity(data);
        strEntity.setContentEncoding("String_Node_Str");
        strEntity.setContentType("String_Node_Str");
        postMethod.setEntity(strEntity);
      }
      HttpResponse response=httpClient.execute(postMethod);
      String resContent=getResponseContent(response.getEntity());
      return parseResult(resContent);
    }
 else {
      throw new SparkJobServerClientException("String_Node_Str");
    }
  }
 catch (  Exception e) {
    processException("String_Node_Str",e);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public SparkJobResult startJob(String data,Map<String,String> params) throws SparkJobServerClientException {
  try {
    if (params == null || params.isEmpty()) {
      throw new SparkJobServerClientException("String_Node_Str");
    }
    if (params.containsKey(ISparkJobServerClientConstants.PARAM_APP_NAME) && params.containsKey(ISparkJobServerClientConstants.PARAM_CLASS_PATH)) {
      StringBuffer postUrlBuff=new StringBuffer(jobServerUrl);
      postUrlBuff.append("String_Node_Str");
      int num=params.size();
      for (      String key : params.keySet()) {
        postUrlBuff.append(key).append('=').append(params.get(key));
        num--;
        if (num > 0) {
          postUrlBuff.append('&');
        }
      }
      HttpPost postMethod=new HttpPost(postUrlBuff.toString());
      if (data != null) {
        StringEntity strEntity=new StringEntity(data);
        strEntity.setContentEncoding("String_Node_Str");
        strEntity.setContentType("String_Node_Str");
        postMethod.setEntity(strEntity);
      }
      HttpResponse response=httpClient.execute(postMethod);
      String resContent=getResponseContent(response.getEntity());
      int statusCode=response.getStatusLine().getStatusCode();
      if (statusCode == HttpStatus.SC_OK) {
        return parseResult(resContent);
      }
 else {
        logError(statusCode,resContent,true);
      }
    }
 else {
      throw new SparkJobServerClientException("String_Node_Str");
    }
  }
 catch (  Exception e) {
    processException("String_Node_Str",e);
  }
  return null;
}
Program: 41369
Project: 41369
Buggy source:
/** 
 * {@inheritDoc}
 */
public SparkJobResult getJobResult(String jobId) throws SparkJobServerClientException {
  try {
    if (!isNotEmpty(jobId)) {
      throw new SparkJobServerClientException("String_Node_Str");
    }
    HttpGet getMethod=new HttpGet(jobServerUrl + "String_Node_Str" + jobId);
    HttpResponse response=httpClient.execute(getMethod);
    String resContent=getResponseContent(response.getEntity());
    return parseResult(resContent);
  }
 catch (  Exception e) {
    processException("String_Node_Str",e);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public SparkJobResult getJobResult(String jobId) throws SparkJobServerClientException {
  try {
    if (!isNotEmpty(jobId)) {
      throw new SparkJobServerClientException("String_Node_Str");
    }
    HttpGet getMethod=new HttpGet(jobServerUrl + "String_Node_Str" + jobId);
    HttpResponse response=httpClient.execute(getMethod);
    String resContent=getResponseContent(response.getEntity());
    int statusCode=response.getStatusLine().getStatusCode();
    if (statusCode == HttpStatus.SC_OK) {
      return parseResult(resContent);
    }
 else     if (statusCode == HttpStatus.SC_NOT_FOUND) {
      return new SparkJobResult(resContent);
    }
 else {
      logError(statusCode,resContent,true);
    }
  }
 catch (  Exception e) {
    processException("String_Node_Str",e);
  }
  return null;
}
Program: 41370
Project: 41370
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  mSwipeCardEntry=(TestSwipeCardEntry)findViewById(R.id.swipecardentry);
  mPayButton=(Button)findViewById(R.id.paybutton);
  mSwipeCardEntry.setListener(new TestSwipeCardEntry.Listener(){
    @Override public void onCardEntryCompleted(    boolean completed){
      mPayButton.setEnabled(completed);
    }
  }
);
}
Program: 41372
Project: 41372
Buggy source:
private CardType guessCardType(CharSequence cardType){
  for (  CardType type : CardType.values()) {
    if (type.guess(cardType)) {
      return type;
    }
  }
  return CardType.MASTERCARD;
}

Fixed version (ground truth):
private CardType guessCardType(CharSequence cardType){
  for (  CardType type : CardType.values()) {
    if (type.guess(cardType)) {
      return type;
    }
  }
  return CardType.UNKNOWN;
}
Program: 41373
Project: 41373
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  mSwipeCardEntry=(TestSwipeCardEntry)findViewById(R.id.swipecardentry);
  mPayButton=(Button)findViewById(R.id.paybutton);
  mSwipeCardEntry.setListener(new TestSwipeCardEntry.Listener(){
    @Override public void onCardEntryCompleted(    boolean completed){
      mPayButton.setEnabled(completed);
    }
  }
);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  mSwipeCardEntry=(TestSwipeCardEntry)findViewById(R.id.swipecardentry);
  mSwipeCardEntry.setNumber("String_Node_Str");
  mPayButton=(Button)findViewById(R.id.paybutton);
  mSwipeCardEntry.setListener(new TestSwipeCardEntry.Listener(){
    @Override public void onCardEntryCompleted(    boolean completed){
      mPayButton.setEnabled(completed);
    }
  }
);
}
Program: 41375
Project: 41375
Buggy source:
void CardType(String guess,String whole,int length,int resource,int cvvResource,int[] breaks,int cvcLength){
  mPartial=Pattern.compile(guess);
  mWhole=Pattern.compile(whole);
  mLength=length;
  mResource=resource;
  mCVCResource=cvvResource;
  mBreaks=breaks;
  mCVCLength=cvcLength;
}

Fixed version (ground truth):
void CardType(String guess,String whole,int length,int resource,int cvvResource,int[] breaks,String cvcHint){
  mPartial=Pattern.compile(guess);
  mWhole=Pattern.compile(whole);
  mLength=length;
  mResource=resource;
  mCVCResource=cvvResource;
  mBreaks=breaks;
  mCVCLength=cvcHint.length();
  mCVCHint=cvcHint;
}
Program: 41377
Project: 41377
Buggy source:
private void validateNumber(){
  if (mCardType.validateNumber(mNumber)) {
    mMode=Mode.EXPIRYMONTH;
    mAnimator.start();
  }
 else {
    mError=true;
  }
}

Fixed version (ground truth):
private void validateNumber(){
  if (mCardType.validateNumber(mNumber)) {
    mMode=Mode.EXPIRYMONTH;
    final int numberLength=mCardType.mLength;
    final int lastBreakIndex=mCardType.mBreaks[mCardType.mBreaks.length - 1];
    final int fourNumberTextWidth=(int)mTextPaint.measureText(mNumber,lastBreakIndex,numberLength);
    final int expiryTextWidth=(int)mTextPaint.measureText(EXPIRY_HINT);
    final int cvcTextWidth=(int)mTextPaint.measureText(mCardType.mCVCHint);
    final int formattedNumberWidth=(int)mTextPaint.measureText(mNumberFormatted,0,mNumberFormatted.length());
    final int paddingLeft=getPaddingLeft();
    final int imageEndPosition=paddingLeft + mBitmap.getWidth() + (2 * IMAGE_BUFFER_PADDING);
    final int twelveNumberTextWidth=formattedNumberWidth - fourNumberTextWidth;
    final int wholeWidth=(getMeasuredWidth() + twelveNumberTextWidth) - (paddingLeft + getPaddingRight());
    mCVCOffset=wholeWidth - cvcTextWidth;
    final int leftPosition=(imageEndPosition + formattedNumberWidth);
    mExpiryOffset=(((mCVCOffset - leftPosition) - expiryTextWidth) / 2) + leftPosition;
    mAnimator.setFloatValues(0.0f,0 - twelveNumberTextWidth);
    mAnimator.start();
  }
 else {
    mError=true;
  }
}
Program: 41378
Project: 41378
Buggy source:
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  int verticalPadding=getPaddingTop() + getPaddingBottom();
  int horizontalPadding=getPaddingLeft() + getPaddingRight();
  int textHeight=(int)(mTextPaint.descent() - mTextPaint.ascent());
  int imageHeight=mBitmap.getHeight();
  int height=Math.max(textHeight,imageHeight);
  mTextOffsetY=(height - textHeight) / 2;
  height+=verticalPadding;
  int minimumTextWidth=(int)mTextPaint.measureText(NUMBER_HINT);
  int width=mBitmap.getWidth() + (2 * IMAGE_BUFFER_PADDING) + minimumTextWidth+ horizontalPadding;
  setMeasuredDimension(resolveSizeAndState(width,widthMeasureSpec,0),resolveSizeAndState(height,heightMeasureSpec,0));
  int fourNumberTextWidth=(int)mTextPaint.measureText(NUMBER_HINT,0,4);
  int expiryTextWidth=(int)mTextPaint.measureText(EXPIRY_HINT);
  int cvcTextWidth=(int)mTextPaint.measureText(CVC_HINT);
  mCVCOffset=minimumTextWidth - cvcTextWidth;
  int expirySpace=minimumTextWidth - (cvcTextWidth + fourNumberTextWidth);
  expirySpace=(expirySpace - expiryTextWidth) / 2;
  mExpiryOffset=expirySpace + fourNumberTextWidth;
  int twelveNumberTextWidth=minimumTextWidth - fourNumberTextWidth;
  mCVCOffset+=minimumTextWidth + expirySpace + getPaddingLeft();
  mExpiryOffset+=minimumTextWidth + expirySpace + getPaddingLeft();
  mAnimator.setFloatValues(0.0f,0 - twelveNumberTextWidth);
}

Fixed version (ground truth):
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  int verticalPadding=getPaddingTop() + getPaddingBottom();
  int horizontalPadding=getPaddingLeft() + getPaddingRight();
  int textHeight=(int)(mTextPaint.descent() - mTextPaint.ascent());
  int imageHeight=mBitmap.getHeight();
  int height=Math.max(textHeight,imageHeight);
  mTextOffsetY=(height - textHeight) / 2;
  height+=verticalPadding;
  int minimumTextWidth=(int)mTextPaint.measureText(NUMBER_HINT);
  int width=mBitmap.getWidth() + (2 * IMAGE_BUFFER_PADDING) + minimumTextWidth+ horizontalPadding;
  setMeasuredDimension(resolveSizeAndState(width,widthMeasureSpec,0),resolveSizeAndState(height,heightMeasureSpec,0));
}
Program: 41379
Project: 41379
Buggy source:
/** 
 * Clears CVC, Expiry and Number fields and sets the number to the given parameter. If this is valid then we the state will move to expiry month to fill in the rest of the details.
 * @param number the number to fill in. (Not null)
 */
public void setNumber(String number){
  mNumber.clear();
  mMonth.clear();
  mYear.clear();
  mCVC.clear();
  mNumberFormatted.clear();
  mExpiryFormatted.clear();
  mCardType=CardType.UNKNOWN;
  mMode=Mode.NUMBER;
  mNumber.append(number);
  mNumberFormatted.append(number);
  if (mNumber.length() >= 2) {
    setCardType(guessCardType(mNumber));
  }
  for (int index=mCardType.mBreaks.length; --index >= 0; ) {
    int space=mCardType.mBreaks[index];
    if (mNumberFormatted.length() > space) {
      mNumberFormatted.insert(space,"String_Node_Str");
    }
  }
  if (mCardType.isCorrectLength(mNumber.length())) {
    validateNumber();
  }
  checkIsCompleted();
  postInvalidate();
}

Fixed version (ground truth):
/** 
 * Clears CVC, Expiry and Number fields and sets the number to the given parameter. If this is valid then we the state will move to expiry month to fill in the rest of the details.
 * @param number the number to fill in. (Not null)
 */
public void setNumber(String number){
  mNumber.clear();
  mMonth.clear();
  mYear.clear();
  mCVC.clear();
  mNumberFormatted.clear();
  mExpiryFormatted.clear();
  mCardType=CardType.UNKNOWN;
  mMode=Mode.NUMBER;
  mNumber.append(number);
  mNumberFormatted.append(number);
  if (mNumber.length() >= 2) {
    setCardType(guessCardType(mNumber.subSequence(0,2)));
  }
  for (int index=mCardType.mBreaks.length; --index >= 0; ) {
    int space=mCardType.mBreaks[index];
    if (mNumberFormatted.length() > space) {
      mNumberFormatted.insert(space,"String_Node_Str");
    }
  }
  if (mCardType.isCorrectLength(mNumber.length())) {
    validateNumber();
  }
  checkIsCompleted();
  postInvalidate();
}
Program: 41383
Project: 41383
Buggy source:
public boolean equals(Object obj){
  if (!(obj instanceof ArmorStandPose)) {
    return false;
  }
 else {
    ArmorStandPose pose=(ArmorStandPose)obj;
    return this.x == pose.x && this.y == pose.y && this.z == pose.z;
  }
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (!(obj instanceof ArmorStandPose)) {
    return false;
  }
 else {
    ArmorStandPose pose=(ArmorStandPose)obj;
    return this.x == pose.x && this.y == pose.y && this.z == pose.z;
  }
}
Program: 41384
Project: 41384
Buggy source:
@Override public GameProfile getProfile(String name){
  String playername=name.toLowerCase(Locale.ROOT);
  UserCacheEntry entry=stringToProfile.get(playername);
  if (entry != null && entry.isExpired()) {
    uuidToProfile.remove(playername);
    uuidToProfile.remove(entry.getProfile().getId());
    return null;
  }
  if (entry != null) {
    uuidToProfile.get(entry.getProfile().getId());
    return entry.getProfile();
  }
 else {
    GameProfile profile=lookupProfile(MinecraftServer.getServer(),playername);
    if (profile != null) {
      a(profile);
      return profile;
    }
    return null;
  }
}

Fixed version (ground truth):
@Override public GameProfile getProfile(String name){
  String playername=name.toLowerCase(Locale.ROOT);
  UserCacheEntry entry=stringToProfile.get(playername);
  if (entry != null && entry.isExpired()) {
    stringToProfile.remove(playername);
    uuidToProfile.remove(entry.getProfile().getId());
    return null;
  }
  if (entry != null) {
    uuidToProfile.get(entry.getProfile().getId());
    return entry.getProfile();
  }
 else {
    GameProfile profile=lookupProfile(MinecraftServer.getServer(),playername);
    if (profile != null) {
      a(profile);
      return profile;
    }
    return null;
  }
}
Program: 41386
Project: 41386
Buggy source:
@SuppressWarnings("String_Node_Str") public static <T extends Enum<?>>T addEnum(Class<T> enumType,String enumName,Class<?>[] paramTypes,Object[] paramValues){
  if (!Enum.class.isAssignableFrom(enumType)) {
    throw new RuntimeException("String_Node_Str" + enumType + "String_Node_Str");
  }
  Field valuesField=null;
  Field[] fields=enumType.getDeclaredFields();
  for (  Field field : fields) {
    if (field.getName().contains("String_Node_Str")) {
      valuesField=field;
      break;
    }
  }
  AccessibleObject.setAccessible(new Field[]{valuesField},true);
  try {
    T[] previousValues=(T[])valuesField.get(enumType);
    List<T> values=new ArrayList<T>(Arrays.asList(previousValues));
    T newValue=(T)makeEnum(enumType,enumName,values.size(),paramTypes,paramValues);
    values.add(newValue);
    setFailsafeFieldValue(valuesField,null,values.toArray((T[])Array.newInstance(enumType,0)));
    cleanEnumCache(enumType);
    return newValue;
  }
 catch (  Exception e) {
    e.printStackTrace(System.out);
    throw new RuntimeException(e.getMessage(),e);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static <T extends Enum<?>>T addEnum(Class<T> enumType,String enumName,Class<?>[] paramTypes,Object[] paramValues){
  if (!Enum.class.isAssignableFrom(enumType)) {
    throw new RuntimeException("String_Node_Str" + enumType + "String_Node_Str");
  }
  try {
    Field valuesField=enumType.getDeclaredField("String_Node_Str");
    valuesField.setAccessible(true);
    T[] previousValues=(T[])valuesField.get(enumType);
    List<T> values=new ArrayList<T>(Arrays.asList(previousValues));
    T newValue=(T)makeEnum(enumType,enumName,values.size(),paramTypes,paramValues);
    values.add(newValue);
    setField(valuesField,null,values.toArray((Enum[])Array.newInstance(enumType,0)));
    cleanEnumCache(enumType);
    return newValue;
  }
 catch (  Exception e) {
    e.printStackTrace();
    throw new RuntimeException(e.getMessage(),e);
  }
}
Program: 41387
Project: 41387
Buggy source:
private static void cleanEnumCache(Class<?> enumClass) throws NoSuchFieldException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
  blankField(enumClass,"String_Node_Str");
  blankField(enumClass,"String_Node_Str");
}

Fixed version (ground truth):
private static void cleanEnumCache(Class<?> enumClass) throws NoSuchFieldException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
  setField(Class.class.getDeclaredField("String_Node_Str"),enumClass,null);
}
Program: 41388
Project: 41388
Buggy source:
public static Object makeEnum(Class<?> enumClass,String value,int ordinal,Class<?>[] additionalTypes,Object[] additionalValues) throws Exception {
  Object[] parms=new Object[additionalValues.length + 2];
  parms[0]=value;
  parms[1]=ordinal;
  System.arraycopy(additionalValues,0,parms,2,additionalValues.length);
  return enumClass.cast(constructorAccesor.invoke(getConstructorAccessor(enumClass,additionalTypes),new Object[]{parms}));
}

Fixed version (ground truth):
public static Object makeEnum(Class<?> enumClass,String name,int ordinal,Class<?>[] paramTypes,Object[] paramValues) throws Exception {
  ArrayList<Class<?>> allParamTypes=new ArrayList<Class<?>>();
  allParamTypes.add(String.class);
  allParamTypes.add(Integer.TYPE);
  allParamTypes.addAll(Arrays.asList(paramTypes));
  ArrayList<Object> allParamValues=new ArrayList<Object>();
  allParamValues.add(name);
  allParamValues.add(Integer.valueOf(ordinal));
  allParamValues.addAll(Arrays.asList(paramValues));
  Constructor<?> enumConstructor=enumClass.getDeclaredConstructor((Class[])allParamTypes.toArray(new Class[0]));
  ConstructorAccessor constructorAccessor=ReflectionFactory.getReflectionFactory().newConstructorAccessor(enumConstructor);
  return constructorAccessor.newInstance(allParamValues.toArray(new Object[0]));
}
Program: 41389
Project: 41389
Buggy source:
@Override public void c(){
  System.out.println("String_Node_Str");
  ArrayList<UserCacheEntry> list=new ArrayList<UserCacheEntry>();
  int saved=0;
  for (  UserCacheEntry entry : uuidToProfile.values()) {
    if (saved > SpigotConfig.userCacheCap) {
      break;
    }
    list.add(entry);
    saved++;
  }
  System.out.println(list.size());
  String data=gson.toJson(list);
  BufferedWriter bufferedwriter=null;
  try {
    bufferedwriter=Files.newWriter(userCacheFile,Charsets.UTF_8);
    bufferedwriter.write(data);
  }
 catch (  FileNotFoundException filenotfoundexception) {
  }
catch (  IOException ioexception) {
  }
 finally {
    IOUtils.closeQuietly(bufferedwriter);
  }
}

Fixed version (ground truth):
@Override public void c(){
  ArrayList<UserCacheEntry> list=new ArrayList<UserCacheEntry>();
  int saved=0;
  for (  UserCacheEntry entry : uuidToProfile.values()) {
    if (saved > SpigotConfig.userCacheCap) {
      break;
    }
    list.add(entry);
    saved++;
  }
  String data=gson.toJson(list);
  BufferedWriter bufferedwriter=null;
  try {
    bufferedwriter=Files.newWriter(userCacheFile,Charsets.UTF_8);
    bufferedwriter.write(data);
  }
 catch (  FileNotFoundException filenotfoundexception) {
  }
catch (  IOException ioexception) {
  }
 finally {
    IOUtils.closeQuietly(bufferedwriter);
  }
}
Program: 41390
Project: 41390
Buggy source:
private Player getOnlinePlayer(String name){
  for (  Player p : Bukkit.getOnlinePlayers()) {
    if (p.getName() == name) {
      return p;
    }
  }
  return null;
}

Fixed version (ground truth):
private Player getOnlinePlayer(String name){
  for (  Player p : Bukkit.getOnlinePlayers()) {
    Bukkit.getLogger().log(Level.SEVERE,p.getName());
    if (p.getName().equalsIgnoreCase(name)) {
      return p;
    }
  }
  return null;
}
Program: 41391
Project: 41391
Buggy source:
public BlockDaylightDetector(boolean inverted){
  super();
  this.inverted=inverted;
  this.a(0.0F,0.0F,0.0F,1.0F,0.375F,1.0F);
  this.a(CreativeModeTab.d);
}

Fixed version (ground truth):
public BlockDaylightDetector(boolean inverted){
  super();
  this.inverted=inverted;
  this.a(0.0F,0.0F,0.0F,1.0F,0.375F,1.0F);
  c(0.2f);
  this.a(CreativeModeTab.d);
}
Program: 41393
Project: 41393
Buggy source:
@Override public void onLoad(){
  if (!Bukkit.getWorlds().isEmpty()) {
    log.log(Level.SEVERE,"String_Node_Str",new Object[]{pluginDescriptionFile.getName(),pluginDescriptionFile.getVersion(),pluginDescriptionFile.getName()});
    if (spigotConfig.getBoolean("String_Node_Str")) {
      getServer().dispatchCommand(Bukkit.getConsoleSender(),"String_Node_Str");
    }
    Bukkit.shutdown();
    return;
  }
  saveResource("String_Node_Str",true);
  saveResource("String_Node_Str",true);
  saveResource("String_Node_Str",true);
  saveResource("String_Node_Str",true);
  saveResource("String_Node_Str",true);
  saveResource("String_Node_Str",true);
  saveResource("String_Node_Str",true);
  try {
    DynamicEnumType.loadReflection();
    Utilities.instantiate(this);
    injector=new Injector(this);
    injector.registerAll();
    injector.registerRecipes();
    entityGenerator.injectNewCreatures();
    instrumentator=new Instrumentator(this,new File(getDataFolder(),"String_Node_Str").getPath());
    instrumentator.instrumentate();
  }
 catch (  Exception e) {
    e.printStackTrace();
    Bukkit.shutdown();
  }
  log.info("String_Node_Str");
}

Fixed version (ground truth):
@Override public void onLoad(){
  if (!Bukkit.getWorlds().isEmpty()) {
    log.log(Level.SEVERE,"String_Node_Str",new Object[]{pluginDescriptionFile.getName(),pluginDescriptionFile.getVersion(),pluginDescriptionFile.getName()});
    if (spigotConfig.getBoolean("String_Node_Str")) {
      getServer().dispatchCommand(Bukkit.getConsoleSender(),"String_Node_Str");
    }
    Bukkit.shutdown();
    return;
  }
  saveResource("String_Node_Str",true);
  saveResource("String_Node_Str",true);
  saveResource("String_Node_Str",true);
  saveResource("String_Node_Str",true);
  saveResource("String_Node_Str",true);
  saveResource("String_Node_Str",true);
  saveResource("String_Node_Str",true);
  try {
    DynamicEnumType.loadReflection();
    Utilities.instantiate(this);
    injector=new Injector(this);
    injector.registerAll();
    injector.registerRecipes();
    entityGenerator.injectNewCreatures();
    instrumentator=new Instrumentator(this,new File(getDataFolder(),"String_Node_Str").getPath());
    instrumentator.instrumentate();
  }
 catch (  Exception e) {
    e.printStackTrace();
    log.warning("String_Node_Str");
    Bukkit.shutdown();
  }
  log.info("String_Node_Str");
}
Program: 41395
Project: 41395
Buggy source:
public ItemMeta.Spigot spigot(){
  return this.spigot;
}

Fixed version (ground truth):
public Spigot spigot(){
  return this.spigot;
}
Program: 41396
Project: 41396
Buggy source:
public void setItemValues(ItemStack itemStack){
  this.patterns=null;
  if (itemStack.hasTag() && itemStack.getTag().hasKeyOfType("String_Node_Str",10)) {
    NBTTagCompound compound=itemStack.getTag().getCompound("String_Node_Str");
    if (compound.hasKey("String_Node_Str")) {
      this.patterns=(NBTTagList)compound.getList("String_Node_Str",10).clone();
    }
    if (compound.hasKeyOfType("String_Node_Str",99)) {
      this.baseColor=compound.getInt("String_Node_Str");
    }
 else {
      this.baseColor=itemStack.getData() & 15;
    }
  }
}

Fixed version (ground truth):
public void setItemValues(ItemStack itemStack){
  this.patterns=null;
  if (itemStack.hasTag() && itemStack.getTag().hasKeyOfType("String_Node_Str",10)) {
    NBTTagCompound compound=itemStack.getTag().getCompound("String_Node_Str");
    if (compound.hasKeyOfType("String_Node_Str",99)) {
      this.baseColor=compound.getInt("String_Node_Str");
    }
 else {
      this.baseColor=itemStack.getData() & 15;
    }
    if (compound.hasKey("String_Node_Str")) {
      this.patterns=(NBTTagList)compound.getList("String_Node_Str",10).clone();
    }
    NBTTagList lorepatterns=EnumBannerPatterns.fromLoreToNBT(itemStack);
    if (lorepatterns != null) {
      for (int i=0; i < lorepatterns.size(); i++) {
        patterns.add(lorepatterns.get(i));
      }
    }
  }
 else {
    this.baseColor=itemStack.getData() & 15;
  }
}
Program: 41397
Project: 41397
Buggy source:
@Override void applyToItem(NBTTagCompound tag){
  super.applyToItem(tag);
  tag.set("String_Node_Str",new NBTTagCompound());
  NBTTagCompound compound=tag.getCompound("String_Node_Str");
  compound.setInt("String_Node_Str",baseColor);
  NBTTagList patterns=new NBTTagList();
  for (  Entry<String,Integer> entry : patternsData.entrySet()) {
    NBTTagCompound pattern=new NBTTagCompound();
    pattern.setString("String_Node_Str",entry.getKey());
    pattern.setInt("String_Node_Str",entry.getValue());
    patterns.add(pattern);
  }
  if (patterns.size() != 0) {
    compound.set("String_Node_Str",patterns);
  }
}

Fixed version (ground truth):
@Override void applyToItem(NBTTagCompound tag){
  super.applyToItem(tag);
  tag.set("String_Node_Str",new NBTTagCompound());
  NBTTagCompound compound=tag.getCompound("String_Node_Str");
  if (baseColor != -1) {
    compound.setInt("String_Node_Str",baseColor);
  }
  NBTTagList patterns=new NBTTagList();
  for (  Entry<String,Integer> entry : patternsData.entrySet()) {
    NBTTagCompound pattern=new NBTTagCompound();
    pattern.setString("String_Node_Str",entry.getKey());
    pattern.setInt("String_Node_Str",entry.getValue());
    patterns.add(pattern);
  }
  if (patterns.size() != 0) {
    compound.set("String_Node_Str",patterns);
  }
}
Program: 41398
Project: 41398
Buggy source:
@Override public void onLoad(){
  if (!Bukkit.getWorlds().isEmpty()) {
    log.log(Level.SEVERE,"String_Node_Str",new Object[]{pluginDescriptionFile.getName(),pluginDescriptionFile.getVersion(),pluginDescriptionFile.getName()});
    if (spigot.getBoolean("String_Node_Str")) {
      getServer().dispatchCommand(Bukkit.getConsoleSender(),"String_Node_Str");
    }
    Bukkit.shutdown();
    return;
  }
  try {
    DynamicEnumType.loadReflection();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  injector=new Injector();
  injector.registerAll();
  injector.registerRecipes();
  worldGenerator.populate();
  log.info("String_Node_Str");
}

Fixed version (ground truth):
@Override public void onLoad(){
  if (!Bukkit.getWorlds().isEmpty()) {
    log.log(Level.SEVERE,"String_Node_Str",new Object[]{pluginDescriptionFile.getName(),pluginDescriptionFile.getVersion(),pluginDescriptionFile.getName()});
    if (spigot.getBoolean("String_Node_Str")) {
      getServer().dispatchCommand(Bukkit.getConsoleSender(),"String_Node_Str");
    }
    Bukkit.shutdown();
    return;
  }
  try {
    DynamicEnumType.loadReflection();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  injector=new Injector();
  injector.registerAll();
  injector.registerRecipes();
  log.info("String_Node_Str");
}
Program: 41399
Project: 41399
Buggy source:
@Override public void onEnable(){
  Utilities.instantiate(this);
  saveDefaultConfig();
  if (!this.getDataFolder().exists()) {
    this.getDataFolder().mkdirs();
  }
  reloadConfig();
  getServer().getPluginManager().registerEvents(blockListener,this);
  getServer().getPluginManager().registerEvents(commandListener,this);
  getServer().getPluginManager().registerEvents(itemListener,this);
  getServer().getPluginManager().registerEvents(worldGenerator,this);
  getServer().getPluginManager().registerEvents(worldBorderListener,this);
  protocolBlocker.loadConfig();
  getServer().getPluginManager().registerEvents(protocolBlocker,this);
  if (getConfig().getDouble("String_Node_Str",0.0f) < localConfigVersion) {
    log.warning("String_Node_Str");
  }
  if (getServer().getPluginManager().getPlugin("String_Node_Str") != null) {
    try {
      new ProtocolBlockListener(this).init();
      new ProtocolItemListener(this).init();
      new ProtocolEntityListener(this).init();
    }
 catch (    Throwable t) {
      t.printStackTrace();
    }
  }
 else {
    log.info("String_Node_Str");
  }
  try {
    Metrics metrics=new Metrics(this);
    metrics.start();
  }
 catch (  IOException e) {
  }
  log.info("String_Node_Str");
}

Fixed version (ground truth):
@Override public void onEnable(){
  Utilities.instantiate(this);
  saveDefaultConfig();
  if (!this.getDataFolder().exists()) {
    this.getDataFolder().mkdirs();
  }
  reloadConfig();
  getServer().getPluginManager().registerEvents(blockListener,this);
  getServer().getPluginManager().registerEvents(commandListener,this);
  getServer().getPluginManager().registerEvents(itemListener,this);
  getServer().getPluginManager().registerEvents(worldGenerator,this);
  getServer().getPluginManager().registerEvents(worldBorderListener,this);
  protocolBlocker.loadConfig();
  getServer().getPluginManager().registerEvents(protocolBlocker,this);
  worldGenerator.populate();
  if (getConfig().getDouble("String_Node_Str",0.0f) < localConfigVersion) {
    log.warning("String_Node_Str");
  }
  if (getServer().getPluginManager().getPlugin("String_Node_Str") != null) {
    try {
      new ProtocolBlockListener(this).init();
      new ProtocolItemListener(this).init();
      new ProtocolEntityListener(this).init();
    }
 catch (    Throwable t) {
      t.printStackTrace();
    }
  }
 else {
    log.info("String_Node_Str");
  }
  try {
    Metrics metrics=new Metrics(this);
    metrics.start();
  }
 catch (  IOException e) {
  }
  log.info("String_Node_Str");
}
Program: 41401
Project: 41401
Buggy source:
void scroll(Object contentViewCore,int yVel,int y){
  try {
    float density=mActivity.getResources().getDisplayMetrics().density + 1;
    XposedHelpers.findMethodExact(contentViewCore.getClass(),"String_Node_Str",long.class,int.class,int.class).invoke(contentViewCore,SystemClock.uptimeMillis(),0,(int)(yVel * density));
    return;
  }
 catch (  Throwable t) {
  }
  try {
    Integer x=(Integer)Utils.callMethod(contentViewCore,"String_Node_Str");
    ViewGroup containerView=(ViewGroup)Utils.callMethod(contentViewCore,"String_Node_Str");
    XposedHelpers.findMethodExact(containerView.getClass(),"String_Node_Str",int.class,int.class).invoke(containerView,x,y);
  }
 catch (  Throwable t) {
    XposedBridge.log(TAG + t);
  }
}

Fixed version (ground truth):
void scroll(Object contentViewCore,int yVel,int y){
  try {
    float density=mActivity.getResources().getDisplayMetrics().density + 1;
    Utils.callMethod(contentViewCore,"String_Node_Str",SystemClock.uptimeMillis(),0,(int)(yVel * density));
    return;
  }
 catch (  NoSuchMethodError nsme) {
  }
  try {
    Integer x=(Integer)Utils.callMethod(contentViewCore,"String_Node_Str");
    ViewGroup containerView=(ViewGroup)Utils.callMethod(contentViewCore,"String_Node_Str");
    Utils.callMethod(containerView,"String_Node_Str",x,y);
  }
 catch (  NoSuchMethodError nsme) {
    XposedBridge.log(TAG + nsme);
  }
}
Program: 41402
Project: 41402
Buggy source:
static Object callMethod(Object obj,String methodName,Object... args){
  try {
    return XposedHelpers.callMethod(obj,methodName,args);
  }
 catch (  NoSuchMethodError e) {
    throw e;
  }
catch (  NoClassDefFoundError e) {
    throw new NoSuchMethodError("String_Node_Str" + obj.getClass() + "String_Node_Str"+ methodName);
  }
}

Fixed version (ground truth):
static Object callMethod(Object obj,String methodName,Object... args){
  if (obj == null) {
    throw new NoSuchMethodError("String_Node_Str" + methodName);
  }
  try {
    return XposedHelpers.callMethod(obj,methodName,args);
  }
 catch (  NoSuchMethodError e) {
    throw e;
  }
catch (  NoClassDefFoundError e) {
    try {
      return manualMethodFind(obj.getClass(),methodName,args).invoke(obj,args);
    }
 catch (    Throwable t) {
      throw new NoSuchMethodError(t.getMessage());
    }
  }
}
Program: 41403
Project: 41403
Buggy source:
static Object callStaticMethod(Class<?> clazz,String methodName,Object... args){
  if (clazz == null) {
    throw new NoSuchMethodError("String_Node_Str" + methodName);
  }
  try {
    return XposedHelpers.callStaticMethod(clazz,methodName,args);
  }
 catch (  NoSuchMethodError e) {
    throw e;
  }
catch (  NoClassDefFoundError e) {
    throw new NoSuchMethodError("String_Node_Str" + clazz + "String_Node_Str"+ methodName);
  }
}

Fixed version (ground truth):
static Object callStaticMethod(Class<?> clazz,String methodName,Object... args){
  if (clazz == null) {
    throw new NoSuchMethodError("String_Node_Str" + methodName);
  }
  try {
    return XposedHelpers.callStaticMethod(clazz,methodName,args);
  }
 catch (  NoSuchMethodError e) {
    throw e;
  }
catch (  NoClassDefFoundError e) {
    try {
      return manualMethodFind(clazz,methodName,args).invoke(null,args);
    }
 catch (    Throwable t) {
      throw new NoSuchMethodError(t.getMessage());
    }
  }
}
Program: 41404
Project: 41404
Buggy source:
private String nameSpace(){
  String nameSpace=null;
  if (isOneToMany()) {
    nameSpace=field.getAnnotation(OneToMany.class).name();
  }
 else   if (isOneToOne()) {
    nameSpace=field.getAnnotation(OneToOne.class).name();
  }
  return nameSpace;
}

Fixed version (ground truth):
private String nameSpace(){
  String nameSpace=null;
  if (isOneToMany()) {
    nameSpace=field.getAnnotation(OneToMany.class).name().toLowerCase();
  }
 else   if (isOneToOne()) {
    nameSpace=field.getAnnotation(OneToOne.class).name().toLowerCase();
  }
  return nameSpace;
}
Program: 41405
Project: 41405
Buggy source:
/** 
 * Signals the server Fiber to stop accepting connections, and the connection fibers to stop processing new requests. Any existing requests will attempt to complete. This method should only be called after   {@link TFiberServer#serve()}.
 */
@Override @Suspendable public void stop(){
  serverFiber.interrupt();
}

Fixed version (ground truth):
/** 
 * Signals the server Fiber to stop accepting connections, and the connection fibers to stop processing new requests. Any existing requests will attempt to complete. This method should only be called after   {@link TFiberServer#serve()}.
 */
@Override @Suspendable public void stop(){
  stopped=true;
  serverFiber.interrupt();
}
Program: 41406
Project: 41406
Buggy source:
/** 
 * Uses idToken to retrieve the user account information from GITkit service.
 * @param idToken
 */
public JSONObject getAccountInfo(String idToken) throws GitkitClientException, GitkitServerException {
  try {
    JSONObject params=new JSONObject().put("String_Node_Str",idToken);
    return invokeGitkitApi("String_Node_Str",params,null);
  }
 catch (  JSONException e) {
    throw new GitkitServerException("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Uses idToken to retrieve the user account information from GITkit service.
 * @param idToken
 */
public JSONObject getAccountInfo(String idToken) throws GitkitClientException, GitkitServerException {
  try {
    JSONObject params=new JSONObject().put("String_Node_Str",idToken);
    return invokeGoogle2LegOauthApi("String_Node_Str",params);
  }
 catch (  JSONException e) {
    throw new GitkitServerException("String_Node_Str");
  }
}
Program: 41407
Project: 41407
Buggy source:
@Override protected void doStop(){
  fiber.execute(() -> {
    final AtomicInteger countDown=new AtomicInteger(1);
    GenericFutureListener<? extends Future<? super Void>> listener=future -> {
      if (countDown.decrementAndGet() == 0) {
        notifyStopped();
      }
    }
;
    if (listenChannel != null) {
      countDown.incrementAndGet();
      listenChannel.close().addListener(listener);
    }
    allChannels.close().addListener(listener);
    replicatorInstances.values().forEach(ReplicatorInstance::dispose);
    replicatorInstances.clear();
    fiber.dispose();
    fiber=null;
  }
);
}

Fixed version (ground truth):
@Override protected void doStop(){
  fiber.execute(() -> {
    final AtomicInteger countDown=new AtomicInteger(1);
    GenericFutureListener<? extends Future<? super Void>> listener=future -> {
      if (countDown.decrementAndGet() == 0) {
        fiber.dispose();
        fiber=null;
        notifyStopped();
      }
    }
;
    if (listenChannel != null) {
      countDown.incrementAndGet();
      listenChannel.close().addListener(listener);
    }
    allChannels.close().addListener(listener);
    replicatorInstances.values().forEach(ReplicatorInstance::dispose);
    replicatorInstances.clear();
  }
);
}
Program: 41408
Project: 41408
Buggy source:
public QuorumConfiguration getTransitionalConfiguration(Collection<Long> newPeerCollection){
}

Fixed version (ground truth):
public QuorumConfiguration getTransitionalConfiguration(Collection<Long> newPeerCollection){
  if (isTransitional) {
    return new QuorumConfiguration(prevPeers,newPeerCollection);
  }
 else {
    return new QuorumConfiguration(allPeers,newPeerCollection);
  }
}
Program: 41409
Project: 41409
Buggy source:
@Test public void aQuorumChangeCanCompleteEvenIfARemovedPeerTimesOutDuringIt() throws Exception {
  final Set<Long> newPeerIds=smallerPeerSetWithNoneInCommonWithInitialSet();
  final QuorumConfiguration transitionalConfig=QuorumConfiguration.of(initialPeerSet()).getTransitionalConfiguration(newPeerIds);
  final QuorumConfiguration finalConfig=transitionalConfig.getCompletedConfiguration();
  havingElectedALeaderAtOrAfter(term(1));
  final long firstLeaderTerm=currentTerm();
  final long leaderId=currentLeader();
  dropAllAppendsWithThisConfigurationUntilAPreElectionPollTakesPlace(finalConfig);
  leader().changeQuorum(newPeerIds);
  sim.createAndStartReplicators(newPeerIds);
  allPeersExceptLeader((peer) -> assertThat(leader(),willSend(anAppendRequest().containingQuorumConfig(transitionalConfig).to(peer.id))));
  peers(newPeerIds).forEach((peer) -> assertThat(peer,willCommitConfiguration(transitionalConfig)));
  peersBeingRemoved(transitionalConfig).forEach(PeerController::allowToTimeout);
  waitForAnElectionTimeout();
  peersBeingRemoved(transitionalConfig).forEach((peer) -> {
    if (peer.id != leaderId) {
      assertThat(peer,willSend(aPreElectionPoll()));
    }
  }
);
  waitForALeaderWithId(isIn(newPeerIds));
  peers(newPeerIds).forEach((peer) -> assertThat(peer,willCommitConfiguration(finalConfig)));
  peersBeingRemoved(transitionalConfig).forEach((peer) -> assertThat(peer,not(wonAnElectionWithTerm(greaterThan(firstLeaderTerm)))));
}

Fixed version (ground truth):
@Test public void aQuorumChangeCanCompleteEvenIfARemovedPeerTimesOutDuringIt() throws Exception {
  final Set<Long> newPeerIds=smallerPeerSetWithNoneInCommonWithInitialSet();
  final QuorumConfiguration transitionalConfig=QuorumConfiguration.of(initialPeerSet()).getTransitionalConfiguration(newPeerIds);
  final QuorumConfiguration finalConfig=transitionalConfig.getCompletedConfiguration();
  havingElectedALeaderAtOrAfter(term(1));
  final long firstLeaderTerm=currentTerm();
  final long leaderId=currentLeader();
  dropAllAppendsWithThisConfigurationUntilAPreElectionPollTakesPlace(finalConfig);
  leader().changeQuorum(newPeerIds);
  sim.createAndStartReplicators(newPeerIds);
  allPeersExceptLeader((peer) -> assertThat(leader(),willSend(anAppendRequest().containingQuorumConfig(transitionalConfig).to(peer.id))));
  peers(newPeerIds).forEach((peer) -> assertThat(peer,willCommitConfiguration(transitionalConfig)));
  peersBeingRemoved(transitionalConfig).forEach(PeerController::allowToTimeout);
  waitForAnElectionTimeout();
  peersBeingRemoved(transitionalConfig).forEach((peer) -> {
    if (peer.id != leaderId) {
      assertThat(peer,willSend(aPreElectionPoll()));
    }
  }
);
  waitForALeaderWithId(isIn(newPeerIds));
  leader().log(someData());
  peers(newPeerIds).forEach((peer) -> assertThat(peer,willCommitConfiguration(finalConfig)));
  peersBeingRemoved(transitionalConfig).forEach((peer) -> assertThat(peer,not(wonAnElectionWithTerm(greaterThan(firstLeaderTerm)))));
}
Program: 41410
Project: 41410
Buggy source:
@Test public void aSecondQuorumChangeWillOverrideTheFirst() throws Exception {
  final Set<Long> firstPeerSet=smallerPeerSetWithOneInCommonWithInitialSet();
  final Set<Long> secondPeerSet=largerPeerSetWithSomeInCommonWithInitialSet();
  havingElectedALeaderAtOrAfter(term(1));
  leader().changeQuorum(firstPeerSet);
  sim.createAndStartReplicators(firstPeerSet);
  leader().changeQuorum(secondPeerSet);
  sim.createAndStartReplicators(secondPeerSet);
  peers(secondPeerSet).forEach((peer) -> assertThat(peer,willCommitConfiguration(QuorumConfiguration.of(secondPeerSet))));
  waitForALeaderWithId(isIn(secondPeerSet));
}

Fixed version (ground truth):
@Test public void aSecondQuorumChangeWillOverrideTheFirst() throws Exception {
  final Set<Long> firstPeerSet=smallerPeerSetWithOneInCommonWithInitialSet();
  final Set<Long> secondPeerSet=largerPeerSetWithSomeInCommonWithInitialSet();
  havingElectedALeaderAtOrAfter(term(1));
  leader().changeQuorum(firstPeerSet);
  sim.createAndStartReplicators(firstPeerSet);
  leader().changeQuorum(secondPeerSet);
  sim.createAndStartReplicators(secondPeerSet);
  waitForALeaderWithId(isIn(secondPeerSet));
  leader().log(someData());
  peers(secondPeerSet).forEach((peer) -> assertThat(peer,willCommitConfiguration(QuorumConfiguration.of(secondPeerSet))));
}
Program: 41411
Project: 41411
Buggy source:
public boolean hasAny(Matcher<? super T> matcher){
  for (  T element : messageLog) {
    if (matcher.matches(element)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean hasAny(Matcher<? super T> matcher){
synchronized (messageLog) {
    for (    T element : messageLog) {
      if (matcher.matches(element)) {
        return true;
      }
    }
  }
  return false;
}
Program: 41412
Project: 41412
Buggy source:
private ListenableFuture<T> future(Matcher<? super T> matcher){
  SettableFuture<T> finished=SettableFuture.create();
  fiber.execute(() -> {
    for (    T element : messageLog) {
      if (matcher.matches(element)) {
        finished.set(element);
        return;
      }
    }
    waitingToMatch.put(matcher,finished);
  }
);
  return finished;
}

Fixed version (ground truth):
private ListenableFuture<T> future(Matcher<? super T> matcher){
  SettableFuture<T> finished=SettableFuture.create();
  fiber.execute(() -> {
synchronized (messageLog) {
      for (      T element : messageLog) {
        if (matcher.matches(element)) {
          finished.set(element);
          return;
        }
      }
    }
    waitingToMatch.put(matcher,finished);
  }
);
  return finished;
}
Program: 41413
Project: 41413
Buggy source:
private void calculateLastVisible(long majority,long lastIndexSent){
  if (lastIndexSent == lastCommittedIndex) {
    return;
  }
  HashMap<Long,Integer> bucket=new HashMap<>();
  for (  long lastAcked : peersLastAckedIndex.values()) {
    Integer p=bucket.get(lastAcked);
    if (p == null) {
      bucket.put(lastAcked,1);
    }
 else {
      bucket.put(lastAcked,p + 1);
    }
  }
  long mostAcked=0;
  for (  Map.Entry<Long,Integer> e : bucket.entrySet()) {
    if (e.getValue() >= majority) {
      if (mostAcked != 0) {
        LOG.warn("String_Node_Str",myId,mostAcked,e.getKey());
      }
      mostAcked=e.getKey();
    }
  }
  if (mostAcked == 0) {
    return;
  }
  if (myFirstIndexAsLeader == 0) {
    return;
  }
  if (mostAcked < myFirstIndexAsLeader) {
    LOG.warn("String_Node_Str",myId,mostAcked,myFirstIndexAsLeader);
    return;
  }
  if (mostAcked < lastCommittedIndex) {
    LOG.warn("String_Node_Str",myId,mostAcked,lastCommittedIndex);
    return;
  }
  if (mostAcked == lastCommittedIndex) {
    return;
  }
  setLastCommittedIndex(mostAcked);
  LOG.trace("String_Node_Str",myId,lastCommittedIndex);
}

Fixed version (ground truth):
@FiberOnly private void calculateLastVisible(int majority,long lastIndexSent){
  if (lastIndexSent == lastCommittedIndex) {
    return;
  }
  if (myFirstIndexAsLeader == 0) {
    return;
  }
  SortedMultiset<Long> committedIndexs=TreeMultiset.create(peersLastAckedIndex.values());
  committedIndexs.add(0L,peers.size() - peersLastAckedIndex.size());
  final long greatestIndexCommittedByMajority=Iterables.get(committedIndexs.descendingMultiset(),majority - 1);
  if (greatestIndexCommittedByMajority < myFirstIndexAsLeader) {
    LOG.warn("String_Node_Str",myId,greatestIndexCommittedByMajority,myFirstIndexAsLeader);
    return;
  }
  if (greatestIndexCommittedByMajority < lastCommittedIndex) {
    LOG.warn("String_Node_Str",myId,greatestIndexCommittedByMajority,lastCommittedIndex);
    return;
  }
  if (greatestIndexCommittedByMajority == lastCommittedIndex) {
    return;
  }
  setLastCommittedIndex(greatestIndexCommittedByMajority);
  LOG.trace("String_Node_Str",myId,lastCommittedIndex);
}
Program: 41414
Project: 41414
Buggy source:
@FiberOnly private void sendAppendEntries(long peer,long peerNextIdx,long lastIndexSent,long majority,final List<LogEntry> entries){
}

Fixed version (ground truth):
@FiberOnly private void sendAppendEntries(long peer,long peerNextIdx,long lastIndexSent,int majority,final List<LogEntry> entries){
}
Program: 41415
Project: 41415
Buggy source:
@Override public long currentTimeMillis(){
  return stopWatch.getTime() + offset;
}

Fixed version (ground truth):
@Override public synchronized long currentTimeMillis(){
  if (suspended) {
    return lastTimeMillis + offset;
  }
 else {
    return stopWatch.getTime() + offset;
  }
}
Program: 41416
Project: 41416
Buggy source:
@Override public ListenableFuture<Boolean> logEntries(List<LogEntry> entries){
  List<Log.OLogEntry> oLogEntries=new ArrayList<>();
  for (  LogEntry entry : entries) {
    long idx=getNextIdxGreaterThan(0);
    oLogEntries.add(Log.OLogEntry.newBuilder().setTombStone(false).setTerm(entry.getTerm()).setIndex(idx).setQuorumId(quorumId).setValue(ByteString.copyFrom(entry.getData())).build());
  }
  return this.log.logEntry(oLogEntries,quorumId);
}

Fixed version (ground truth):
@Override public ListenableFuture<Boolean> logEntries(List<LogEntry> entries){
  List<Log.OLogEntry> oLogEntries=new ArrayList<>();
  for (  LogEntry entry : entries) {
    long idx=getNextIdxGreaterThan(0);
    oLogEntries.add(Log.OLogEntry.newBuilder().setTombStone(false).setTerm(entry.getTerm()).setIndex(idx).setQuorumId(quorumId).setValue(ByteString.copyFrom(entry.getData())).build());
  }
  if (oLogEntries.size() > 0) {
    currentTerm=oLogEntries.get(oLogEntries.size() - 1).getTerm();
  }
  return this.log.logEntry(oLogEntries,quorumId);
}
Program: 41417
Project: 41417
Buggy source:
private void becomeLeader(){
  LOG.warn("String_Node_Str",myId,currentTerm);
  myState=State.LEADER;
  long myNextLog=log.getLastIndex() + 1;
  peersLastAckedIndex=new HashMap<>(peers.size());
  peersNextIndex=new HashMap<>(peers.size() - 1);
  for (  long peer : peers) {
    if (peer == myId)     continue;
    peersNextIndex.put(peer,myNextLog);
  }
  myFirstIndexAsLeader=0;
  lastCommittedIndex=0;
  stateChangeChannel.publish(new ReplicatorInstanceEvent(ReplicatorInstanceEvent.EventType.LEADER_ELECTED,this,myId,info.currentTimeMillis(),null));
  startQueueConsumer();
}

Fixed version (ground truth):
private void becomeLeader(){
  LOG.warn("String_Node_Str",myId,currentTerm);
  myState=State.LEADER;
  long myNextLog=log.getLastIndex() + 1;
  peersLastAckedIndex=new HashMap<>(peers.size());
  peersNextIndex=new HashMap<>(peers.size() - 1);
  for (  long peer : peers) {
    if (peer == myId)     continue;
    peersNextIndex.put(peer,myNextLog);
  }
  myFirstIndexAsLeader=0;
  stateChangeChannel.publish(new ReplicatorInstanceEvent(ReplicatorInstanceEvent.EventType.LEADER_ELECTED,this,myId,info.currentTimeMillis(),null));
  startQueueConsumer();
}