nus-yam/ex-repair huggingface dataset:
Program: 54162
Project: 54162
Buggy source:
protected void generateClass(PsiElementFactory factory,ClassEntity classEntity,PsiClass parentClass,IProcessor visitor){
  onStartGenerateClass(factory,classEntity,parentClass,visitor);
  PsiClass generateClass=null;
  if (classEntity.isGenerate()) {
    if (Config.getInstant().isSplitGenerate()) {
      try {
        generateClass=PsiClassUtil.getPsiClass(parentClass.getContainingFile(),parentClass.getProject(),classEntity.getQualifiedName());
      }
 catch (      Throwable throwable) {
        throwable.printStackTrace();
      }
    }
 else {
      String classContent="String_Node_Str" + classEntity.getClassName() + "String_Node_Str";
      generateClass=factory.createClassFromText(classContent,null).getInnerClasses()[0];
    }
    if (generateClass != null) {
      for (      FieldEntity fieldEntity : classEntity.getFields()) {
        generateField(factory,fieldEntity,generateClass,classEntity);
      }
      for (      ClassEntity innerClass : classEntity.getInnerClasss()) {
        generateClass(factory,innerClass,generateClass,visitor);
      }
      generateGetterAndSetter(factory,generateClass,classEntity);
      generateConvertMethod(factory,generateClass,classEntity);
      if (!Config.getInstant().isSplitGenerate()) {
        parentClass.add(generateClass);
      }
    }
  }
  onEndGenerateClass(factory,classEntity,parentClass,generateClass,visitor);
  if (Config.getInstant().isSplitGenerate()) {
    formatJavCode(generateClass);
  }
}

Fixed version (ground truth):
protected void generateClass(PsiElementFactory factory,ClassEntity classEntity,PsiClass parentClass,IProcessor visitor){
  onStartGenerateClass(factory,classEntity,parentClass,visitor);
  PsiClass generateClass=null;
  if (classEntity.isGenerate()) {
    if (Config.getInstant().isSplitGenerate()) {
      try {
        generateClass=PsiClassUtil.getPsiClass(parentClass.getContainingFile(),parentClass.getProject(),classEntity.getQualifiedName());
      }
 catch (      Throwable throwable) {
        throwable.printStackTrace();
      }
    }
 else {
      String classContent="String_Node_Str" + classEntity.getClassName() + "String_Node_Str";
      generateClass=factory.createClassFromText(classContent,null).getInnerClasses()[0];
    }
    if (generateClass != null) {
      for (      ClassEntity innerClass : classEntity.getInnerClasss()) {
        generateClass(factory,innerClass,generateClass,visitor);
      }
      if (!Config.getInstant().isSplitGenerate()) {
        generateClass=(PsiClass)parentClass.add(generateClass);
      }
      for (      FieldEntity fieldEntity : classEntity.getFields()) {
        generateField(factory,fieldEntity,generateClass,classEntity);
      }
      generateGetterAndSetter(factory,generateClass,classEntity);
      generateConvertMethod(factory,generateClass,classEntity);
    }
  }
  onEndGenerateClass(factory,classEntity,parentClass,generateClass,visitor);
  if (Config.getInstant().isSplitGenerate()) {
    formatJavCode(generateClass);
  }
}
Program: 54163
Project: 54163
Buggy source:
private void recursionInnerClass(ClassEntity classEntity){
  PsiClass[] innerClassArray=classEntity.getPsiClass().getAllInnerClasses();
  for (  PsiClass psiClass : innerClassArray) {
    ClassEntity item=new ClassEntity();
    item.setLock(true);
    declareClass.put(psiClass.getQualifiedName(),item);
    CheckUtil.getInstant().addDeclareClassName(psiClass.getQualifiedName());
    item.setClassName(psiClass.getName());
    item.addAllFields(collectDeclareFields(psiClass));
    item.setPsiClass(psiClass);
    item.setPackName(getPackName(psiClass));
    recursionInnerClass(item);
  }
}

Fixed version (ground truth):
private void recursionInnerClass(ClassEntity classEntity){
  PsiClass[] innerClassArray=classEntity.getPsiClass().getAllInnerClasses();
  for (  PsiClass psiClass : innerClassArray) {
    ClassEntity item=new ClassEntity();
    item.setLock(true);
    if (declareClass.containsKey(psiClass.getQualifiedName())) {
      return;
    }
    declareClass.put(psiClass.getQualifiedName(),item);
    CheckUtil.getInstant().addDeclareClassName(psiClass.getQualifiedName());
    item.setClassName(psiClass.getName());
    item.addAllFields(collectDeclareFields(psiClass));
    item.setPsiClass(psiClass);
    item.setPackName(getPackName(psiClass));
    recursionInnerClass(item);
  }
}
Program: 54164
Project: 54164
Buggy source:
@Override protected void run(){
  if (targetClass == null) {
    return;
  }
  generateClassList.clear();
  new ClassProcess(factory,cls).generate(targetClass,new IProcessor(){
    @Override public void onStarProcess(    ClassEntity classEntity,    PsiElementFactory factory,    PsiClass cls){
      generateClassList.add(cls.getQualifiedName());
    }
    @Override public void onEndProcess(    ClassEntity classEntity,    PsiElementFactory factory,    PsiClass cls){
    }
    @Override public void onStartGenerateClass(    PsiElementFactory factory,    ClassEntity classEntity,    PsiClass parentClass){
    }
    @Override public void onEndGenerateClass(    PsiElementFactory factory,    ClassEntity classEntity,    PsiClass parentClass,    PsiClass generateClass){
      generateClassList.add(generateClass.getQualifiedName());
    }
  }
);
}

Fixed version (ground truth):
@Override protected void run(){
  if (targetClass == null) {
    return;
  }
  generateClassList.clear();
  new ClassProcessor(factory,cls).generate(targetClass,new IProcessor(){
    @Override public void onStarProcess(    ClassEntity classEntity,    PsiElementFactory factory,    PsiClass cls){
      generateClassList.add(cls.getQualifiedName());
    }
    @Override public void onEndProcess(    ClassEntity classEntity,    PsiElementFactory factory,    PsiClass cls){
    }
    @Override public void onStartGenerateClass(    PsiElementFactory factory,    ClassEntity classEntity,    PsiClass parentClass){
    }
    @Override public void onEndGenerateClass(    PsiElementFactory factory,    ClassEntity classEntity,    PsiClass parentClass,    PsiClass generateClass){
      generateClassList.add(generateClass.getQualifiedName());
    }
  }
);
}
Program: 54165
Project: 54165
Buggy source:
public String handleArg(String arg){
  Pattern pattern=Pattern.compile("String_Node_Str");
  Matcher matcher=pattern.matcher(arg);
  if (matcher.find()) {
    return "String_Node_Str" + arg;
  }
 else {
    if (CheckUtil.getInstant().checkKeyWord(arg)) {
      return arg + "String_Node_Str";
    }
    return arg;
  }
}

Fixed version (ground truth):
public String handleArg(String arg){
  arg=arg.replaceAll("String_Node_Str","String_Node_Str");
  Matcher matcher=sPattern.matcher(arg);
  if (matcher.find()) {
    return Constant.DEFAULT_PREFIX + arg;
  }
 else {
    if (CheckUtil.getInstant().checkKeyWord(arg)) {
      return arg + "String_Node_Str";
    }
    return arg;
  }
}
Program: 54166
Project: 54166
Buggy source:
public void setClassName(String className){
  this.className=className;
}

Fixed version (ground truth):
public void setClassName(String className){
  this.className=CheckUtil.getInstant().handleArg(className);
}
Program: 54167
Project: 54167
Buggy source:
@Override public void generateField(PsiElementFactory factory,FieldEntity fieldEntity,PsiClass cls,ClassEntity classEntity){
  if (fieldEntity.isGenerate()) {
    StringBuilder fieldSb=new StringBuilder();
    String filedName=fieldEntity.getGenerateFieldName();
    if (!TextUtils.isEmpty(classEntity.getExtra())) {
      fieldSb.append(classEntity.getExtra()).append("String_Node_Str");
      classEntity.setExtra(null);
    }
    if (fieldEntity.getTargetClass() != null) {
      fieldEntity.getTargetClass().setGenerate(true);
    }
    fieldSb.append(String.format("String_Node_Str",fieldEntity.getFullNameType(),filedName));
    cls.add(factory.createMethodFromText(fieldSb.toString(),cls));
  }
}

Fixed version (ground truth):
@Override public void generateField(PsiElementFactory factory,FieldEntity fieldEntity,PsiClass cls,ClassEntity classEntity){
  if (fieldEntity.isGenerate()) {
    Try.run(new Try.TryListener(){
      @Override public void run(){
        cls.add(factory.createMethodFromText(generateFieldText(classEntity,fieldEntity,null),cls));
      }
      @Override public void runAgain(){
        fieldEntity.setFieldName(FieldHelper.generateLuckyFieldName(fieldEntity.getFieldName()));
        cls.add(factory.createMethodFromText(generateFieldText(classEntity,fieldEntity,Constant.FIXME),cls));
      }
      @Override public void error(){
        cls.addBefore(factory.createCommentFromText("String_Node_Str" + fieldEntity.getFieldName(),cls),cls.getChildren()[0]);
      }
    }
);
  }
}
Program: 54168
Project: 54168
Buggy source:
private void injectAutoAnnotation(PsiElementFactory factory,PsiClass cls){
  PsiModifierList modifierList=cls.getModifierList();
  PsiElement firstChild=modifierList.getFirstChild();
  Pattern pattern=Pattern.compile("String_Node_Str");
  if (firstChild != null && !pattern.matcher(firstChild.getText()).find()) {
    PsiAnnotation annotationFromText=factory.createAnnotationFromText("String_Node_Str",cls);
    modifierList.addBefore(annotationFromText,firstChild);
  }
  if (!modifierList.hasModifierProperty(PsiModifier.ABSTRACT)) {
    modifierList.setModifierProperty(PsiModifier.ABSTRACT,true);
  }
}

Fixed version (ground truth):
private void injectAutoAnnotation(PsiElementFactory factory,PsiClass cls){
  PsiModifierList modifierList=cls.getModifierList();
  if (modifierList != null) {
    PsiElement firstChild=modifierList.getFirstChild();
    Pattern pattern=Pattern.compile("String_Node_Str");
    if (firstChild != null && !pattern.matcher(firstChild.getText()).find()) {
      PsiAnnotation annotationFromText=factory.createAnnotationFromText("String_Node_Str",cls);
      modifierList.addBefore(annotationFromText,firstChild);
    }
    if (!modifierList.hasModifierProperty(PsiModifier.ABSTRACT)) {
      modifierList.setModifierProperty(PsiModifier.ABSTRACT,true);
    }
  }
}
Program: 54170
Project: 54170
Buggy source:
public void generateFiled(PsiElementFactory mFactory,PsiClass mClass,InnerClassEntity classEntity){
  if (generate) {
    StringBuilder filedSb=new StringBuilder();
    String filedName=getGenerateFieldName();
    if (!TextUtils.isEmpty(classEntity.getExtra())) {
      filedSb.append(classEntity.getExtra()).append("String_Node_Str");
      classEntity.setExtra(null);
    }
    if (!filedName.equals(getKey()) || Config.getInstant().isUseSerializedName()) {
      filedSb.append(Config.getInstant().geFullNameAnnotation().replaceAll("String_Node_Str",getKey()));
    }
    if (Config.getInstant().isFieldPrivateMode()) {
      filedSb.append("String_Node_Str").append(getGenerType()).append("String_Node_Str").append(filedName).append("String_Node_Str");
    }
 else {
      filedSb.append("String_Node_Str").append(getGenerType()).append("String_Node_Str").append(filedName).append("String_Node_Str");
    }
    mClass.add(mFactory.createFieldFromText(filedSb.toString(),mClass));
  }
}

Fixed version (ground truth):
public void generateFiled(PsiElementFactory mFactory,PsiClass mClass,InnerClassEntity classEntity){
  if (generate) {
    StringBuilder filedSb=new StringBuilder();
    String filedName=getGenerateFieldName();
    if (!TextUtils.isEmpty(classEntity.getExtra())) {
      filedSb.append(classEntity.getExtra()).append("String_Node_Str");
      classEntity.setExtra(null);
    }
    if (!filedName.equals(getKey()) || Config.getInstant().isUseSerializedName()) {
      filedSb.append(Config.getInstant().geFullNameAnnotation().replaceAll("String_Node_Str",getKey()));
    }
    if (Config.getInstant().isFieldPrivateMode()) {
      filedSb.append("String_Node_Str").append(getFullNameType()).append("String_Node_Str").append(filedName).append("String_Node_Str");
    }
 else {
      filedSb.append("String_Node_Str").append(getFullNameType()).append("String_Node_Str").append(filedName).append("String_Node_Str");
    }
    mClass.add(mFactory.createFieldFromText(filedSb.toString(),mClass));
  }
}
Program: 54171
Project: 54171
Buggy source:
@Override public View getViewForTab(int position,View convertView,ViewGroup container){
  if (convertView == null) {
    convertView=(TextView)inflater.inflate(R.layout.tab_main,container,false);
  }
  TextView textView=(TextView)convertView;
  textView.setText(tabNames[position]);
  textView.setCompoundDrawablesWithIntrinsicBounds(0,tabIcons[position],0,0);
  return textView;
}

Fixed version (ground truth):
@Override public View getViewForTab(int position,View convertView,ViewGroup container){
  if (convertView == null) {
    convertView=inflater.inflate(R.layout.tab_main,container,false);
  }
  TextView textView=(TextView)convertView;
  textView.setText(tabNames[position]);
  textView.setCompoundDrawablesWithIntrinsicBounds(0,tabIcons[position],0,0);
  return textView;
}
Program: 54172
Project: 54172
Buggy source:
private View getItemOutView(int position){
  int count=getChildCount();
  Log.d("String_Node_Str","String_Node_Str" + position + "String_Node_Str"+ count);
  if (centerView != null && position >= (count / 2)) {
    position++;
    Log.d("String_Node_Str","String_Node_Str" + position + "String_Node_Str"+ count+ "String_Node_Str"+ (count / 2));
  }
  return getChildAt(position);
}

Fixed version (ground truth):
private View getItemOutView(int position){
  if (centerView != null && position >= (getChildCount() - 1) / 2) {
    position++;
  }
  return getChildAt(position);
}
Program: 54173
Project: 54173
Buggy source:
private void measureTabs(){
  int count=getRealChildCount();
switch (splitMethod) {
case SPLITMETHOD_EQUALS:
    for (int i=0; i < count; i++) {
      View view=getItemOutView(i);
      LayoutParams layoutParams=(LayoutParams)view.getLayoutParams();
      layoutParams.width=0;
      layoutParams.weight=1;
      view.setLayoutParams(layoutParams);
    }
  break;
case SPLITMETHOD_WRAP:
for (int i=0; i < count; i++) {
  View view=getItemOutView(i);
  LayoutParams layoutParams=(LayoutParams)view.getLayoutParams();
  layoutParams.width=LayoutParams.WRAP_CONTENT;
  layoutParams.weight=0;
  view.setLayoutParams(layoutParams);
}
break;
case SPLITMETHOD_WEIGHT:
for (int i=0; i < count; i++) {
View view=getItemOutView(i);
LayoutParams layoutParams=(LayoutParams)view.getLayoutParams();
layoutParams.width=LayoutParams.WRAP_CONTENT;
layoutParams.weight=1;
view.setLayoutParams(layoutParams);
}
break;
}
}

Fixed version (ground truth):
private void measureTabs(){
  int count=getTabCountInLayout();
switch (splitMethod) {
case SPLITMETHOD_EQUALS:
    for (int i=0; i < count; i++) {
      View view=getItemOutView(i);
      LayoutParams layoutParams=(LayoutParams)view.getLayoutParams();
      layoutParams.width=0;
      layoutParams.weight=1;
      view.setLayoutParams(layoutParams);
    }
  break;
case SPLITMETHOD_WRAP:
for (int i=0; i < count; i++) {
  View view=getItemOutView(i);
  LayoutParams layoutParams=(LayoutParams)view.getLayoutParams();
  layoutParams.width=LayoutParams.WRAP_CONTENT;
  layoutParams.weight=0;
  view.setLayoutParams(layoutParams);
}
break;
case SPLITMETHOD_WEIGHT:
for (int i=0; i < count; i++) {
View view=getItemOutView(i);
LayoutParams layoutParams=(LayoutParams)view.getLayoutParams();
layoutParams.width=LayoutParams.WRAP_CONTENT;
layoutParams.weight=1;
view.setLayoutParams(layoutParams);
}
break;
}
}
Program: 54174
Project: 54174
Buggy source:
@Override public void onChange(){
  if (!inRun.isFinished()) {
    inRun.stop();
  }
  int count=getRealChildCount();
  int newCount=mAdapter.getCount();
  views.clear();
  for (int i=0; i < count && i < newCount; i++) {
    views.add((ViewGroup)getItemOutView(i));
  }
  removeAllViews();
  int size=views.size();
  for (int i=0; i < newCount; i++) {
    LinearLayout result=new LinearLayout(getContext());
    View view;
    if (i < size) {
      View temp=views.get(i).getChildAt(0);
      views.get(i).removeView(temp);
      view=mAdapter.getView(i,temp,result);
    }
 else {
      view=mAdapter.getView(i,null,result);
    }
    if (onTransitionListener != null) {
      onTransitionListener.onTransition(view,i,i == mSelectedTabIndex ? 1 : 0);
    }
    result.addView(view);
    result.setOnClickListener(onClickListener);
    result.setTag(i);
    addView(result,new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.MATCH_PARENT));
  }
  if (centerView != null) {
    setCenterView(centerView,centerViewLayoutParams);
  }
  mPreSelectedTabIndex=-1;
  setCurrentItem(mSelectedTabIndex,false);
  measureTabs();
}

Fixed version (ground truth):
@Override public void onChange(){
  if (!inRun.isFinished()) {
    inRun.stop();
  }
  int count=getTabCountInLayout();
  int newCount=mAdapter.getCount();
  views.clear();
  for (int i=0; i < count && i < newCount; i++) {
    views.add((ViewGroup)getItemOutView(i));
  }
  removeAllViews();
  int size=views.size();
  for (int i=0; i < newCount; i++) {
    LinearLayout result=new LinearLayout(getContext());
    View view;
    if (i < size) {
      View temp=views.get(i).getChildAt(0);
      views.get(i).removeView(temp);
      view=mAdapter.getView(i,temp,result);
    }
 else {
      view=mAdapter.getView(i,null,result);
    }
    if (onTransitionListener != null) {
      onTransitionListener.onTransition(view,i,i == mSelectedTabIndex ? 1 : 0);
    }
    result.addView(view);
    result.setOnClickListener(onClickListener);
    result.setTag(i);
    addView(result,new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.MATCH_PARENT));
  }
  if (centerView != null) {
    setCenterView(centerView,centerViewLayoutParams);
  }
  mPreSelectedTabIndex=-1;
  setCurrentItem(mSelectedTabIndex,false);
  measureTabs();
}
Program: 54175
Project: 54175
Buggy source:
@Override public void setCurrentItem(int item,boolean anim){
  int count=getCount();
  if (count == 0) {
    return;
  }
  if (item < 0) {
    item=0;
  }
 else   if (item > count - 1) {
    item=count - 1;
  }
  if (mSelectedTabIndex != item) {
    mPreSelectedTabIndex=mSelectedTabIndex;
    mSelectedTabIndex=item;
    if (!inRun.isFinished()) {
      inRun.stop();
    }
    if (state == ViewPager.SCROLL_STATE_IDLE) {
      updateTabSelectState(item);
      if (anim && getWidth() != 0 && mPreSelectedTabIndex >= 0 && mPreSelectedTabIndex < getRealChildCount()) {
        int sx=getItemOutView(mPreSelectedTabIndex).getLeft();
        int ex=getItemOutView(item).getLeft();
        final float pageDelta=(float)Math.abs(ex - sx) / (getItemOutView(item).getWidth());
        int duration=(int)((pageDelta + 1) * 100);
        duration=Math.min(duration,600);
        inRun.startScroll(sx,ex,duration);
      }
 else {
        notifyPageScrolled(item,0,0);
      }
    }
 else {
      if (onTransitionListener == null) {
        updateTabSelectState(item);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void setCurrentItem(int item,boolean anim){
  int count=getCount();
  if (count == 0) {
    return;
  }
  if (item < 0) {
    item=0;
  }
 else   if (item > count - 1) {
    item=count - 1;
  }
  if (mSelectedTabIndex != item) {
    mPreSelectedTabIndex=mSelectedTabIndex;
    mSelectedTabIndex=item;
    if (!inRun.isFinished()) {
      inRun.stop();
    }
    if (state == ViewPager.SCROLL_STATE_IDLE) {
      updateTabSelectState(item);
      if (anim && getWidth() != 0 && mPreSelectedTabIndex >= 0 && mPreSelectedTabIndex < getTabCountInLayout()) {
        int sx=getItemOutView(mPreSelectedTabIndex).getLeft();
        int ex=getItemOutView(item).getLeft();
        final float pageDelta=(float)Math.abs(ex - sx) / (getItemOutView(item).getWidth());
        int duration=(int)((pageDelta + 1) * 100);
        duration=Math.min(duration,600);
        inRun.startScroll(sx,ex,duration);
      }
 else {
        notifyPageScrolled(item,0,0);
      }
    }
 else {
      if (onTransitionListener == null) {
        updateTabSelectState(item);
      }
    }
  }
}
Program: 54179
Project: 54179
Buggy source:
private void doNotify(Jedis jedis,String key){
  for (  Map.Entry<Node,Set<NotifyListener>> entry : new HashMap<Node,Set<NotifyListener>>(getSubscribed()).entrySet()) {
    doNotify(jedis,Collections.singletonList(key),new HashSet<NotifyListener>(entry.getValue()));
  }
}

Fixed version (ground truth):
private void doNotify(Jedis jedis,String key){
  for (  Map.Entry<Node,Set<NotifyListener>> entry : new HashMap<Node,Set<NotifyListener>>(getSubscribed()).entrySet()) {
    doNotify(jedis,Collections.singletonList(key),new HashSet<NotifyListener>(entry.getValue()),false);
  }
}
Program: 54180
Project: 54180
Buggy source:
@Override protected void doSubscribe(Node node,NotifyListener listener){
  List<NodeType> listenNodeTypes=node.getListenNodeTypes();
  if (CollectionUtils.isEmpty(listenNodeTypes)) {
    return;
  }
  for (  NodeType listenNodeType : listenNodeTypes) {
    String listenNodePath=NodeRegistryUtils.getNodeTypePath(clusterName,listenNodeType);
    Notifier notifier=notifiers.get(listenNodePath);
    if (notifier == null) {
      Notifier newNotifier=new Notifier(listenNodePath);
      notifiers.putIfAbsent(listenNodePath,newNotifier);
      notifier=notifiers.get(listenNodePath);
      if (notifier == newNotifier) {
        notifier.start();
      }
    }
    boolean success=false;
    NodeRegistryException exception=null;
    for (    Map.Entry<String,JedisPool> entry : jedisPools.entrySet()) {
      JedisPool jedisPool=entry.getValue();
      try {
        Jedis jedis=jedisPool.getResource();
        try {
          doNotify(jedis,Collections.singletonList(listenNodePath),Collections.singletonList(listener));
          success=true;
          break;
        }
  finally {
          jedis.close();
        }
      }
 catch (      Throwable t) {
        exception=new NodeRegistryException("String_Node_Str" + entry.getKey() + "String_Node_Str"+ node+ "String_Node_Str"+ t.getMessage(),t);
      }
    }
    if (exception != null) {
      if (success) {
        LOGGER.warn(exception.getMessage(),exception);
      }
 else {
        throw exception;
      }
    }
  }
}

Fixed version (ground truth):
@Override protected void doSubscribe(Node node,NotifyListener listener){
  List<NodeType> listenNodeTypes=node.getListenNodeTypes();
  if (CollectionUtils.isEmpty(listenNodeTypes)) {
    return;
  }
  for (  NodeType listenNodeType : listenNodeTypes) {
    String listenNodePath=NodeRegistryUtils.getNodeTypePath(clusterName,listenNodeType);
    Notifier notifier=notifiers.get(listenNodePath);
    if (notifier == null) {
      Notifier newNotifier=new Notifier(listenNodePath);
      notifiers.putIfAbsent(listenNodePath,newNotifier);
      notifier=notifiers.get(listenNodePath);
      if (notifier == newNotifier) {
        notifier.start();
      }
    }
    boolean success=false;
    NodeRegistryException exception=null;
    for (    Map.Entry<String,JedisPool> entry : jedisPools.entrySet()) {
      JedisPool jedisPool=entry.getValue();
      try {
        Jedis jedis=jedisPool.getResource();
        try {
          doNotify(jedis,Collections.singletonList(listenNodePath),Collections.singletonList(listener),true);
          success=true;
          break;
        }
  finally {
          jedis.close();
        }
      }
 catch (      Throwable t) {
        exception=new NodeRegistryException("String_Node_Str" + entry.getKey() + "String_Node_Str"+ node+ "String_Node_Str"+ t.getMessage(),t);
      }
    }
    if (exception != null) {
      if (success) {
        LOGGER.warn(exception.getMessage(),exception);
      }
 else {
        throw exception;
      }
    }
  }
}
Program: 54181
Project: 54181
Buggy source:
private void doNotify(Jedis jedis,String key){
  for (  Map.Entry<Node,Set<NotifyListener>> entry : new HashMap<Node,Set<NotifyListener>>(getSubscribed()).entrySet()) {
    doNotify(jedis,Collections.singletonList(key),new HashSet<NotifyListener>(entry.getValue()));
  }
}

Fixed version (ground truth):
private void doNotify(Jedis jedis,String key){
  for (  Map.Entry<Node,Set<NotifyListener>> entry : new HashMap<Node,Set<NotifyListener>>(getSubscribed()).entrySet()) {
    doNotify(jedis,Collections.singletonList(key),new HashSet<NotifyListener>(entry.getValue()),false);
  }
}
Program: 54182
Project: 54182
Buggy source:
@Override protected void doSubscribe(Node node,NotifyListener listener){
  List<NodeType> listenNodeTypes=node.getListenNodeTypes();
  if (CollectionUtils.isEmpty(listenNodeTypes)) {
    return;
  }
  for (  NodeType listenNodeType : listenNodeTypes) {
    String listenNodePath=NodeRegistryUtils.getNodeTypePath(clusterName,listenNodeType);
    Notifier notifier=notifiers.get(listenNodePath);
    if (notifier == null) {
      Notifier newNotifier=new Notifier(listenNodePath);
      notifiers.putIfAbsent(listenNodePath,newNotifier);
      notifier=notifiers.get(listenNodePath);
      if (notifier == newNotifier) {
        notifier.start();
      }
    }
    boolean success=false;
    NodeRegistryException exception=null;
    for (    Map.Entry<String,JedisPool> entry : jedisPools.entrySet()) {
      JedisPool jedisPool=entry.getValue();
      try {
        Jedis jedis=jedisPool.getResource();
        try {
          doNotify(jedis,Collections.singletonList(listenNodePath),Collections.singletonList(listener));
          success=true;
          break;
        }
  finally {
          jedis.close();
        }
      }
 catch (      Throwable t) {
        exception=new NodeRegistryException("String_Node_Str" + entry.getKey() + "String_Node_Str"+ node+ "String_Node_Str"+ t.getMessage(),t);
      }
    }
    if (exception != null) {
      if (success) {
        LOGGER.warn(exception.getMessage(),exception);
      }
 else {
        throw exception;
      }
    }
  }
}

Fixed version (ground truth):
@Override protected void doSubscribe(Node node,NotifyListener listener){
  List<NodeType> listenNodeTypes=node.getListenNodeTypes();
  if (CollectionUtils.isEmpty(listenNodeTypes)) {
    return;
  }
  for (  NodeType listenNodeType : listenNodeTypes) {
    String listenNodePath=NodeRegistryUtils.getNodeTypePath(clusterName,listenNodeType);
    Notifier notifier=notifiers.get(listenNodePath);
    if (notifier == null) {
      Notifier newNotifier=new Notifier(listenNodePath);
      notifiers.putIfAbsent(listenNodePath,newNotifier);
      notifier=notifiers.get(listenNodePath);
      if (notifier == newNotifier) {
        notifier.start();
      }
    }
    boolean success=false;
    NodeRegistryException exception=null;
    for (    Map.Entry<String,JedisPool> entry : jedisPools.entrySet()) {
      JedisPool jedisPool=entry.getValue();
      try {
        Jedis jedis=jedisPool.getResource();
        try {
          doNotify(jedis,Collections.singletonList(listenNodePath),Collections.singletonList(listener),true);
          success=true;
          break;
        }
  finally {
          jedis.close();
        }
      }
 catch (      Throwable t) {
        exception=new NodeRegistryException("String_Node_Str" + entry.getKey() + "String_Node_Str"+ node+ "String_Node_Str"+ t.getMessage(),t);
      }
    }
    if (exception != null) {
      if (success) {
        LOGGER.warn(exception.getMessage(),exception);
      }
 else {
        throw exception;
      }
    }
  }
}
Program: 54184
Project: 54184
Buggy source:
/** 
 * 生成BeanCopier的实现类源码
 */
private static String getClassCode(Integer sequence,Class<?> sourceClass,Class<?> targetClass,boolean deepCopy,final Map<String,PropConverter<?,?>> propCvtMap) throws Exception {
  JavaSourceBean javaSourceBean=new JavaSourceBean();
  javaSourceBean.setPackageName(BeanCopierFactory.class.getPackage().getName());
  javaSourceBean.addImport(BeanCopierAdapter.class.getName());
  javaSourceBean.addImport(sourceClass.getName());
  javaSourceBean.addImport(targetClass.getName());
  javaSourceBean.addImport(PropConverter.class.getName());
  String beanCopierClassName=sourceClass.getSimpleName() + "String_Node_Str" + targetClass.getSimpleName()+ BeanCopier.class.getSimpleName()+ sequence;
  String classDefinitionCode="String_Node_Str" + beanCopierClassName + "String_Node_Str"+ BeanCopierAdapter.class.getSimpleName();
  javaSourceBean.setClassDefinition(classDefinitionCode);
  javaSourceBean.addMethod(getMethodImplCode(sequence,sourceClass,targetClass,deepCopy,propCvtMap));
  if (LOGGER.isDebugEnabled()) {
    LOGGER.debug(javaSourceBean.toString());
  }
  return javaSourceBean.toString();
}

Fixed version (ground truth):
/** 
 * 生成BeanCopier的实现类源码
 */
private static String getClassCode(Integer sequence,Class<?> sourceClass,Class<?> targetClass,boolean deepCopy,final Map<String,PropConverter<?,?>> propCvtMap) throws Exception {
  JavaSourceBean javaSourceBean=new JavaSourceBean();
  javaSourceBean.setPackageName(BeanCopierFactory.class.getPackage().getName());
  javaSourceBean.addImport(BeanCopierAdapter.class.getName());
  javaSourceBean.addImport(sourceClass.getName());
  javaSourceBean.addImport(targetClass.getName());
  javaSourceBean.addImport(PropConverter.class.getName());
  String beanCopierClassName=sourceClass.getSimpleName() + "String_Node_Str" + targetClass.getSimpleName()+ BeanCopier.class.getSimpleName()+ sequence;
  String classDefinitionCode="String_Node_Str" + beanCopierClassName + "String_Node_Str"+ BeanCopierAdapter.class.getName();
  javaSourceBean.setClassDefinition(classDefinitionCode);
  javaSourceBean.addMethod(getMethodImplCode(sequence,sourceClass,targetClass,deepCopy,propCvtMap));
  if (LOGGER.isDebugEnabled()) {
    LOGGER.debug(javaSourceBean.toString());
  }
  return javaSourceBean.toString();
}
Program: 54185
Project: 54185
Buggy source:
private List<JobPo> fetchJob(String taskTrackerNodeGroup,String taskTrackerIdentity,int size){
  List<JobPo> jobPos=new ArrayList<JobPo>(size);
  for (int i=0; i < size; i++) {
    final JobPo jobPo=appContext.getPreLoader().take(taskTrackerNodeGroup,taskTrackerIdentity);
    if (jobPo == null) {
      if (LOGGER.isDebugEnabled()) {
        LOGGER.debug("String_Node_Str" + taskTrackerNodeGroup + "String_Node_Str"+ taskTrackerIdentity);
      }
      break;
    }
    try {
      jobPo.setGmtModified(SystemClock.now());
      appContext.getExecutingJobQueue().add(jobPo);
    }
 catch (    DupEntryException e) {
      LOGGER.warn("String_Node_Str" + JSON.toJSONString(jobPo));
      appContext.getExecutableJobQueue().resume(jobPo);
      continue;
    }
    appContext.getExecutableJobQueue().remove(jobPo.getTaskTrackerNodeGroup(),jobPo.getJobId());
    jobPos.add(jobPo);
  }
  return jobPos;
}

Fixed version (ground truth):
private List<JobPo> fetchJob(String taskTrackerNodeGroup,String taskTrackerIdentity,int size){
  List<JobPo> jobPos=new ArrayList<JobPo>(size);
  for (int i=0; i < size; i++) {
    final JobPo jobPo=appContext.getPreLoader().take(taskTrackerNodeGroup,taskTrackerIdentity);
    if (jobPo == null) {
      if (LOGGER.isDebugEnabled()) {
        LOGGER.debug("String_Node_Str" + taskTrackerNodeGroup + "String_Node_Str"+ taskTrackerIdentity);
      }
      break;
    }
    try {
      appContext.getExecutingJobQueue().add(jobPo);
    }
 catch (    DupEntryException e) {
      LOGGER.warn("String_Node_Str" + JSON.toJSONString(jobPo));
      appContext.getExecutableJobQueue().resume(jobPo);
      continue;
    }
    appContext.getExecutableJobQueue().remove(jobPo.getTaskTrackerNodeGroup(),jobPo.getJobId());
    jobPos.add(jobPo);
  }
  return jobPos;
}
Program: 54186
Project: 54186
Buggy source:
public List<Node> search(NodePaginationReq request){
  WhereSql whereSql=new WhereSql().andOnNotEmpty("String_Node_Str",request.getIdentity()).andOnNotEmpty("String_Node_Str",request.getNodeGroup()).andOnNotNull("String_Node_Str",request.getNodeType() == null ? null : request.getNodeType().name()).andOnNotEmpty("String_Node_Str",request.getIp()).andOnNotNull("String_Node_Str",request.getAvailable()).andBetween("String_Node_Str",JdbcTypeUtils.toTimestamp(request.getStartDate()),JdbcTypeUtils.toTimestamp(request.getEndDate()));
  SelectSql selectSql=new SelectSql(getSqlTemplate()).select().all().from().table(getTableName()).whereSql(whereSql);
  if (StringUtils.isNotEmpty(request.getField())) {
    selectSql.orderBy().column(CharacterUtils.camelCase2Underscore(request.getField()),OrderByType.convert(request.getDirection()));
  }
  return selectSql.limit(request.getStart(),request.getLimit()).list(RshHandler.NODE_LIST_RSH);
}

Fixed version (ground truth):
public List<Node> search(NodePaginationReq request){
  SelectSql selectSql=new SelectSql(getSqlTemplate()).select().all().from().table(getTableName()).whereSql(buildWhereSql(request));
  if (StringUtils.isNotEmpty(request.getField())) {
    selectSql.orderBy().column(CharacterUtils.camelCase2Underscore(request.getField()),OrderByType.convert(request.getDirection()));
  }
  return selectSql.limit(request.getStart(),request.getLimit()).list(RshHandler.NODE_LIST_RSH);
}
Program: 54187
Project: 54187
Buggy source:
public List<Node> getNodeByNodeType(NodeType nodeType){
  NodePaginationReq nodePaginationReq=new NodePaginationReq();
  nodePaginationReq.setNodeType(nodeType);
  return search(nodePaginationReq);
}

Fixed version (ground truth):
public List<Node> getNodeByNodeType(NodeType nodeType){
  NodePaginationReq nodePaginationReq=new NodePaginationReq();
  nodePaginationReq.setNodeType(nodeType);
  nodePaginationReq.setLimit(Integer.MAX_VALUE);
  return search(nodePaginationReq);
}
Program: 54188
Project: 54188
Buggy source:
public List<Node> getOnlineNodes(NodePaginationReq request){
  return appContext.getNodeMemCacheAccess().search(request);
}

Fixed version (ground truth):
public PaginationRsp<Node> getOnlineNodes(NodePaginationReq request){
  return appContext.getNodeMemCacheAccess().pageSelect(request);
}
Program: 54189
Project: 54189
Buggy source:
@RequestMapping("String_Node_Str") public RestfulResponse getNodeList(NodePaginationReq request){
  RestfulResponse response=new RestfulResponse();
  List<Node> nodes=appContext.getBackendRegistrySrv().getOnlineNodes(request);
  response.setSuccess(true);
  response.setResults(CollectionUtils.sizeOf(nodes));
  response.setRows(nodes);
  return response;
}

Fixed version (ground truth):
@RequestMapping("String_Node_Str") public RestfulResponse getNodeList(NodePaginationReq request){
  RestfulResponse response=new RestfulResponse();
  request.setLimit(10000);
  PaginationRsp<Node> paginationRsp=appContext.getBackendRegistrySrv().getOnlineNodes(request);
  response.setSuccess(true);
  response.setResults(paginationRsp.getResults());
  response.setRows(paginationRsp.getRows());
  return response;
}
Program: 54191
Project: 54191
Buggy source:
private DataSource createDruidDataSource(Config config){
  DruidDataSource dataSource=new DruidDataSource();
  Class<DruidDataSource> clazz=DruidDataSource.class;
  for (  Map.Entry<String,Class<?>> entry : FIELDS.entrySet()) {
    String field=entry.getKey();
    String value=config.getParameter("String_Node_Str" + field);
    if (StringUtils.isNotEmpty(value)) {
      Method setMethod=null;
      try {
        setMethod=clazz.getMethod("String_Node_Str" + (field.substring(0,1).toUpperCase() + field.substring(1)),entry.getValue());
        setMethod.invoke(dataSource,value);
      }
 catch (      Exception e) {
        LOGGER.warn("String_Node_Str",field,value);
      }
    }
  }
  String url=config.getParameter(ExtConfig.JDBC_URL);
  String username=config.getParameter(ExtConfig.JDBC_USERNAME);
  String password=config.getParameter(ExtConfig.JDBC_PASSWORD);
  dataSource.setUrl(url);
  dataSource.setUsername(username);
  dataSource.setPassword(password);
  return dataSource;
}

Fixed version (ground truth):
private DataSource createDruidDataSource(Config config){
  DruidDataSource dataSource=new DruidDataSource();
  Class<DruidDataSource> clazz=DruidDataSource.class;
  for (  Map.Entry<String,Class<?>> entry : FIELDS.entrySet()) {
    String field=entry.getKey();
    String value=config.getParameter("String_Node_Str" + field);
    if (StringUtils.isNotEmpty(value)) {
      Method setMethod=null;
      try {
        try {
          setMethod=clazz.getMethod("String_Node_Str" + (field.substring(0,1).toUpperCase() + field.substring(1)),entry.getValue());
        }
 catch (        NoSuchMethodException e) {
          setMethod=clazz.getMethod("String_Node_Str" + (field.substring(0,1).toUpperCase() + field.substring(1)),PrimitiveTypeUtils.getUnBoxType(entry.getValue()));
        }
        Object obj=PrimitiveTypeUtils.convert(value,entry.getValue());
        setMethod.invoke(dataSource,obj);
      }
 catch (      Exception e) {
        LOGGER.warn("String_Node_Str",field,value);
      }
    }
  }
  String url=config.getParameter(ExtConfig.JDBC_URL);
  String username=config.getParameter(ExtConfig.JDBC_USERNAME);
  String password=config.getParameter(ExtConfig.JDBC_PASSWORD);
  dataSource.setUrl(url);
  dataSource.setUsername(username);
  dataSource.setPassword(password);
  return dataSource;
}
Program: 54192
Project: 54192
Buggy source:
/** 
 * 添加Cron 任务
 */
private void addCronJob(JobPo jobPo) throws DupEntryException {
  Date nextTriggerTime=CronExpressionUtils.getNextTriggerTime(jobPo.getCronExpression());
  if (nextTriggerTime != null) {
    appContext.getCronJobQueue().add(jobPo);
    if (JobUtils.isRelyOnPrevCycle(jobPo)) {
      if (appContext.getExecutingJobQueue().getJob(jobPo.getTaskTrackerNodeGroup(),jobPo.getTaskId()) == null) {
        jobPo.setTriggerTime(nextTriggerTime.getTime());
        appContext.getExecutableJobQueue().add(jobPo);
      }
    }
 else {
      appContext.getNonRelyOnPrevCycleJobScheduler().addScheduleJobForOneHour(jobPo);
    }
  }
}

Fixed version (ground truth):
/** 
 * 添加Cron 任务
 */
private void addCronJob(JobPo jobPo) throws DupEntryException {
  Date nextTriggerTime=CronExpressionUtils.getNextTriggerTime(jobPo.getCronExpression());
  if (nextTriggerTime != null) {
    appContext.getCronJobQueue().add(jobPo);
    if (JobUtils.isRelyOnPrevCycle(jobPo)) {
      if (appContext.getExecutingJobQueue().getJob(jobPo.getTaskTrackerNodeGroup(),jobPo.getTaskId()) == null) {
        jobPo.setTriggerTime(nextTriggerTime.getTime());
        try {
          appContext.getExecutableJobQueue().add(jobPo);
        }
 catch (        DupEntryException e) {
          appContext.getCronJobQueue().remove(jobPo.getJobId());
          throw e;
        }
      }
    }
 else {
      appContext.getNonRelyOnPrevCycleJobScheduler().addScheduleJobForOneHour(jobPo);
    }
  }
}
Program: 54193
Project: 54193
Buggy source:
/** 
 * 更新任务
 */
private boolean replaceOnExist(Job job,JobPo jobPo){
  JobPo existJobPo=appContext.getExecutableJobQueue().getJob(job.getTaskTrackerNodeGroup(),job.getTaskId());
  if (existJobPo == null) {
    existJobPo=appContext.getCronJobQueue().getJob(job.getTaskTrackerNodeGroup(),job.getTaskId());
    if (existJobPo == null) {
      existJobPo=appContext.getRepeatJobQueue().getJob(job.getTaskTrackerNodeGroup(),job.getTaskId());
    }
  }
  if (existJobPo != null) {
    String jobId=existJobPo.getJobId();
    appContext.getExecutableJobQueue().remove(job.getTaskTrackerNodeGroup(),jobId);
    appContext.getCronJobQueue().remove(jobId);
    appContext.getRepeatJobQueue().remove(jobId);
    jobPo.setJobId(jobId);
  }
  try {
    addJob(job,jobPo);
  }
 catch (  DupEntryException e) {
    LOGGER.warn("String_Node_Str",job);
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * 更新任务
 */
private boolean replaceOnExist(Job job,JobPo jobPo){
  JobPo existJobPo=appContext.getExecutableJobQueue().getJob(job.getTaskTrackerNodeGroup(),jobPo.getTaskId());
  if (existJobPo == null) {
    existJobPo=appContext.getCronJobQueue().getJob(job.getTaskTrackerNodeGroup(),job.getTaskId());
    if (existJobPo == null) {
      existJobPo=appContext.getRepeatJobQueue().getJob(job.getTaskTrackerNodeGroup(),job.getTaskId());
    }
  }
  if (existJobPo != null) {
    String jobId=existJobPo.getJobId();
    appContext.getExecutableJobQueue().removeBatch(jobPo.getRealTaskId(),jobPo.getTaskTrackerNodeGroup());
    appContext.getCronJobQueue().remove(jobId);
    appContext.getRepeatJobQueue().remove(jobId);
    jobPo.setJobId(jobId);
  }
  try {
    addJob(job,jobPo);
  }
 catch (  DupEntryException e) {
    LOGGER.warn("String_Node_Str",job);
    return false;
  }
  return true;
}
Program: 54194
Project: 54194
Buggy source:
/** 
 * 添加任务
 */
private void addJob(Job job,JobPo jobPo) throws DupEntryException {
  if (job.isCron()) {
    addCronJob(jobPo);
  }
 else   if (job.isRepeatable()) {
    addRepeatJob(jobPo);
  }
 else {
    boolean needAdd2ExecutableJobQueue=true;
    String ignoreAddOnExecuting=CollectionUtils.getValue(jobPo.getInternalExtParams(),"String_Node_Str");
    if (ignoreAddOnExecuting != null && "String_Node_Str".equals(ignoreAddOnExecuting)) {
      if (appContext.getExecutingJobQueue().getJob(jobPo.getTaskTrackerNodeGroup(),jobPo.getTaskId()) != null) {
        needAdd2ExecutableJobQueue=false;
      }
    }
    if (needAdd2ExecutableJobQueue) {
      appContext.getExecutableJobQueue().add(jobPo);
    }
  }
}

Fixed version (ground truth):
/** 
 * 添加任务
 */
private void addJob(Job job,JobPo jobPo) throws DupEntryException {
  if (job.isCron()) {
    addCronJob(jobPo);
  }
 else   if (job.isRepeatable()) {
    addRepeatJob(jobPo);
  }
 else {
    addTriggerTimeJob(jobPo);
  }
}
Program: 54195
Project: 54195
Buggy source:
/** 
 * 添加Repeat 任务
 */
private void addRepeatJob(JobPo jobPo) throws DupEntryException {
  appContext.getRepeatJobQueue().add(jobPo);
  if (JobUtils.isRelyOnPrevCycle(jobPo)) {
    if (appContext.getExecutingJobQueue().getJob(jobPo.getTaskTrackerNodeGroup(),jobPo.getTaskId()) == null) {
      appContext.getExecutableJobQueue().add(jobPo);
    }
  }
 else {
    appContext.getNonRelyOnPrevCycleJobScheduler().addScheduleJobForOneHour(jobPo);
  }
}

Fixed version (ground truth):
/** 
 * 添加Repeat 任务
 */
private void addRepeatJob(JobPo jobPo) throws DupEntryException {
  appContext.getRepeatJobQueue().add(jobPo);
  if (JobUtils.isRelyOnPrevCycle(jobPo)) {
    if (appContext.getExecutingJobQueue().getJob(jobPo.getTaskTrackerNodeGroup(),jobPo.getTaskId()) == null) {
      try {
        appContext.getExecutableJobQueue().add(jobPo);
      }
 catch (      DupEntryException e) {
        appContext.getRepeatJobQueue().remove(jobPo.getJobId());
        throw e;
      }
    }
  }
 else {
    appContext.getNonRelyOnPrevCycleJobScheduler().addScheduleJobForOneHour(jobPo);
  }
}
Program: 54198
Project: 54198
Buggy source:
private void fixDeadJob(JobPo jobPo){
  try {
    if (appContext.getExecutingJobQueue().getJob(jobPo.getTaskTrackerNodeGroup(),jobPo.getTaskId()) == null) {
      return;
    }
    jobPo.setGmtModified(SystemClock.now());
    jobPo.setTaskTrackerIdentity(null);
    jobPo.setIsRunning(false);
    try {
      appContext.getExecutableJobQueue().add(jobPo);
    }
 catch (    DupEntryException e) {
      LOGGER.warn("String_Node_Str" + JSON.toJSONString(jobPo));
    }
    appContext.getExecutingJobQueue().remove(jobPo.getJobId());
    JobLogPo jobLogPo=JobDomainConverter.convertJobLog(jobPo);
    jobLogPo.setLogTime(SystemClock.now());
    jobLogPo.setSuccess(true);
    jobLogPo.setLevel(Level.WARN);
    jobLogPo.setLogType(LogType.FIXED_DEAD);
    appContext.getJobLogger().log(jobLogPo);
    stat.incFixExecutingJobNum();
  }
 catch (  Throwable t) {
    LOGGER.error(t.getMessage(),t);
  }
  LOGGER.info("String_Node_Str",JSON.toJSONString(jobPo));
}

Fixed version (ground truth):
private void fixDeadJob(JobPo jobPo){
  try {
    if (appContext.getExecutingJobQueue().getJob(jobPo.getJobId()) == null) {
      return;
    }
    jobPo.setGmtModified(SystemClock.now());
    jobPo.setTaskTrackerIdentity(null);
    jobPo.setIsRunning(false);
    try {
      appContext.getExecutableJobQueue().add(jobPo);
    }
 catch (    DupEntryException e) {
      LOGGER.warn("String_Node_Str" + JSON.toJSONString(jobPo));
    }
    appContext.getExecutingJobQueue().remove(jobPo.getJobId());
    JobLogPo jobLogPo=JobDomainConverter.convertJobLog(jobPo);
    jobLogPo.setLogTime(SystemClock.now());
    jobLogPo.setSuccess(true);
    jobLogPo.setLevel(Level.WARN);
    jobLogPo.setLogType(LogType.FIXED_DEAD);
    appContext.getJobLogger().log(jobLogPo);
    stat.incFixExecutingJobNum();
  }
 catch (  Throwable t) {
    LOGGER.error(t.getMessage(),t);
  }
  LOGGER.info("String_Node_Str",JSON.toJSONString(jobPo));
}
Program: 54199
Project: 54199
Buggy source:
public static Compiler getCompiler(){
  return AbstractCompiler.COMPILER;
}

Fixed version (ground truth):
public static Compiler getCompiler(){
  if (AbstractCompiler.COMPILER == null) {
    AbstractCompiler.COMPILER=new JavassistCompiler();
  }
  return AbstractCompiler.COMPILER;
}
Program: 54201
Project: 54201
Buggy source:
/** 
 * 更新任务
 */
private boolean replaceOnExist(Job job,JobPo jobPo){
  JobPo oldJobPo;
  if (job.isCron()) {
    oldJobPo=appContext.getCronJobQueue().getJob(job.getTaskTrackerNodeGroup(),job.getTaskId());
  }
 else   if (job.isRepeatable()) {
    oldJobPo=appContext.getRepeatJobQueue().getJob(job.getTaskTrackerNodeGroup(),job.getTaskId());
  }
 else {
    oldJobPo=appContext.getExecutableJobQueue().getJob(job.getTaskTrackerNodeGroup(),job.getTaskId());
  }
  if (oldJobPo != null) {
    String jobId=oldJobPo.getJobId();
    appContext.getExecutableJobQueue().remove(job.getTaskTrackerNodeGroup(),jobId);
    if (job.isCron()) {
      appContext.getCronJobQueue().remove(jobId);
    }
 else     if (job.isRepeatable()) {
      appContext.getRepeatJobQueue().remove(jobId);
    }
    jobPo.setJobId(jobId);
  }
  try {
    addJob(job,jobPo);
  }
 catch (  DupEntryException e) {
    LOGGER.warn("String_Node_Str",job);
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * 更新任务
 */
private boolean replaceOnExist(Job job,JobPo jobPo){
  JobPo existJobPo=appContext.getExecutableJobQueue().getJob(job.getTaskTrackerNodeGroup(),job.getTaskId());
  if (existJobPo == null) {
    existJobPo=appContext.getCronJobQueue().getJob(job.getTaskTrackerNodeGroup(),job.getTaskId());
    if (existJobPo == null) {
      existJobPo=appContext.getRepeatJobQueue().getJob(job.getTaskTrackerNodeGroup(),job.getTaskId());
    }
  }
  if (existJobPo != null) {
    String jobId=existJobPo.getJobId();
    appContext.getExecutableJobQueue().remove(job.getTaskTrackerNodeGroup(),jobId);
    appContext.getCronJobQueue().remove(jobId);
    appContext.getRepeatJobQueue().remove(jobId);
    jobPo.setJobId(jobId);
  }
  try {
    addJob(job,jobPo);
  }
 catch (  DupEntryException e) {
    LOGGER.warn("String_Node_Str",job);
    return false;
  }
  return true;
}
Program: 54202
Project: 54202
Buggy source:
@Override public List<JobPo> getNeedGenerateJobPos(Long checkTime,int topSize){
  Query<JobPo> query=template.createQuery(JobPo.class);
  query.field("String_Node_Str").equal(true);
  query.field("String_Node_Str").equal(checkTime);
  query.offset(0).limit(topSize);
  return query.asList();
}

Fixed version (ground truth):
@Override public List<JobPo> getNeedGenerateJobPos(Long checkTime,int topSize){
  Query<JobPo> query=template.createQuery(JobPo.class);
  query.field("String_Node_Str").equal(false);
  query.field("String_Node_Str").equal(checkTime);
  query.offset(0).limit(topSize);
  return query.asList();
}
Program: 54203
Project: 54203
Buggy source:
@Override public boolean removeQueue(String jobClientNodeGroup){
  return new DropTableSql(getSqlTemplate()).drop(JobQueueUtils.getExecutableQueueName(jobClientNodeGroup)).doDrop();
}

Fixed version (ground truth):
@Override public boolean removeQueue(String jobClientNodeGroup){
  return new DropTableSql(getSqlTemplate()).drop(JobQueueUtils.getFeedbackQueueName(jobClientNodeGroup)).doDrop();
}
Program: 54204
Project: 54204
Buggy source:
/** 
 * 添加任务
 */
private void addJob(Job job,JobPo jobPo) throws DupEntryException {
  if (job.isSchedule()) {
    addCronJob(jobPo);
    LOGGER.info("String_Node_Str",job);
  }
 else {
    appContext.getExecutableJobQueue().add(jobPo);
    LOGGER.info("String_Node_Str",job);
  }
}

Fixed version (ground truth):
/** 
 * 添加任务
 */
private void addJob(Job job,JobPo jobPo) throws DupEntryException {
  if (job.isSchedule()) {
    addCronJob(jobPo);
  }
 else {
    boolean needAdd2ExecutableJobQueue=true;
    String ignoreAddOnExecuting=job.getParam("String_Node_Str");
    if (ignoreAddOnExecuting != null && "String_Node_Str".equals(ignoreAddOnExecuting)) {
      if (appContext.getExecutingJobQueue().getJob(jobPo.getTaskTrackerNodeGroup(),jobPo.getTaskId()) != null) {
        needAdd2ExecutableJobQueue=false;
      }
    }
    if (needAdd2ExecutableJobQueue) {
      appContext.getExecutableJobQueue().add(jobPo);
    }
  }
  LOGGER.info("String_Node_Str",job);
}