Program: 3645
Project: 3645
Buggy source:
/** 
 * Constructs a FastClasspathScanner instance.
 * @param packagesToScan the whitelist of package prefixes to scan, e.g. "com.xyz.widget", "com.xyz.gizmo". If no whitelisted packages are given (i.e. if the constructor is called with zero arguments), or a whitelisted package is "", then all packages on the classpath are whitelisted. If a package name is prefixed with "-", e.g. "-com.xyz.otherthing", then that package is blacklisted, rather than whitelisted. The final list of packages scanned is the set of whitelisted packages minus the set of blacklisted packages.
 */
public FastClasspathScanner(final String... packagesToScan){
  final HashSet<String> uniqueWhitelistedPaths=new HashSet<>();
  final HashSet<String> uniqueBlacklistedPaths=new HashSet<>();
  boolean scanAll=false;
  if (packagesToScan.length == 0) {
    scanAll=true;
  }
 else {
    for (    final String packageToScan : packagesToScan) {
      if (packageToScan.isEmpty()) {
        scanAll=true;
        break;
      }
      String pkg=packageToScan.replace('.','/') + "String_Node_Str";
      final boolean blacklisted=pkg.startsWith("String_Node_Str");
      if (blacklisted) {
        pkg=pkg.substring(1);
      }
      (blacklisted ? uniqueBlacklistedPaths : uniqueWhitelistedPaths).add(pkg);
    }
  }
  uniqueWhitelistedPaths.removeAll(uniqueBlacklistedPaths);
  String[] whitelistedPaths;
  if (scanAll) {
    whitelistedPaths=new String[]{"String_Node_Str"};
  }
 else {
    whitelistedPaths=new String[uniqueWhitelistedPaths.size()];
    int i=0;
    for (    final String path : uniqueWhitelistedPaths) {
      whitelistedPaths[i++]=path;
    }
  }
  String[] blacklistedPaths;
  blacklistedPaths=new String[uniqueBlacklistedPaths.size()];
  int i=0;
  for (  final String path : uniqueBlacklistedPaths) {
    blacklistedPaths[i++]=path;
  }
  classpath=new ClasspathFinder();
  classGraphBuilder=new ClassGraphBuilder();
  recursiveScanner=new RecursiveScanner(classpath,whitelistedPaths,blacklistedPaths,classGraphBuilder);
  this.matchFilenameExtension("String_Node_Str",new FileMatchProcessor(){
    @Override public void processMatch(    final String relativePath,    final InputStream inputStream,    final int lengthBytes) throws IOException {
      classGraphBuilder.readClassInfoFromClassfileHeader(relativePath,inputStream,classNameToStaticFieldnameToMatchProcessor);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Constructs a FastClasspathScanner instance.
 * @param packagesToScan the whitelist of package prefixes to scan, e.g. "com.xyz.widget", "com.xyz.gizmo". If no whitelisted packages are given (i.e. if the constructor is called with zero arguments), or a whitelisted package is "", then all packages on the classpath are whitelisted. If a package name is prefixed with "-", e.g. "-com.xyz.otherthing", then that package is blacklisted, rather than whitelisted. The final list of packages scanned is the set of whitelisted packages minus the set of blacklisted packages.
 */
public FastClasspathScanner(final String... packagesToScan){
  final HashSet<String> uniqueWhitelistedPaths=new HashSet<>();
  final HashSet<String> uniqueBlacklistedPaths=new HashSet<>();
  boolean scanAll=false;
  if (packagesToScan.length == 0) {
    scanAll=true;
  }
 else {
    for (    final String packageToScan : packagesToScan) {
      if (packageToScan.isEmpty()) {
        scanAll=true;
        break;
      }
      String pkg=packageToScan.replace('.','/') + "String_Node_Str";
      final boolean blacklisted=pkg.startsWith("String_Node_Str");
      if (blacklisted) {
        pkg=pkg.substring(1);
      }
      (blacklisted ? uniqueBlacklistedPaths : uniqueWhitelistedPaths).add(pkg);
    }
  }
  uniqueWhitelistedPaths.removeAll(uniqueBlacklistedPaths);
  String[] whitelistedPaths;
  if (scanAll) {
    whitelistedPaths=new String[]{"String_Node_Str"};
  }
 else {
    whitelistedPaths=new String[uniqueWhitelistedPaths.size()];
    int i=0;
    for (    final String path : uniqueWhitelistedPaths) {
      whitelistedPaths[i++]=path;
    }
  }
  String[] blacklistedPaths;
  blacklistedPaths=new String[uniqueBlacklistedPaths.size()];
  int i=0;
  for (  final String path : uniqueBlacklistedPaths) {
    blacklistedPaths[i++]=path;
  }
  recursiveScanner=new RecursiveScanner(classpath,whitelistedPaths,blacklistedPaths);
  this.matchFilenameExtension("String_Node_Str",new FileMatchProcessor(){
    @Override public void processMatch(    final String relativePath,    final InputStream inputStream,    final int lengthBytes) throws IOException {
      final ClassInfo newClassInfo=new ClassInfo(relativePath);
      final ClassInfo oldClassInfo=classNameToClassInfo.put(newClassInfo.className,newClassInfo);
      if (oldClassInfo == null) {
        ClassfileBinaryParser.readClassInfoFromClassfileHeader(relativePath,inputStream,newClassInfo,classNameToStaticFieldnameToMatchProcessor);
      }
 else {
        if (FastClasspathScanner.verbose) {
          Log.log(relativePath.replace('/','.') + "String_Node_Str");
        }
      }
    }
  }
);
}