Author: j16sdiz
Date: 2008-08-14 14:47:01 +0000 (Thu, 14 Aug 2008)
New Revision: 21842

Modified:
   trunk/freenet/src/freenet/node/Node.java
Log:
check getPossibleValues()

Modified: trunk/freenet/src/freenet/node/Node.java
===================================================================
--- trunk/freenet/src/freenet/node/Node.java    2008-08-14 13:45:37 UTC (rev 
21841)
+++ trunk/freenet/src/freenet/node/Node.java    2008-08-14 14:47:01 UTC (rev 
21842)
@@ -184,6 +184,16 @@
                        if (val.equals(storeType))
                                return;

+                       boolean found = false;
+                       for (String p : getPossibleValues()) {
+                               if (p.equals(val)) {
+                                       found = true;
+                                       break;
+                               }
+                       }
+                       if (!found)
+                               throw new InvalidConfigValueException("Invalid 
store type");
+                       
                        cachedStoreType = val;
                        throw new NodeNeedRestartException("Store type cannot 
be changed on the fly");
                }
@@ -195,10 +205,6 @@
                public void setPossibleValues(String[] val) {
                        throw new UnsupportedOperationException();
                }
-
-               public boolean isReadOnly() {
-                       return false;
-               }
        }

        private static class L10nCallback extends StringCallback implements 
EnumerableOptionCallback {


Reply via email to