couple tweaks for Mode debugging

This commit is contained in:
Ben Fry
2016-05-10 22:14:52 -04:00
parent 167220b90a
commit 7006ed1a6f
2 changed files with 11 additions and 5 deletions
+5
View File
@@ -397,13 +397,18 @@ public class Base {
contribModes.add(new ModeContribution(this, folder, null));
} catch (NoSuchMethodError nsme) {
System.err.println(folder.getName() + " is not compatible with this version of Processing");
if (DEBUG) nsme.printStackTrace();
} catch (NoClassDefFoundError ncdfe) {
System.err.println(folder.getName() + " is not compatible with this version of Processing");
if (DEBUG) ncdfe.printStackTrace();
} catch (InvocationTargetException ite) {
System.err.println(folder.getName() + " could not be loaded and may not compatible with this version of Processing");
if (DEBUG) ite.printStackTrace();
} catch (IgnorableException ig) {
Messages.log(ig.getMessage());
if (DEBUG) ig.printStackTrace();
} catch (Throwable e) {
System.err.println("Could not load Mode from " + folder);
e.printStackTrace();
}
} else {
@@ -137,11 +137,11 @@ public class ModeContribution extends LocalContribution {
return loader.equals(other.loader) && mode.equals(other.getMode());
}
public String initLoader(Base base, String className) throws Exception {
public String initLoader(Base base, String className) throws Exception {
File modeDirectory = new File(folder, getTypeName());
if (modeDirectory.exists()) {
Messages.log("checking mode folder regarding " + className);
Messages.log("checking mode folder regarding class name " + className);
// If no class name specified, search the main <modename>.jar for the
// full name package and mode name.
if (className == null) {
@@ -170,7 +170,7 @@ public class ModeContribution extends LocalContribution {
installedModes.put(m.getClass().getName(), m);
}
for(String modeImport: imports){
for (String modeImport: imports) {
if (installedModes.containsKey(modeImport)) {
Messages.log("Found mode dependency " + modeImport);
File modeFolder = installedModes.get(modeImport).getFolder();
@@ -182,8 +182,9 @@ public class ModeContribution extends LocalContribution {
}
}
} else {
throw new IgnorableException("Dependency mode "+ modeImport + " could not be"
+ " found. Can't load " + className);
throw new IgnorableException("Can't load " + className +
" because the import " + modeImport +
" could not be found. ");
}
}
}