Author: jflesch
Date: 2006-10-26 22:56:46 +0000 (Thu, 26 Oct 2006)
New Revision: 10710
Modified:
trunk/apps/Thaw/src/thaw/core/PluginManager.java
trunk/apps/Thaw/src/thaw/plugins/index/Index.java
Log:
Remove try {} catch(NPE) from PluginManager
Modified: trunk/apps/Thaw/src/thaw/core/PluginManager.java
===================================================================
--- trunk/apps/Thaw/src/thaw/core/PluginManager.java 2006-10-26 17:17:58 UTC
(rev 10709)
+++ trunk/apps/Thaw/src/thaw/core/PluginManager.java 2006-10-26 22:56:46 UTC
(rev 10710)
@@ -78,36 +78,33 @@
*/
public boolean runPlugins() {
Iterator pluginIt;
+
+ if (this.plugins == null) {
+ Logger.error(this, "No plugin to run ?!");
+ return false;
+ }
- try {
- pluginIt = (new
Vector(this.plugins.values())).iterator();
+ pluginIt = (new Vector(this.plugins.values())).iterator();
- int progressJump = 50 / this.plugins.size();
+ int progressJump = 50 / this.plugins.size();
- this.core.getSplashScreen().setProgression(50);
+ this.core.getSplashScreen().setProgression(50);
- while(pluginIt.hasNext()) {
- Plugin plugin = (Plugin)pluginIt.next();
+ while(pluginIt.hasNext()) {
+ Plugin plugin = (Plugin)pluginIt.next();
- try {
- Logger.info(this, "Running plugin
'"+plugin.getClass().getName()+"'");
+ try {
+ Logger.info(this, "Running plugin
'"+plugin.getClass().getName()+"'");
-
this.core.getSplashScreen().setProgressionAndStatus(this.core.getSplashScreen().getProgression()+progressJump,
-
"Starting plugin '"+plugin.getClass().getName()+"' ...");
+
this.core.getSplashScreen().setProgressionAndStatus(this.core.getSplashScreen().getProgression()+progressJump,
+
"Starting plugin '"+plugin.getClass().getName()+"' ...");
- plugin.run(this.core);
- } catch(Exception e) {
- Logger.error(this, "Unable to run the
plugin '"+plugin.getClass().getName()+"' because: "+e+":");
- e.printStackTrace();
- }
-
-
+ plugin.run(this.core);
+ } catch(Exception e) {
+ Logger.error(this, "Unable to run the plugin
'"+plugin.getClass().getName()+"' because: "+e+":");
+ e.printStackTrace();
}
- } catch(NullPointerException e) {
- Logger.notice(this, "No plugin to run");
- return false;
}
-
return true;
}
@@ -118,27 +115,27 @@
*/
public boolean stopPlugins() {
Iterator pluginIt;
+
+ if (this.plugins == null) {
+ Logger.error(this, "No plugin to stop ?!");
+ return false;
+ }
+
- try {
- pluginIt = this.plugins.values().iterator();
+ pluginIt = this.plugins.values().iterator();
- while(pluginIt.hasNext()) {
- Plugin plugin = (Plugin)pluginIt.next();
-
- try {
- plugin.stop();
- } catch(Exception e) {
- Logger.error(this, "Unable to stop the
plugin '"+plugin.getClass().getName()+"', because: "+e.toString());
- e.printStackTrace();
- }
+ while(pluginIt.hasNext()) {
+ Plugin plugin = (Plugin)pluginIt.next();
-
+ try {
+ plugin.stop();
+ } catch(Exception e) {
+ Logger.error(this, "Unable to stop the plugin "+
+
"'"+plugin.getClass().getName()+"'"+
+ ", because: "+e.toString());
+ e.printStackTrace();
}
- } catch(NullPointerException e) {
- Logger.notice(this, "No plugin to load");
- return false;
}
-
return true;
}
Modified: trunk/apps/Thaw/src/thaw/plugins/index/Index.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/index/Index.java 2006-10-26 17:17:58 UTC
(rev 10709)
+++ trunk/apps/Thaw/src/thaw/plugins/index/Index.java 2006-10-26 22:56:46 UTC
(rev 10710)
@@ -1010,7 +1010,7 @@
Element header =
(Element)rootEl.getElementsByTagName("header").item(0);
this.realName = this.getHeaderElement(header, "title");
- this.author = this.getHeaderElement(header, "author");
+ this.author = this.getHeaderElement(header, "owner");
if (this.author == null)
this.author = "Another anonymous";