* @exception IllegalStateException when basedir was set incorrectly.
*/
public synchronized void scan() throws IllegalStateException {
included = new Vector<String>();
String analyzerClassName = DEFAULT_ANALYZER_CLASS;
DependencyAnalyzer analyzer = null;
try {
Class<? extends DependencyAnalyzer> analyzerClass = Class.forName(analyzerClassName)
.asSubclass(DependencyAnalyzer.class);
analyzer = analyzerClass.newInstance();
} catch (Exception e) {
throw new BuildException("Unable to load dependency analyzer: "
+ analyzerClassName, e);
}
analyzer.addClassPath(new Path(null, basedir.getPath()));
for (Enumeration<File> e = additionalBaseDirs.elements(); e.hasMoreElements();) {
File additionalBaseDir = e.nextElement();
analyzer.addClassPath(new Path(null, additionalBaseDir.getPath()));
}
for (Enumeration<String> e = rootClasses.elements(); e.hasMoreElements();) {
String rootClass = e.nextElement();
analyzer.addRootClass(rootClass);
}
Enumeration<String> e = analyzer.getClassDependencies();
String[] parentFiles = parentScanner.getIncludedFiles();
Hashtable<String, String> parentSet = new Hashtable<String, String>();
for (int i = 0; i < parentFiles.length; ++i) {
parentSet.put(parentFiles[i], parentFiles[i]);