#vulnerable code 
                              private String findPathToJarFileFromClasspath() {
    final String[] classPath = System.getProperty("java.class.path").split(
        File.pathSeparator);

    for (final String root : classPath) {
      if (JAR_REGEX.matcher(root).matches()) {
        return root;
      }
    }

    return null;
  } 
                            #location 2 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                              private String findPathToJarFileFromClasspath() {
    final String[] classPath = getClassPath().split(File.pathSeparator);

    for (final String root : classPath) {
      if (JAR_REGEX.matcher(root).matches()) {
        return root;
      }
    }

    return null;
  }