nus-yam/ex-repair huggingface dataset:
Program: 3586
Project: 3586
Buggy source:
public void createPassword(View v){
  this.currentDir=getCurrentDir();
  Log.i("String_Node_Str","String_Node_Str" + this.currentDir.getAbsolutePath());
  this.leftActivity=true;
  try {
    Intent intent=new Intent(this,PgpHandler.class);
    intent.putExtra("String_Node_Str",FileUtils.readFileToString(PasswordRepository.getFile("String_Node_Str")));
    intent.putExtra("String_Node_Str",this.currentDir.getAbsolutePath());
    intent.putExtra("String_Node_Str","String_Node_Str");
    startActivityForResult(intent,PgpHandler.REQUEST_CODE_ENCRYPT);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void createPassword(View v){
  this.currentDir=getCurrentDir();
  Log.i("String_Node_Str","String_Node_Str" + this.currentDir.getAbsolutePath());
  this.leftActivity=true;
  try {
    Intent intent=new Intent(this,PgpHandler.class);
    intent.putExtra("String_Node_Str",FileUtils.readFileToString(PasswordRepository.getFile("String_Node_Str")));
    intent.putExtra("String_Node_Str",getCurrentDir().getAbsolutePath());
    intent.putExtra("String_Node_Str","String_Node_Str");
    startActivityForResult(intent,PgpHandler.REQUEST_CODE_ENCRYPT);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 3587
Project: 3587
Buggy source:
private File getCurrentDir(){
  return new File(((PasswordFragment)getFragmentManager().findFragmentByTag("String_Node_Str")).getArguments().getString("String_Node_Str"));
}

Fixed version (ground truth):
private File getCurrentDir(){
  PasswordFragment plist;
  if (null != (plist=(PasswordFragment)getFragmentManager().findFragmentByTag("String_Node_Str"))) {
    return plist.getCurrentDir();
  }
  return null;
}
Program: 3588
Project: 3588
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  this.activity=this;
  this.clipboard=(ClipboardManager)getSystemService(CLIPBOARD_SERVICE);
  settings=PreferenceManager.getDefaultSharedPreferences(this);
  String providerPackageName=settings.getString("String_Node_Str","String_Node_Str");
  accountName=settings.getString("String_Node_Str","String_Node_Str");
  keyIDs=settings.getString("String_Node_Str","String_Node_Str");
  if (TextUtils.isEmpty(providerPackageName)) {
    Toast.makeText(this,"String_Node_Str",Toast.LENGTH_LONG).show();
    Intent intent=new Intent(this,UserPreference.class);
    startActivity(intent);
    setResult(RESULT_CANCELED);
    finish();
  }
 else {
    mServiceConnection=new OpenPgpServiceConnection(PgpHandler.this,providerPackageName,this);
    mServiceConnection.bindToService();
    bindingDialog=new ProgressDialog(this);
    bindingDialog.setMessage("String_Node_Str");
    bindingDialog.setCancelable(false);
    bindingDialog.show();
    ActionBar actionBar=getActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
  }
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  this.activity=this;
  this.clipboard=(ClipboardManager)getSystemService(CLIPBOARD_SERVICE);
  settings=PreferenceManager.getDefaultSharedPreferences(this);
  String providerPackageName=settings.getString("String_Node_Str","String_Node_Str");
  accountName=settings.getString("String_Node_Str","String_Node_Str");
  keyIDs=settings.getString("String_Node_Str","String_Node_Str");
  registered=false;
  if (TextUtils.isEmpty(providerPackageName)) {
    Toast.makeText(this,"String_Node_Str",Toast.LENGTH_LONG).show();
    Intent intent=new Intent(this,UserPreference.class);
    startActivity(intent);
    setResult(RESULT_CANCELED);
    finish();
  }
 else {
    mServiceConnection=new OpenPgpServiceConnection(PgpHandler.this,providerPackageName,this);
    mServiceConnection.bindToService();
    bindingDialog=new ProgressDialog(this);
    bindingDialog.setMessage("String_Node_Str");
    bindingDialog.setCancelable(false);
    bindingDialog.show();
    registered=true;
    ActionBar actionBar=getActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
  }
}
Program: 3589
Project: 3589
Buggy source:
@Override public void onStop(){
  super.onStop();
  if (this.mServiceConnection.isBound())   try {
    this.mServiceConnection.unbindFromService();
  }
 catch (  Exception e) {
  }
}

Fixed version (ground truth):
@Override public void onStop(){
  super.onStop();
  if (this.registered && this.mServiceConnection.isBound())   try {
    this.mServiceConnection.unbindFromService();
  }
 catch (  Exception e) {
  }
}
Program: 3591
Project: 3591
Buggy source:
@Override public View getView(final int position,View convertView,ViewGroup parent){
  convertView=LayoutInflater.from(MainActivity.this).inflate(R.layout.view_list_item,null);
  WaterDrop drop=(WaterDrop)convertView.findViewById(R.id.drop);
  drop.setText(String.valueOf(position));
  drop.setOnDragCompeteListener(new OnDragCompeteListener(){
    @Override public void onDrag(){
      Toast.makeText(MainActivity.this,"String_Node_Str" + position,Toast.LENGTH_SHORT).show();
    }
  }
);
  return convertView;
}

Fixed version (ground truth):
@Override public View getView(final int position,View convertView,ViewGroup parent){
  if (convertView == null) {
    convertView=LayoutInflater.from(MainActivity.this).inflate(R.layout.view_list_item,null);
  }
  WaterDrop drop=(WaterDrop)convertView.findViewById(R.id.drop);
  drop.setText(String.valueOf(position));
  drop.setOnDragCompeteListener(new OnDragCompeteListener(){
    @Override public void onDrag(){
      Toast.makeText(MainActivity.this,"String_Node_Str" + position,Toast.LENGTH_SHORT).show();
    }
  }
);
  return convertView;
}
Program: 3592
Project: 3592
Buggy source:
public void finish(View target,float x,float y){
  mDropCover.finish(target,x,y);
  mDropCover.setOnDragCompeteListener(null);
}

Fixed version (ground truth):
public void finish(final View target,final float x,final float y){
  target.postDelayed(new Runnable(){
    @Override public void run(){
      mDropCover.finish(target,x,y);
      mDropCover.setOnDragCompeteListener(null);
    }
  }
,100);
}
Program: 3594
Project: 3594
Buggy source:
@Override public boolean equals(final Object obj){
  if (!(obj instanceof ModuleRef)) {
    return false;
  }
  final ModuleRef mr=(ModuleRef)obj;
  return reference.equals(this.reference) && mr.layer.equals(this.layer);
}

Fixed version (ground truth):
@Override public boolean equals(final Object obj){
  if (!(obj instanceof ModuleRef)) {
    return false;
  }
  final ModuleRef mr=(ModuleRef)obj;
  return mr.reference.equals(this.reference) && mr.layer.equals(this.layer);
}
Program: 3596
Project: 3596
Buggy source:
public AnnotationClassRef(final String classRefTypeDescriptor){
  this.typeDescriptor=classRefTypeDescriptor;
}

Fixed version (ground truth):
AnnotationClassRef(final String typeDescriptorStr){
  this.typeDescriptorStr=typeDescriptorStr;
}
Program: 3597
Project: 3597
Buggy source:
/** 
 * Get the type signature for a type reference used in an annotation parameter. <p> Call getType() to get a   {@code Class<?>} reference for this class.
 * @return The type signature of the annotation class ref.
 */
public TypeSignature getTypeSignature(){
  if (typeSignature == null) {
    try {
      typeSignature=TypeSignature.parse(typeDescriptor,scanResult);
    }
 catch (    final ParseException e) {
      throw new IllegalArgumentException(e);
    }
  }
  return typeSignature;
}

Fixed version (ground truth):
/** 
 * Get the type signature for a type reference used in an annotation parameter.
 * @return The type signature of the annotation class ref.
 */
private TypeSignature getTypeSignature(){
  if (typeSignature == null) {
    try {
      final TypeSignature typeSig=TypeSignature.parse(typeDescriptorStr,scanResult);
      typeSignature=typeSig;
    }
 catch (    final ParseException e) {
      throw new IllegalArgumentException(e);
    }
  }
  return typeSignature;
}
Program: 3598
Project: 3598
Buggy source:
/** 
 * Get the class name of the enum.
 * @return The name of the enum class.
 */
public String getClassName(){
  return className;
}

Fixed version (ground truth):
@Override protected String getClassName(){
  return className;
}
Program: 3599
Project: 3599
Buggy source:
/** 
 * Find the set difference between this ClassInfoList and another ClassInfoList, i.e. (this \ other).
 * @param other The other  {@link ClassInfoList} to subtract from this one.
 * @return The set difference of this {@link ClassInfoList} and other, i.e. (this \ other).
 */
public ClassInfoList exclude(final ClassInfoList other){
  final Set<ClassInfo> reachableClassesDifference=new HashSet<>(reachableClasses);
  final Set<ClassInfo> directlyRelatedClassesDifference=directlyRelatedClasses == null ? new HashSet<>() : new HashSet<>(directlyRelatedClasses);
  reachableClassesDifference.removeAll(other);
  if (other.directlyRelatedClasses != null) {
    directlyRelatedClassesDifference.removeAll(other.directlyRelatedClasses);
  }
  return new ClassInfoList(reachableClassesDifference,directlyRelatedClassesDifference);
}

Fixed version (ground truth):
/** 
 * Find the set difference between this ClassInfoList and another ClassInfoList, i.e. (this \ other).
 * @param other The other  {@link ClassInfoList} to subtract from this one.
 * @return The set difference of this {@link ClassInfoList} and other, i.e. (this \ other).
 */
public ClassInfoList exclude(final ClassInfoList other){
  final Set<ClassInfo> reachableClassesDifference=new HashSet<>(reachableClasses);
  final Set<ClassInfo> directlyRelatedClassesDifference=new HashSet<>();
  if (directlyRelatedClasses != null) {
    directlyRelatedClassesDifference.addAll(directlyRelatedClasses);
  }
  reachableClassesDifference.removeAll(other);
  if (other.directlyRelatedClasses != null) {
    directlyRelatedClassesDifference.removeAll(other.directlyRelatedClasses);
  }
  return new ClassInfoList(reachableClassesDifference,directlyRelatedClassesDifference);
}
Program: 3600
Project: 3600
Buggy source:
/** 
 * Find the intersection of this ClassInfoList with one or more others.
 * @param others The other  {@link ClassInfoList}s to intersect with this one.
 * @return The intersection of this {@link ClassInfoList} with the others.
 */
public ClassInfoList intersect(final ClassInfoList... others){
  final Set<ClassInfo> reachableClassesIntersection=new HashSet<>(reachableClasses);
  final Set<ClassInfo> directlyRelatedClassesIntersecion=directlyRelatedClasses == null ? new HashSet<>() : new HashSet<>(directlyRelatedClasses);
  for (  final ClassInfoList other : others) {
    reachableClassesIntersection.retainAll(other);
    if (other.directlyRelatedClasses != null) {
      directlyRelatedClassesIntersecion.retainAll(other.directlyRelatedClasses);
    }
  }
  return new ClassInfoList(reachableClassesIntersection,directlyRelatedClassesIntersecion);
}

Fixed version (ground truth):
/** 
 * Find the intersection of this ClassInfoList with one or more others.
 * @param others The other  {@link ClassInfoList}s to intersect with this one.
 * @return The intersection of this {@link ClassInfoList} with the others.
 */
public ClassInfoList intersect(final ClassInfoList... others){
  final Set<ClassInfo> reachableClassesIntersection=new HashSet<>(reachableClasses);
  final Set<ClassInfo> directlyRelatedClassesIntersection=new HashSet<>();
  if (directlyRelatedClasses != null) {
    directlyRelatedClassesIntersection.addAll(directlyRelatedClasses);
  }
  for (  final ClassInfoList other : others) {
    reachableClassesIntersection.retainAll(other);
    if (other.directlyRelatedClasses != null) {
      directlyRelatedClassesIntersection.retainAll(other.directlyRelatedClasses);
    }
  }
  return new ClassInfoList(reachableClassesIntersection,directlyRelatedClassesIntersection);
}
Program: 3601
Project: 3601
Buggy source:
/** 
 * Find the union of this ClassInfoList with one or more others.
 * @param others The other  {@link ClassInfoList}s to union with this one.
 * @return The union of this {@link ClassInfoList} with the others.
 */
public ClassInfoList union(final ClassInfoList... others){
  final Set<ClassInfo> reachableClassesUnion=new HashSet<>(reachableClasses);
  final Set<ClassInfo> directlyRelatedClassesUnion=directlyRelatedClasses == null ? new HashSet<>() : new HashSet<>(directlyRelatedClasses);
  for (  final ClassInfoList other : others) {
    reachableClassesUnion.addAll(other);
    if (other.directlyRelatedClasses != null) {
      directlyRelatedClassesUnion.addAll(other.directlyRelatedClasses);
    }
  }
  return new ClassInfoList(reachableClassesUnion,directlyRelatedClassesUnion);
}

Fixed version (ground truth):
/** 
 * Find the union of this ClassInfoList with one or more others.
 * @param others The other  {@link ClassInfoList}s to union with this one.
 * @return The union of this {@link ClassInfoList} with the others.
 */
public ClassInfoList union(final ClassInfoList... others){
  final Set<ClassInfo> reachableClassesUnion=new HashSet<>(reachableClasses);
  final Set<ClassInfo> directlyRelatedClassesUnion=new HashSet<>();
  if (directlyRelatedClasses != null) {
    directlyRelatedClassesUnion.addAll(directlyRelatedClasses);
  }
  for (  final ClassInfoList other : others) {
    reachableClassesUnion.addAll(other);
    if (other.directlyRelatedClasses != null) {
      directlyRelatedClassesUnion.addAll(other.directlyRelatedClasses);
    }
  }
  return new ClassInfoList(reachableClassesUnion,directlyRelatedClassesUnion);
}
Program: 3602
Project: 3602
Buggy source:
@Override public int hashCode(){
  int h=annotationName.hashCode();
  if (annotationParamValues != null) {
    for (int i=0; i < annotationParamValues.size(); i++) {
      final AnnotationParamValue e=annotationParamValues.get(i);
      h=h * 7 + e.getParamName().hashCode() * 3 + e.getParamValue().hashCode();
    }
  }
  return h;
}

Fixed version (ground truth):
@Override public int hashCode(){
  int h=getAnnotationName().hashCode();
  if (annotationParamValues != null) {
    for (int i=0; i < annotationParamValues.size(); i++) {
      final AnnotationParamValue e=annotationParamValues.get(i);
      h=h * 7 + e.getParamName().hashCode() * 3 + e.getParamValue().hashCode();
    }
  }
  return h;
}
Program: 3603
Project: 3603
Buggy source:
/** 
 * Get the parameter value of the annotation.
 * @return The annotation parameter values.
 */
public List<AnnotationParamValue> getAnnotationParamValues(){
  return annotationParamValues;
}

Fixed version (ground truth):
/** 
 * Get the parameter value of this annotation, including any default values inherited from the annotation class definition.
 * @return The annotation parameter values, including any default values, or the empty list if none.
 */
public List<AnnotationParamValue> getAnnotationParamValues(){
  final List<AnnotationParamValue> defaultParamValues=classInfo.annotationDefaultParamValues;
  if (defaultParamValues == null && annotationParamValues == null) {
    return Collections.<AnnotationParamValue>emptyList();
  }
 else   if (defaultParamValues == null) {
    return annotationParamValues;
  }
 else   if (annotationParamValues == null) {
    return defaultParamValues;
  }
  final Map<String,Object> allParamValues=new HashMap<>();
  for (  final AnnotationParamValue defaultParamValue : defaultParamValues) {
    allParamValues.put(defaultParamValue.paramName,defaultParamValue.paramValue.get());
  }
  for (  final AnnotationParamValue annotationParamValue : this.annotationParamValues) {
    allParamValues.put(annotationParamValue.paramName,annotationParamValue.paramValue.get());
  }
  final List<AnnotationParamValue> result=new ArrayList<>();
  for (  final Entry<String,Object> ent : allParamValues.entrySet()) {
    result.add(new AnnotationParamValue(ent.getKey(),ent.getValue()));
  }
  Collections.sort(result);
  return result;
}
Program: 3604
Project: 3604
Buggy source:
@Override public int compareTo(final AnnotationInfo o){
  final int diff=annotationName.compareTo(o.annotationName);
  if (diff != 0) {
    return diff;
  }
  if (annotationParamValues == null && o.annotationParamValues == null) {
    return 0;
  }
 else   if (annotationParamValues == null) {
    return -1;
  }
 else   if (o.annotationParamValues == null) {
    return 1;
  }
 else {
    for (int i=0, max=Math.max(annotationParamValues.size(),o.annotationParamValues.size()); i < max; i++) {
      if (i >= annotationParamValues.size()) {
        return -1;
      }
 else       if (i >= o.annotationParamValues.size()) {
        return 1;
      }
 else {
        final int diff2=annotationParamValues.get(i).compareTo(o.annotationParamValues.get(i));
        if (diff2 != 0) {
          return diff2;
        }
      }
    }
  }
  return 0;
}

Fixed version (ground truth):
@Override public int compareTo(final AnnotationInfo o){
  final int diff=getAnnotationName().compareTo(o.getAnnotationName());
  if (diff != 0) {
    return diff;
  }
  if (annotationParamValues == null && o.annotationParamValues == null) {
    return 0;
  }
 else   if (annotationParamValues == null) {
    return -1;
  }
 else   if (o.annotationParamValues == null) {
    return 1;
  }
 else {
    for (int i=0, max=Math.max(annotationParamValues.size(),o.annotationParamValues.size()); i < max; i++) {
      if (i >= annotationParamValues.size()) {
        return -1;
      }
 else       if (i >= o.annotationParamValues.size()) {
        return 1;
      }
 else {
        final int diff2=annotationParamValues.get(i).compareTo(o.annotationParamValues.get(i));
        if (diff2 != 0) {
          return diff2;
        }
      }
    }
  }
  return 0;
}
Program: 3605
Project: 3605
Buggy source:
/** 
 * @param annotationName The name of the annotation.
 * @param annotationParamValues The annotation parameter values, or null if none.
 */
public AnnotationInfo(final String annotationName,final List<AnnotationParamValue> annotationParamValues){
  this.annotationName=annotationName;
  if (annotationParamValues != null) {
    Collections.sort(annotationParamValues);
  }
  this.annotationParamValues=annotationParamValues;
}

Fixed version (ground truth):
/** 
 * @param annotationName The name of the annotation.
 * @param annotationParamValues The annotation parameter values, or null if none.
 */
public AnnotationInfo(final String annotationName,final List<AnnotationParamValue> annotationParamValues){
  this.annotationName=annotationName;
  this.annotationParamValues=annotationParamValues;
}
Program: 3606
Project: 3606
Buggy source:
/** 
 * Get the parameter value of this annotation, including any default values inherited from the annotation class definition, or the empty list if none.
 * @return The annotation parameter values, including any default values, or the empty list if none.
 */
public List<AnnotationParamValue> getAnnotationParamValues(){
  final List<AnnotationParamValue> defaultParamValues=classInfo.annotationDefaultParamValues;
  if (defaultParamValues == null && annotationParamValues == null) {
    return Collections.<AnnotationParamValue>emptyList();
  }
 else   if (defaultParamValues == null) {
    return annotationParamValues;
  }
 else   if (annotationParamValues == null) {
    return defaultParamValues;
  }
  final Map<String,Object> allParamValues=new HashMap<>();
  for (  final AnnotationParamValue defaultParamValue : defaultParamValues) {
    allParamValues.put(defaultParamValue.paramName,defaultParamValue.paramValue.get());
  }
  for (  final AnnotationParamValue annotationParamValue : this.annotationParamValues) {
    allParamValues.put(annotationParamValue.paramName,annotationParamValue.paramValue.get());
  }
  final List<AnnotationParamValue> result=new ArrayList<>();
  for (  final Entry<String,Object> ent : allParamValues.entrySet()) {
    result.add(new AnnotationParamValue(ent.getKey(),ent.getValue()));
  }
  Collections.sort(result);
  return result;
}

Fixed version (ground truth):
/** 
 * Get the parameter value of this annotation, including any default values inherited from the annotation class definition, or the empty list if none.
 * @return The annotation parameter values, including any default values, or the empty list if none.
 */
public List<AnnotationParamValue> getAnnotationParamValues(){
  if (classInfo == null) {
    return Collections.<AnnotationParamValue>emptyList();
  }
  final List<AnnotationParamValue> defaultParamValues=classInfo.annotationDefaultParamValues;
  if (defaultParamValues == null && annotationParamValues == null) {
    return Collections.<AnnotationParamValue>emptyList();
  }
 else   if (defaultParamValues == null) {
    return annotationParamValues;
  }
 else   if (annotationParamValues == null) {
    return defaultParamValues;
  }
  final Map<String,Object> allParamValues=new HashMap<>();
  for (  final AnnotationParamValue defaultParamValue : defaultParamValues) {
    allParamValues.put(defaultParamValue.paramName,defaultParamValue.paramValue.get());
  }
  for (  final AnnotationParamValue annotationParamValue : this.annotationParamValues) {
    allParamValues.put(annotationParamValue.paramName,annotationParamValue.paramValue.get());
  }
  final List<AnnotationParamValue> result=new ArrayList<>();
  for (  final Entry<String,Object> ent : allParamValues.entrySet()) {
    result.add(new AnnotationParamValue(ent.getKey(),ent.getValue()));
  }
  Collections.sort(result);
  return result;
}
Program: 3607
Project: 3607
Buggy source:
/** 
 * Add field info. 
 */
void addFieldInfo(final FieldInfoList fieldInfoList,final Map<String,ClassInfo> classNameToClassInfo){
  for (  final FieldInfo fieldInfo : fieldInfoList) {
    fieldInfo.definingClassInfo=this;
    final AnnotationInfoList fieldAnnotationInfoList=fieldInfo.annotationInfo;
    if (fieldAnnotationInfoList != null) {
      for (      final AnnotationInfo fieldAnnotationInfo : fieldAnnotationInfoList) {
        final ClassInfo annotationClassInfo=getOrCreateClassInfo(fieldAnnotationInfo.getName(),ANNOTATION_CLASS_MODIFIER,scanSpec,classNameToClassInfo);
        this.addRelatedClass(RelType.FIELD_ANNOTATIONS,annotationClassInfo);
        annotationClassInfo.addRelatedClass(RelType.CLASSES_WITH_FIELD_ANNOTATION,this);
        fieldAnnotationInfo.setClassInfo(annotationClassInfo);
      }
    }
  }
  if (this.fieldInfo == null) {
    this.fieldInfo=fieldInfoList;
  }
 else {
    this.fieldInfo.addAll(fieldInfoList);
  }
}

Fixed version (ground truth):
/** 
 * Add field info. 
 */
void addFieldInfo(final FieldInfoList fieldInfoList,final Map<String,ClassInfo> classNameToClassInfo){
  for (  final FieldInfo fieldInfo : fieldInfoList) {
    final AnnotationInfoList fieldAnnotationInfoList=fieldInfo.annotationInfo;
    if (fieldAnnotationInfoList != null) {
      for (      final AnnotationInfo fieldAnnotationInfo : fieldAnnotationInfoList) {
        final ClassInfo annotationClassInfo=getOrCreateClassInfo(fieldAnnotationInfo.getName(),ANNOTATION_CLASS_MODIFIER,scanSpec,classNameToClassInfo);
        this.addRelatedClass(RelType.FIELD_ANNOTATIONS,annotationClassInfo);
        annotationClassInfo.addRelatedClass(RelType.CLASSES_WITH_FIELD_ANNOTATION,this);
        fieldAnnotationInfo.setClassInfo(annotationClassInfo);
      }
    }
    fieldInfo.definingClassInfo=this;
  }
  if (this.fieldInfo == null) {
    this.fieldInfo=fieldInfoList;
  }
 else {
    this.fieldInfo.addAll(fieldInfoList);
  }
}
Program: 3609
Project: 3609
Buggy source:
void logTo(final LogNode log){
  if (log != null) {
    final LogNode subLog=log.log("String_Node_Str" + (isAnnotation ? "String_Node_Str" : isInterface ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ className);
    if (superclassName != null) {
      subLog.log("String_Node_Str" + (isInterface && !isAnnotation ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ superclassName);
    }
    if (implementedInterfaces != null) {
      subLog.log("String_Node_Str" + Join.join("String_Node_Str",implementedInterfaces));
    }
    if (classAnnotations != null) {
      subLog.log("String_Node_Str" + Join.join("String_Node_Str",classAnnotations));
    }
    if (methodInfoList != null) {
      subLog.log("String_Node_Str" + Join.join("String_Node_Str",methodInfoList));
    }
    if (fieldInfoList != null) {
      subLog.log("String_Node_Str" + Join.join("String_Node_Str",fieldInfoList));
    }
    if (typeSignature != null) {
      ClassTypeSignature typeSig=null;
      try {
        typeSig=ClassTypeSignature.parse(typeSignature,null);
      }
 catch (      final ParseException e) {
      }
      subLog.log("String_Node_Str" + (typeSig == null ? typeSignature : typeSig.toString(classModifiers,isAnnotation,isInterface,className)));
    }
  }
}

Fixed version (ground truth):
void logTo(final LogNode log){
  if (log != null) {
    final LogNode subLog=log.log("String_Node_Str" + (isAnnotation ? "String_Node_Str" : isInterface ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ className);
    if (superclassName != null) {
      subLog.log("String_Node_Str" + (isInterface && !isAnnotation ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ superclassName);
    }
    if (implementedInterfaces != null) {
      subLog.log("String_Node_Str" + Join.join("String_Node_Str",implementedInterfaces));
    }
    if (classAnnotations != null) {
      subLog.log("String_Node_Str" + Join.join("String_Node_Str",classAnnotations));
    }
    if (annotationParamDefaultValues != null) {
      subLog.log("String_Node_Str" + Join.join("String_Node_Str",annotationParamDefaultValues));
    }
    if (methodInfoList != null) {
      subLog.log("String_Node_Str" + Join.join("String_Node_Str",methodInfoList));
    }
    if (fieldInfoList != null) {
      subLog.log("String_Node_Str" + Join.join("String_Node_Str",fieldInfoList));
    }
    if (typeSignature != null) {
      ClassTypeSignature typeSig=null;
      try {
        typeSig=ClassTypeSignature.parse(typeSignature,null);
      }
 catch (      final ParseException e) {
      }
      subLog.log("String_Node_Str" + (typeSig == null ? typeSignature : typeSig.toString(classModifiers,isAnnotation,isInterface,className)));
    }
  }
}
Program: 3610
Project: 3610
Buggy source:
public static void main(final String[] args){
  final ScanResult scanResult=new FastClasspathScanner().whitelistPackages("String_Node_Str").blacklistPackages("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str").enableMethodInfo().ignoreMethodVisibility().enableFieldInfo().ignoreFieldVisibility().enableAnnotationInfo().verbose().scan();
  System.out.println(scanResult.generateClassGraphDotFile(12,8,false,false));
}

Fixed version (ground truth):
public static void main(final String[] args) throws IOException {
  final ScanResult scanResult=new FastClasspathScanner().whitelistPackages("String_Node_Str").blacklistPackages("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str").enableMethodInfo().ignoreMethodVisibility().enableFieldInfo().ignoreFieldVisibility().enableAnnotationInfo().scan();
  try (PrintWriter writer=new PrintWriter("String_Node_Str")){
    writer.print(scanResult.getAllClasses().generateGraphVizDotFile(12,8,false,false,true));
  }
 }
Program: 3611
Project: 3611
Buggy source:
/** 
 * Find the set difference between this ClassInfoList and another ClassInfoList, i.e. (this \ other).
 * @param other The other  {@link ClassInfoList} to subtract from this one.
 * @return The set difference of this {@link ClassInfoList} and other, i.e. (this \ other).
 */
public ClassInfoList exclude(final ClassInfoList other){
  final Set<ClassInfo> reachableClassesDifference=new HashSet<>(reachableClasses);
  final Set<ClassInfo> directlyRelatedClassesDifference=directlyRelatedClasses == null ? new HashSet<>() : new HashSet<>(directlyRelatedClasses);
  reachableClassesDifference.removeAll(other);
  if (other.directlyRelatedClasses != null) {
    directlyRelatedClassesDifference.removeAll(other.directlyRelatedClasses);
  }
  return new ClassInfoList(reachableClassesDifference,directlyRelatedClassesDifference);
}

Fixed version (ground truth):
/** 
 * Find the set difference between this ClassInfoList and another ClassInfoList, i.e. (this \ other).
 * @param other The other  {@link ClassInfoList} to subtract from this one.
 * @return The set difference of this {@link ClassInfoList} and other, i.e. (this \ other).
 */
public ClassInfoList exclude(final ClassInfoList other){
  final Set<ClassInfo> reachableClassesDifference=new HashSet<>(reachableClasses);
  final Set<ClassInfo> directlyRelatedClassesDifference=directlyRelatedClasses == null ? new HashSet<ClassInfo>() : new HashSet<>(directlyRelatedClasses);
  reachableClassesDifference.removeAll(other);
  if (other.directlyRelatedClasses != null) {
    directlyRelatedClassesDifference.removeAll(other.directlyRelatedClasses);
  }
  return new ClassInfoList(reachableClassesDifference,directlyRelatedClassesDifference);
}
Program: 3612
Project: 3612
Buggy source:
/** 
 * Find the intersection of this ClassInfoList with one or more others.
 * @param others The other  {@link ClassInfoList}s to intersect with this one.
 * @return The intersection of this {@link ClassInfoList} with the others.
 */
public ClassInfoList intersect(final ClassInfoList... others){
  final Set<ClassInfo> reachableClassesIntersection=new HashSet<>(reachableClasses);
  final Set<ClassInfo> directlyRelatedClassesIntersecion=directlyRelatedClasses == null ? new HashSet<>() : new HashSet<>(directlyRelatedClasses);
  for (  final ClassInfoList other : others) {
    reachableClassesIntersection.retainAll(other);
    if (other.directlyRelatedClasses != null) {
      directlyRelatedClassesIntersecion.retainAll(other.directlyRelatedClasses);
    }
  }
  return new ClassInfoList(reachableClassesIntersection,directlyRelatedClassesIntersecion);
}

Fixed version (ground truth):
/** 
 * Find the intersection of this ClassInfoList with one or more others.
 * @param others The other  {@link ClassInfoList}s to intersect with this one.
 * @return The intersection of this {@link ClassInfoList} with the others.
 */
public ClassInfoList intersect(final ClassInfoList... others){
  final Set<ClassInfo> reachableClassesIntersection=new HashSet<>(reachableClasses);
  final Set<ClassInfo> directlyRelatedClassesIntersecion=directlyRelatedClasses == null ? new HashSet<ClassInfo>() : new HashSet<>(directlyRelatedClasses);
  for (  final ClassInfoList other : others) {
    reachableClassesIntersection.retainAll(other);
    if (other.directlyRelatedClasses != null) {
      directlyRelatedClassesIntersecion.retainAll(other.directlyRelatedClasses);
    }
  }
  return new ClassInfoList(reachableClassesIntersection,directlyRelatedClassesIntersecion);
}
Program: 3613
Project: 3613
Buggy source:
/** 
 * Find the union of this ClassInfoList with one or more others.
 * @param others The other  {@link ClassInfoList}s to union with this one.
 * @return The union of this {@link ClassInfoList} with the others.
 */
public ClassInfoList union(final ClassInfoList... others){
  final Set<ClassInfo> reachableClassesUnion=new HashSet<>(reachableClasses);
  final Set<ClassInfo> directlyRelatedClassesUnion=directlyRelatedClasses == null ? new HashSet<>() : new HashSet<>(directlyRelatedClasses);
  for (  final ClassInfoList other : others) {
    reachableClassesUnion.addAll(other);
    if (other.directlyRelatedClasses != null) {
      directlyRelatedClassesUnion.addAll(other.directlyRelatedClasses);
    }
  }
  return new ClassInfoList(reachableClassesUnion,directlyRelatedClassesUnion);
}

Fixed version (ground truth):
/** 
 * Find the union of this ClassInfoList with one or more others.
 * @param others The other  {@link ClassInfoList}s to union with this one.
 * @return The union of this {@link ClassInfoList} with the others.
 */
public ClassInfoList union(final ClassInfoList... others){
  final Set<ClassInfo> reachableClassesUnion=new HashSet<>(reachableClasses);
  final Set<ClassInfo> directlyRelatedClassesUnion=directlyRelatedClasses == null ? new HashSet<ClassInfo>() : new HashSet<>(directlyRelatedClasses);
  for (  final ClassInfoList other : others) {
    reachableClassesUnion.addAll(other);
    if (other.directlyRelatedClasses != null) {
      directlyRelatedClassesUnion.addAll(other.directlyRelatedClasses);
    }
  }
  return new ClassInfoList(reachableClassesUnion,directlyRelatedClassesUnion);
}
Program: 3614
Project: 3614
Buggy source:
/** 
 * Returns the module location as a File, i.e.   {@code new File(moduleReference.location())}. Returns null for modules that do not have a location. Returns a file that does not exist for "jrt:/" (system) module locations.
 */
public File getModuleLocationFile(){
  if (moduleLocationFile == null && moduleLocation != null) {
    moduleLocationFile=new File(moduleLocation);
  }
  return moduleLocationFile;
}

Fixed version (ground truth):
/** 
 * Returns the module location as a File, i.e.   {@code new File(moduleReference.location())}. Returns null for modules that do not have a location, or for system ("jrt:/") modules.
 */
public File getModuleLocationFile(){
  if (moduleLocationFile == null && moduleLocation != null) {
    if (!isSystemModule()) {
      moduleLocationFile=new File(moduleLocation);
    }
 else {
      return null;
    }
  }
  return moduleLocationFile;
}
Program: 3615
Project: 3615
Buggy source:
/** 
 * Returns true if this module's location is a "jrt:/" URI, or if it has no location URI. 
 */
public boolean isSystemModule(){
  if (moduleLocation == null) {
    return true;
  }
  final String scheme=moduleLocation.getScheme();
  if (scheme == null) {
    return false;
  }
  return scheme.equalsIgnoreCase("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Returns true if this module's location is a "jrt:/" URI, or if it has no location URI. 
 */
public boolean isSystemModule(){
  if (moduleLocation == null) {
    return true;
  }
  final String scheme=moduleLocation.getScheme();
  if (scheme == null) {
    return false;
  }
  return !scheme.equalsIgnoreCase("String_Node_Str");
}
Program: 3616
Project: 3616
Buggy source:
/** 
 * Returns the list of File objects for unique classpath elements (directories or jarfiles), in classloader resolution order.
 * @return The unique classpath elements.
 */
public List<File> getUniqueClasspathElements(){
  return classpathElementOrderFiles;
}

Fixed version (ground truth):
/** 
 * Returns the list of File objects for unique classpath elements (directories or jarfiles), in classloader resolution order.
 * @return The unique classpath elements.
 */
public List<File> getUniqueClasspathElements(){
  final List<File> classpathElementOrderFiles=new ArrayList<>();
  for (  final ClasspathElement classpathElement : classpathOrder) {
    final ModuleRef modRef=classpathElement.getClasspathElementModuleRef();
    if (modRef != null) {
      if (!modRef.isSystemModule()) {
        classpathElementOrderFiles.add(modRef.getModuleLocationFile());
      }
    }
 else {
      classpathElementOrderFiles.add(classpathElement.getClasspathElementFile(log));
    }
  }
  return classpathElementOrderFiles;
}
Program: 3617
Project: 3617
Buggy source:
/** 
 * Returns the list of unique classpath element paths as URLs, in classloader resolution order.
 * @return The unique classpath element URLs.
 */
public List<URL> getUniqueClasspathElementURLs(){
  final List<URL> classpathElementOrderURLs=new ArrayList<>(classpathElementOrderFiles.size());
  for (  final File classpathElementFile : classpathElementOrderFiles) {
    try {
      classpathElementOrderURLs.add(classpathElementFile.toURI().toURL());
    }
 catch (    final MalformedURLException e) {
      throw new RuntimeException(e);
    }
  }
  return classpathElementOrderURLs;
}

Fixed version (ground truth):
/** 
 * Returns the list of unique classpath element paths as URLs, in classloader resolution order.
 * @return The unique classpath element URLs.
 */
public List<URL> getUniqueClasspathElementURLs(){
  final List<URL> classpathElementOrderURLs=new ArrayList<>();
  for (  final ClasspathElement classpathElement : classpathOrder) {
    final ModuleRef modRef=classpathElement.getClasspathElementModuleRef();
    if (modRef != null) {
      try {
        classpathElementOrderURLs.add(modRef.getModuleLocation().toURL());
      }
 catch (      final MalformedURLException e) {
      }
    }
 else {
      try {
        classpathElementOrderURLs.add(classpathElement.getClasspathElementFile(log).toURI().toURL());
      }
 catch (      final MalformedURLException e) {
      }
    }
  }
  return classpathElementOrderURLs;
}
Program: 3618
Project: 3618
Buggy source:
/** 
 * The result of a scan. Make sure you call complete() after calling the constructor. 
 */
ScanResult(final ScanSpec scanSpec,final List<ClasspathElement> classpathOrder,final ClassLoader[] envClassLoaderOrder,final ClassGraphBuilder classGraphBuilder,final Map<File,Long> fileToLastModified,final NestedJarHandler nestedJarHandler,final InterruptionChecker interruptionChecker,final LogNode log){
  this.scanSpec=scanSpec;
  this.classpathOrder=classpathOrder;
  this.envClassLoaderOrder=envClassLoaderOrder;
  this.classpathElementOrderFiles=new ArrayList<>();
  for (  final ClasspathElement classpathElement : classpathOrder) {
    classpathElementOrderFiles.add(classpathElement.getClasspathElementFile(log));
  }
  this.fileToLastModified=fileToLastModified;
  this.classGraphBuilder=classGraphBuilder;
  this.nestedJarHandler=nestedJarHandler;
  this.interruptionChecker=interruptionChecker;
  this.log=log;
  if (classGraphBuilder != null) {
    if (classGraphBuilder.getClassNameToClassInfo() != null) {
      for (      final ClassInfo ci : classGraphBuilder.getClassNameToClassInfo().values()) {
        ci.setScanResult(this);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * The result of a scan. Make sure you call complete() after calling the constructor. 
 */
ScanResult(final ScanSpec scanSpec,final List<ClasspathElement> classpathOrder,final ClassLoader[] envClassLoaderOrder,final ClassGraphBuilder classGraphBuilder,final Map<File,Long> fileToLastModified,final NestedJarHandler nestedJarHandler,final InterruptionChecker interruptionChecker,final LogNode log){
  this.scanSpec=scanSpec;
  this.classpathOrder=classpathOrder;
  this.envClassLoaderOrder=envClassLoaderOrder;
  this.fileToLastModified=fileToLastModified;
  this.classGraphBuilder=classGraphBuilder;
  this.nestedJarHandler=nestedJarHandler;
  this.interruptionChecker=interruptionChecker;
  this.log=log;
  if (classGraphBuilder != null) {
    if (classGraphBuilder.getClassNameToClassInfo() != null) {
      for (      final ClassInfo ci : classGraphBuilder.getClassNameToClassInfo().values()) {
        ci.setScanResult(this);
      }
    }
  }
}
Program: 3619
Project: 3619
Buggy source:
/** 
 * Get a map from class name to ClassLoader(s) for the class. 
 */
public Map<String,ClassLoader[]> getClassNameToClassLoaders(){
  return classNameToClassLoaders;
}

Fixed version (ground truth):
/** 
 * Get a map from class name to ClassLoader(s) for the class.
 * @return The map.
 */
public Map<String,ClassLoader[]> getClassNameToClassLoaders(){
  return classNameToClassLoaders;
}
Program: 3627
Project: 3627
Buggy source:
/** 
 * Read another chunk of size BUFFER_CHUNK_SIZE from the InputStream; double the size of the buffer if necessary to accommodate the new chunk.
 */
private void readMore(final int amountToRead) throws IOException {
  final int totReadAhead=amountToRead + BUFFER_CHUNK_SIZE;
  final int newUsed=used + totReadAhead;
  int newBufLen=buf.length;
  while (newBufLen < newUsed) {
    newBufLen<<=1;
  }
  if (newBufLen > buf.length) {
    buf=Arrays.copyOf(buf,newBufLen);
  }
  final int bytesRead=inputStream.read(buf,used,totReadAhead);
  if (bytesRead < 0) {
    throw new IOException("String_Node_Str");
  }
  used+=bytesRead;
}

Fixed version (ground truth):
/** 
 * Read another chunk of size BUFFER_CHUNK_SIZE from the InputStream; double the size of the buffer if necessary to accommodate the new chunk.
 */
private void readMore(final int amountToRead) throws IOException {
  int bytesToRead=amountToRead + BUFFER_CHUNK_SIZE;
  final int newUsed=used + bytesToRead;
  int newBufLen=buf.length;
  while (newBufLen < newUsed) {
    newBufLen<<=1;
  }
  if (newBufLen > buf.length) {
    buf=Arrays.copyOf(buf,newBufLen);
  }
  while (bytesToRead > 0) {
    final int bytesRead=inputStream.read(buf,used,bytesToRead);
    if (bytesRead > 0) {
      used+=bytesRead;
      bytesToRead-=bytesRead;
    }
 else {
      break;
    }
  }
  if (used - curr < amountToRead) {
    throw new IOException("String_Node_Str");
  }
}
Program: 3629
Project: 3629
Buggy source:
/** 
 * Check a class is a regular class or interface and not an annotation, and that it is in a whitelisted package. Throws IllegalArgumentException otherwise. Returns the name of the class or interface.
 */
private String classOrInterfaceName(final Class<?> classOrInterface){
  String classOrIfaceName=classOrInterface.getName();
  checkClassNameIsInWhitelistedPackage(classOrIfaceName);
  if (classOrInterface.isAnnotation()) {
    throw new IllegalArgumentException(classOrIfaceName + "String_Node_Str");
  }
  return classOrInterface.getName();
}

Fixed version (ground truth):
/** 
 * Check a class is a regular class or interface and not an annotation, and that it is in a whitelisted package. Throws IllegalArgumentException otherwise. Returns the name of the class or interface.
 */
private String classOrInterfaceName(final Class<?> classOrInterface){
  final String classOrIfaceName=classOrInterface.getName();
  checkClassNameIsInWhitelistedPackage(classOrIfaceName);
  if (classOrInterface.isAnnotation()) {
    throw new IllegalArgumentException(classOrIfaceName + "String_Node_Str");
  }
  return classOrInterface.getName();
}
Program: 3630
Project: 3630
Buggy source:
/** 
 * Check a class is an annotation, and that it is in a whitelisted package. Throws IllegalArgumentException otherwise. Returns the name of the annotation.
 */
private String annotationName(final Class<?> annotation){
  String annotationName=annotation.getName();
  checkClassNameIsInWhitelistedPackage(annotationName);
  if (!annotation.isAnnotation()) {
    throw new IllegalArgumentException(annotationName + "String_Node_Str");
  }
  return annotation.getName();
}

Fixed version (ground truth):
/** 
 * Check a class is an annotation, and that it is in a whitelisted package. Throws IllegalArgumentException otherwise. Returns the name of the annotation.
 */
private String annotationName(final Class<?> annotation){
  final String annotationName=annotation.getName();
  checkClassNameIsInWhitelistedPackage(annotationName);
  if (!annotation.isAnnotation()) {
    throw new IllegalArgumentException(annotationName + "String_Node_Str");
  }
  return annotation.getName();
}
Program: 3631
Project: 3631
Buggy source:
/** 
 * Check a class is in a whitelisted package. Returns the name of the class if it is in a whitelisted package, otherwise throws an IllegalArgumentException.
 */
private String className(final Class<?> cls){
  String className=cls.getName();
  checkClassNameIsInWhitelistedPackage(className);
  return className;
}

Fixed version (ground truth):
/** 
 * Check a class is in a whitelisted package. Returns the name of the class if it is in a whitelisted package, otherwise throws an IllegalArgumentException.
 */
private String className(final Class<?> cls){
  final String className=cls.getName();
  checkClassNameIsInWhitelistedPackage(className);
  return className;
}
Program: 3632
Project: 3632
Buggy source:
/** 
 * Check a class is an interface, and that it is in a whitelisted package. Throws IllegalArgumentException otherwise. Returns the name of the interface.
 */
private String interfaceName(final Class<?> iface){
  String ifaceName=iface.getName();
  checkClassNameIsInWhitelistedPackage(ifaceName);
  if (!iface.isInterface()) {
    throw new IllegalArgumentException(ifaceName + "String_Node_Str");
  }
  return iface.getName();
}

Fixed version (ground truth):
/** 
 * Check a class is an interface, and that it is in a whitelisted package. Throws IllegalArgumentException otherwise. Returns the name of the interface.
 */
private String interfaceName(final Class<?> iface){
  final String ifaceName=iface.getName();
  checkClassNameIsInWhitelistedPackage(ifaceName);
  if (!iface.isInterface()) {
    throw new IllegalArgumentException(ifaceName + "String_Node_Str");
  }
  return iface.getName();
}
Program: 3633
Project: 3633
Buggy source:
/** 
 * Check a class is a standard class (not an interface or annotation), and that it is in a whitelisted package. Returns the name of the class if it is a standard class and it is in a whitelisted package, otherwise throws an IllegalArgumentException.
 */
private String standardClassName(final Class<?> cls){
  String className=cls.getName();
  checkClassNameIsInWhitelistedPackage(className);
  if (cls.isAnnotation()) {
    throw new IllegalArgumentException(className + "String_Node_Str");
  }
 else   if (cls.isInterface()) {
    throw new IllegalArgumentException(cls.getName() + "String_Node_Str");
  }
  return className;
}

Fixed version (ground truth):
/** 
 * Check a class is a standard class (not an interface or annotation), and that it is in a whitelisted package. Returns the name of the class if it is a standard class and it is in a whitelisted package, otherwise throws an IllegalArgumentException.
 */
private String standardClassName(final Class<?> cls){
  final String className=cls.getName();
  checkClassNameIsInWhitelistedPackage(className);
  if (cls.isAnnotation()) {
    throw new IllegalArgumentException(className + "String_Node_Str");
  }
 else   if (cls.isInterface()) {
    throw new IllegalArgumentException(cls.getName() + "String_Node_Str");
  }
  return className;
}
Program: 3634
Project: 3634
Buggy source:
/** 
 * Checks that the named class is in a whitelisted (non-blacklisted) package. Throws IllegalArgumentException otherwise.
 */
private void checkClassNameIsInWhitelistedPackage(String className){
  boolean isWhitelisted=whitelistedPackagePrefixes.isEmpty();
  for (  String pkgPrefix : whitelistedPackagePrefixes) {
    if (className.startsWith(pkgPrefix)) {
      isWhitelisted=true;
      break;
    }
  }
  boolean isBlacklisted=false;
  for (  String pkgPrefix : blacklistedPackagePrefixes) {
    if (className.startsWith(pkgPrefix)) {
      isBlacklisted=true;
      break;
    }
  }
  if (isBlacklisted) {
    throw new IllegalArgumentException("String_Node_Str" + className + "String_Node_Str");
  }
  if (!isWhitelisted) {
    throw new IllegalArgumentException("String_Node_Str" + className + "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Checks that the named class is in a whitelisted (non-blacklisted) package. Throws IllegalArgumentException otherwise.
 */
private void checkClassNameIsInWhitelistedPackage(final String className){
  if (!scanSpec.classIsInWhitelistedPackage(className)) {
    throw new IllegalArgumentException("String_Node_Str" + className + "String_Node_Str");
  }
}