}
} else {
files = PathFinder.getJavaFiles(pathOrFile, true);
}
ClassFileLoader loader = new ClassFileLoader(paths);
for (int j = 0; j < files.length; j++) {
String fileName = files[j].getPath();
if (fileName.endsWith(".java")) {
fileName = fileName.substring(0, fileName.length() - 5)
+ ".class";
} else {
System.err.println("Skipping \"" + files[j] + "\". "
+ "Cause: Class file not found.");
continue;
}
Class c = null;
try {
c = loader.loadClass(new File(fileName));
} catch (Exception e) {
/*System.err.println("Skipping \"" + files[j] + "\". "
+ "Cause: " + e.getMessage());
continue;*/
System.err.println("***********************");
String message = e.getMessage();
System.err.println("Cannot load class from file: "
+ message);
String header = "Prohibited package name:";
if (message.startsWith(header)) {
String packageName =
message.substring(header.length()).trim();
String name = new File(fileName).getName();
int dotPos = name.indexOf('.');
if (dotPos >= 0) {
name = name.substring(0, dotPos);
}
String className = packageName + "." + name;
System.err.println("Try to use preloaded class: "
+ className);
try {
c = loader.loadClass(className);
} catch (Exception e2) {
}
if (c == null) {
System.err.println(