Program: 3624
Project: 3624
Buggy source:
/** 
 * Parses the scanning specification that was passed to the FastClasspathScanner constructor, and finds all ClassLoaders.
 */
public ScanSpec(final String[] scanSpec,final LogNode log){
  final HashSet<String> uniqueWhitelistedPathPrefixes=new HashSet<>();
  final HashSet<String> uniqueBlacklistedPathPrefixes=new HashSet<>();
  boolean scanJars=true, scanNonJars=true;
  for (  final String scanSpecEntry : scanSpec) {
    String spec=scanSpecEntry;
    if ("String_Node_Str".equals(scanSpecEntry)) {
      blacklistSystemPackages=false;
    }
 else     if ("String_Node_Str".equals(scanSpecEntry)) {
      blacklistSystemJars=false;
      blacklistSystemPackages=false;
    }
 else {
      final boolean blacklisted=spec.startsWith("String_Node_Str");
      if (blacklisted) {
        spec=spec.substring(1);
      }
      if (spec.startsWith("String_Node_Str")) {
        spec=spec.substring(4);
        if (spec.indexOf('/') >= 0) {
          if (log != null) {
            log.log("String_Node_Str" + "String_Node_Str" + spec + "String_Node_Str");
          }
        }
 else {
          if (spec.isEmpty()) {
            if (blacklisted) {
              scanJars=false;
            }
 else {
              scanNonJars=false;
            }
          }
 else {
            if (blacklisted) {
              if (spec.contains("String_Node_Str")) {
                blacklistedJarPatterns.add(specToPattern(spec));
              }
 else {
                blacklistedJars.add(spec);
              }
            }
 else {
              if (spec.contains("String_Node_Str")) {
                whitelistedJarPatterns.add(specToPattern(spec));
              }
 else {
                whitelistedJars.add(spec);
              }
            }
          }
        }
      }
 else {
        final String specPath=spec.replace('.','/');
        boolean isClassName=false;
        final int lastSlashIdx=specPath.lastIndexOf('/');
        if (lastSlashIdx < specPath.length() - 1) {
          isClassName=Character.isUpperCase(specPath.charAt(lastSlashIdx + 1));
        }
        if (isClassName) {
          if (blacklisted) {
            specificallyBlacklistedClassNames.add(spec);
            specificallyBlacklistedClassRelativePaths.add(specPath + "String_Node_Str");
          }
 else {
            specificallyWhitelistedClassRelativePaths.add(specPath + "String_Node_Str");
          }
        }
 else {
          if (blacklisted) {
            uniqueBlacklistedPathPrefixes.add(specPath + "String_Node_Str");
          }
 else {
            uniqueWhitelistedPathPrefixes.add(specPath + "String_Node_Str");
          }
        }
      }
    }
  }
  if (uniqueBlacklistedPathPrefixes.contains("String_Node_Str")) {
    if (log != null) {
      log.log("String_Node_Str");
    }
    uniqueBlacklistedPathPrefixes.remove("String_Node_Str");
  }
  uniqueWhitelistedPathPrefixes.removeAll(uniqueBlacklistedPathPrefixes);
  whitelistedJars.removeAll(blacklistedJars);
  if (!(whitelistedJars.isEmpty() && whitelistedJarPatterns.isEmpty())) {
    scanNonJars=false;
  }
  if (!scanJars && !scanNonJars) {
    if (log != null) {
      log.log("String_Node_Str");
    }
    scanNonJars=true;
  }
  if (uniqueWhitelistedPathPrefixes.isEmpty() || uniqueWhitelistedPathPrefixes.contains("String_Node_Str")) {
    whitelistedPathPrefixes.add("String_Node_Str");
  }
 else {
    whitelistedPathPrefixes.addAll(uniqueWhitelistedPathPrefixes);
  }
  if (blacklistSystemPackages) {
    uniqueBlacklistedPathPrefixes.add("String_Node_Str");
    uniqueBlacklistedPathPrefixes.add("String_Node_Str");
    uniqueBlacklistedPathPrefixes.add("String_Node_Str");
  }
  blacklistedPathPrefixes.addAll(uniqueBlacklistedPathPrefixes);
  for (  final String prefix : blacklistedPathPrefixes) {
    blacklistedPackagePrefixes.add(prefix.replace('/','.'));
  }
  specificallyWhitelistedClassRelativePaths.removeAll(specificallyBlacklistedClassRelativePaths);
  for (  final String whitelistedClass : specificallyWhitelistedClassRelativePaths) {
    final int lastSlashIdx=whitelistedClass.lastIndexOf('/');
    specificallyWhitelistedClassParentRelativePaths.add(whitelistedClass.substring(0,lastSlashIdx + 1));
  }
  this.scanJars=scanJars;
  this.scanDirs=scanNonJars;
  if (log != null) {
    log.log("String_Node_Str" + whitelistedPathPrefixes);
    if (!blacklistedPathPrefixes.isEmpty()) {
      log.log("String_Node_Str" + blacklistedPathPrefixes);
    }
    if (!whitelistedJars.isEmpty()) {
      log.log("String_Node_Str" + whitelistedJars);
    }
    if (!whitelistedJarPatterns.isEmpty()) {
      log.log("String_Node_Str" + whitelistedJarPatterns);
    }
    if (!blacklistedJars.isEmpty()) {
      log.log("String_Node_Str" + blacklistedJars);
    }
    if (!blacklistedJarPatterns.isEmpty()) {
      log.log("String_Node_Str" + blacklistedJarPatterns);
    }
    if (!specificallyWhitelistedClassRelativePaths.isEmpty()) {
      log.log("String_Node_Str" + specificallyWhitelistedClassRelativePaths);
    }
    if (!specificallyBlacklistedClassRelativePaths.isEmpty()) {
      log.log("String_Node_Str" + specificallyBlacklistedClassRelativePaths);
    }
    if (!scanJars) {
      log.log("String_Node_Str");
    }
    if (!scanNonJars) {
      log.log("String_Node_Str");
    }
  }
  this.classLoaders=findAllClassLoaders(log == null ? null : log.log("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Parses the scanning specification that was passed to the FastClasspathScanner constructor, and finds all ClassLoaders.
 */
public ScanSpec(final String[] scanSpec,final LogNode log){
  final HashSet<String> uniqueWhitelistedPathPrefixes=new HashSet<>();
  final HashSet<String> uniqueBlacklistedPathPrefixes=new HashSet<>();
  boolean scanJars=true, scanNonJars=true;
  for (  final String scanSpecEntry : scanSpec) {
    String spec=scanSpecEntry;
    if ("String_Node_Str".equals(scanSpecEntry)) {
      blacklistSystemPackages=false;
    }
 else     if ("String_Node_Str".equals(scanSpecEntry)) {
      blacklistSystemJars=false;
      blacklistSystemPackages=false;
    }
 else {
      final boolean blacklisted=spec.startsWith("String_Node_Str");
      if (blacklisted) {
        spec=spec.substring(1);
      }
      if (spec.startsWith("String_Node_Str")) {
        spec=spec.substring(4);
        if (spec.indexOf('/') >= 0) {
          if (log != null) {
            log.log("String_Node_Str" + "String_Node_Str" + spec + "String_Node_Str");
          }
        }
 else {
          if (spec.isEmpty()) {
            if (blacklisted) {
              scanJars=false;
            }
 else {
              scanNonJars=false;
            }
          }
 else {
            if (blacklisted) {
              if (spec.contains("String_Node_Str")) {
                blacklistedJarPatterns.add(specToPattern(spec));
              }
 else {
                blacklistedJars.add(spec);
              }
            }
 else {
              if (spec.contains("String_Node_Str")) {
                whitelistedJarPatterns.add(specToPattern(spec));
              }
 else {
                whitelistedJars.add(spec);
              }
            }
          }
        }
      }
 else {
        final String specPath=spec.replace('.','/');
        boolean isClassName=false;
        final int lastSlashIdx=specPath.lastIndexOf('/');
        if (lastSlashIdx < specPath.length() - 1) {
          isClassName=Character.isUpperCase(specPath.charAt(lastSlashIdx + 1));
        }
        if (isClassName) {
          if (blacklisted) {
            specificallyBlacklistedClassNames.add(spec);
            specificallyBlacklistedClassRelativePaths.add(specPath + "String_Node_Str");
          }
 else {
            specificallyWhitelistedClassRelativePaths.add(specPath + "String_Node_Str");
          }
        }
 else {
          if (blacklisted) {
            uniqueBlacklistedPathPrefixes.add(specPath + "String_Node_Str");
          }
 else {
            uniqueWhitelistedPathPrefixes.add(specPath + "String_Node_Str");
          }
        }
      }
    }
  }
  if (uniqueBlacklistedPathPrefixes.contains("String_Node_Str")) {
    if (log != null) {
      log.log("String_Node_Str");
    }
    uniqueBlacklistedPathPrefixes.remove("String_Node_Str");
  }
  uniqueWhitelistedPathPrefixes.removeAll(uniqueBlacklistedPathPrefixes);
  whitelistedJars.removeAll(blacklistedJars);
  if (!(whitelistedJars.isEmpty() && whitelistedJarPatterns.isEmpty())) {
    scanNonJars=false;
  }
  if (!scanJars && !scanNonJars) {
    if (log != null) {
      log.log("String_Node_Str");
    }
    scanNonJars=true;
  }
  if (uniqueWhitelistedPathPrefixes.isEmpty() || uniqueWhitelistedPathPrefixes.contains("String_Node_Str")) {
    if (specificallyWhitelistedClassRelativePaths.isEmpty()) {
      whitelistedPathPrefixes.add("String_Node_Str");
    }
  }
 else {
    whitelistedPathPrefixes.addAll(uniqueWhitelistedPathPrefixes);
  }
  if (blacklistSystemPackages) {
    uniqueBlacklistedPathPrefixes.add("String_Node_Str");
    uniqueBlacklistedPathPrefixes.add("String_Node_Str");
    uniqueBlacklistedPathPrefixes.add("String_Node_Str");
  }
  blacklistedPathPrefixes.addAll(uniqueBlacklistedPathPrefixes);
  for (  final String prefix : blacklistedPathPrefixes) {
    blacklistedPackagePrefixes.add(prefix.replace('/','.'));
  }
  specificallyWhitelistedClassRelativePaths.removeAll(specificallyBlacklistedClassRelativePaths);
  for (  final String whitelistedClass : specificallyWhitelistedClassRelativePaths) {
    final int lastSlashIdx=whitelistedClass.lastIndexOf('/');
    specificallyWhitelistedClassParentRelativePaths.add(whitelistedClass.substring(0,lastSlashIdx + 1));
  }
  this.scanJars=scanJars;
  this.scanDirs=scanNonJars;
  if (log != null) {
    log.log("String_Node_Str" + whitelistedPathPrefixes);
    if (!blacklistedPathPrefixes.isEmpty()) {
      log.log("String_Node_Str" + blacklistedPathPrefixes);
    }
    if (!whitelistedJars.isEmpty()) {
      log.log("String_Node_Str" + whitelistedJars);
    }
    if (!whitelistedJarPatterns.isEmpty()) {
      log.log("String_Node_Str" + whitelistedJarPatterns);
    }
    if (!blacklistedJars.isEmpty()) {
      log.log("String_Node_Str" + blacklistedJars);
    }
    if (!blacklistedJarPatterns.isEmpty()) {
      log.log("String_Node_Str" + blacklistedJarPatterns);
    }
    if (!specificallyWhitelistedClassRelativePaths.isEmpty()) {
      log.log("String_Node_Str" + specificallyWhitelistedClassRelativePaths);
    }
    if (!specificallyBlacklistedClassRelativePaths.isEmpty()) {
      log.log("String_Node_Str" + specificallyBlacklistedClassRelativePaths);
    }
    if (!scanJars) {
      log.log("String_Node_Str");
    }
    if (!scanNonJars) {
      log.log("String_Node_Str");
    }
  }
  this.classLoaders=findAllClassLoaders(log == null ? null : log.log("String_Node_Str"));
}