Store the current year at time of release in the source code
[Sone.git] / src / main / java / net / pterodactylus / sone / main / SonePlugin.java
index 957103b..ff72f86 100644 (file)
@@ -61,7 +61,7 @@ import com.google.inject.spi.InjectionListener;
 import com.google.inject.spi.TypeEncounter;
 import com.google.inject.spi.TypeListener;
 
-import freenet.client.async.DatabaseDisabledException;
+import freenet.client.async.PersistenceDisabledException;
 import freenet.l10n.BaseL10n.LANGUAGE;
 import freenet.l10n.PluginL10n;
 import freenet.node.Node;
@@ -87,6 +87,7 @@ public class SonePlugin implements FredPlugin, FredPluginFCP, FredPluginL10n, Fr
        static {
                /* initialize logging. */
                Logger soneLogger = getLogger("Sone");
+               soneLogger.setUseParentHandlers(false);
                soneLogger.addHandler(new Handler() {
                        @Override
                        public void publish(LogRecord logRecord) {
@@ -115,7 +116,10 @@ public class SonePlugin implements FredPlugin, FredPluginFCP, FredPluginL10n, Fr
        }
 
        /** The version. */
-       public static final Version VERSION = new Version(0, 8, 9);
+       public static final Version VERSION = new Version("rc1", 0, 9);
+
+       /** The current year at time of release. */
+       private static final int YEAR = 2015;
 
        /** The logger. */
        private static final Logger logger = getLogger("Sone.Plugin");
@@ -169,6 +173,10 @@ public class SonePlugin implements FredPlugin, FredPluginFCP, FredPluginL10n, Fr
                return l10n;
        }
 
+       public static int getYear() {
+               return YEAR;
+       }
+
        //
        // FREDPLUGIN METHODS
        //
@@ -200,7 +208,7 @@ public class SonePlugin implements FredPlugin, FredPluginFCP, FredPluginL10n, Fr
                        try {
                                oldConfiguration = new Configuration(new PluginStoreConfigurationBackend(pluginRespirator));
                                logger.log(Level.INFO, "Plugin store loaded.");
-                       } catch (DatabaseDisabledException dde1) {
+                       } catch (PersistenceDisabledException pde1) {
                                logger.log(Level.SEVERE, "Could not load any configuration, using empty configuration!");
                                oldConfiguration = new Configuration(new MapConfigurationBackend());
                        }