Set<String> filenames = new HashSet<String>();
	public static void main(String[] args) throws IOException,			DocumentException {		DetectorFactoryCollection.instance();		SetInfoCommandLine commandLine = new SetInfoCommandLine();		int argCount = commandLine.parse(args, 0, 2, USAGE);		Project project = new Project();		BugCollection origCollection;		origCollection = new SortedBugCollection();		if (argCount < args.length) 			origCollection.readXML(args[argCount++], project);		else			origCollection.readXML(System.in, project);				if (commandLine.revisionName != null)			origCollection.setReleaseName(commandLine.revisionName);		if (commandLine.revisionTimestamp != 0)			origCollection.setTimestamp(commandLine.revisionTimestamp);		for(String source : commandLine.sourcePaths)			project.addSourceDir(source);		Map<String,Set<String>> missingFiles = new HashMap<String,Set<String>>();		if (!commandLine.searchSourcePaths.isEmpty()) {			sourceSearcher = new SourceSearcher(project);			Set<String> filenames = new HashSet<String>();			for(BugInstance bug : origCollection.getCollection()) {				SourceLineAnnotation src = bug.getPrimarySourceLineAnnotation();				if (!sourceSearcher.sourceNotFound.contains(src.getClassName())						&& !sourceSearcher.findSource(src)) {					Set<String> paths = missingFiles.get(src.getSourceFile());					if (paths == null) {						paths = new HashSet<String>();						missingFiles.put(src.getSourceFile(), paths);					}					String fullPath = fullPath(src);					// System.out.println("Missing " + fullPath);					paths.add(fullPath);				}			}			Set<String> foundPaths = new HashSet<String>();			for(String f : commandLine.searchSourcePaths) 				for(File javaFile :  RecursiveSearchForJavaFiles.search(new File(f))) {					Set<String> matchingMissingClasses = missingFiles.get(javaFile.getName());					if (matchingMissingClasses == null) {						// System.out.println("Nothing for " + javaFile);					} else for(String sourcePath : matchingMissingClasses) {						String path = javaFile.getAbsolutePath();						if (path.endsWith(sourcePath)) {							String dir = path.substring(0,path.length() - sourcePath.length());							if (foundPaths.add(dir)) {								project.addSourceDir(dir);								if (argCount < args.length) 									System.out.println("Found " + dir);							}						}					}													}												}					// OK, now we know all the missing source files			// we also know all the .java files in the directories we were pointed to														if (argCount < args.length) 			origCollection.writeXML(args[argCount++], project);		else			origCollection.writeXML(System.out, project);	}