if (_active == Boolean.TRUE) {
throw new RecursionException ();
}
active.set(true);
try {
GlobalPathRegistry regs = GlobalPathRegistry.getDefault();
regs.addGlobalPathRegistryListener(this);
Set<URL> roots = new HashSet<URL> ();
//Add compile classpath
Set<ClassPath> paths = regs.getPaths (ClassPath.COMPILE);
for (Iterator<ClassPath> it = paths.iterator(); it.hasNext();) {
ClassPath cp = it.next();
try {
for (ClassPath.Entry entry : cp.entries()) {
roots.add (entry.getURL());
}
} catch (RecursionException e) {/*Recover from recursion*/}
}
//Add entries from Exec CP which has sources on Sources CP and are not on the Compile CP
Set<ClassPath> sources = regs.getPaths(ClassPath.SOURCE);
Set<URL> sroots = new HashSet<URL> ();
for (Iterator<ClassPath> it = sources.iterator(); it.hasNext();) {
ClassPath cp = it.next();
try {
for (Iterator<ClassPath.Entry> eit = cp.entries().iterator(); eit.hasNext();) {
ClassPath.Entry entry = eit.next();
sroots.add (entry.getURL());
}
} catch (RecursionException e) {/*Recover from recursion*/}
}
Set<ClassPath> exec = regs.getPaths(ClassPath.EXECUTE);
for (Iterator<ClassPath> it = exec.iterator(); it.hasNext();) {
ClassPath cp = it.next ();
try {
for (Iterator<ClassPath.Entry> eit = cp.entries().iterator(); eit.hasNext();) {
ClassPath.Entry entry = eit.next ();