Author: nextgens
Date: 2008-08-14 15:42:55 +0000 (Thu, 14 Aug 2008)
New Revision: 21846
Added:
trunk/freenet/src/freenet/config/ConfigException.java
Modified:
trunk/freenet/src/freenet/config/InvalidConfigValueException.java
trunk/freenet/src/freenet/config/NodeNeedRestartException.java
Log:
Create an abstract ConfigException to remove code duplication
Added: trunk/freenet/src/freenet/config/ConfigException.java
===================================================================
--- trunk/freenet/src/freenet/config/ConfigException.java
(rev 0)
+++ trunk/freenet/src/freenet/config/ConfigException.java 2008-08-14
15:42:55 UTC (rev 21846)
@@ -0,0 +1,15 @@
+/* This code is part of Freenet. It is distributed under the GNU General
+ * Public License, version 2 (or at your option any later version). See
+ * http://www.gnu.org/ for further details of the GPL. */
+package freenet.config;
+
+/**
+ * Usefull if you want to catch all exceptions the config framework can return;
+ */
+public abstract class ConfigException extends Exception {
+ private static final long serialVersionUID = -1;
+
+ public ConfigException(String msg) {
+ super(msg);
+ }
+}
\ No newline at end of file
Modified: trunk/freenet/src/freenet/config/InvalidConfigValueException.java
===================================================================
--- trunk/freenet/src/freenet/config/InvalidConfigValueException.java
2008-08-14 15:28:20 UTC (rev 21845)
+++ trunk/freenet/src/freenet/config/InvalidConfigValueException.java
2008-08-14 15:42:55 UTC (rev 21846)
@@ -10,11 +10,9 @@
* it merely means that there are no immediately detectable problems with
* it.
*/
-public class InvalidConfigValueException extends Exception {
- private static final long serialVersionUID = -1;
+public class InvalidConfigValueException extends ConfigException {
public InvalidConfigValueException(String msg) {
super(msg);
}
-
}
Modified: trunk/freenet/src/freenet/config/NodeNeedRestartException.java
===================================================================
--- trunk/freenet/src/freenet/config/NodeNeedRestartException.java
2008-08-14 15:28:20 UTC (rev 21845)
+++ trunk/freenet/src/freenet/config/NodeNeedRestartException.java
2008-08-14 15:42:55 UTC (rev 21846)
@@ -10,8 +10,7 @@
* it merely means that there are no immediately detectable problems with
* it.
*/
-public class NodeNeedRestartException extends Exception {
- private static final long serialVersionUID = -1;
+public class NodeNeedRestartException extends ConfigException {
public NodeNeedRestartException(String msg) {
super(msg);