AbstractPreferences.java (isUserNode): Implemented.
authorTom Tromey <tromey@redhat.com>
Mon, 24 Feb 2003 21:20:19 +0000 (21:20 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Mon, 24 Feb 2003 21:20:19 +0000 (21:20 +0000)
* java/util/prefs/AbstractPreferences.java (isUserNode):
Implemented.

From-SVN: r63382

libjava/ChangeLog
libjava/java/util/prefs/AbstractPreferences.java

index c6346ef3886dae2bd88b2dc29493dd9b43a624d5..fb5c10fa47eec6826b9ff4aa83e2b6fc6d37fd14 100644 (file)
@@ -1,3 +1,8 @@
+2003-02-24  Tom Tromey  <tromey@redhat.com>
+
+       * java/util/prefs/AbstractPreferences.java (isUserNode):
+       Implemented.
+
 2003-02-24  Tom Tromey  <tromey@redhat.com>
 
        * java/lang/ClassLoader.java (defineClass(byte[],int,int)):
index 98e87ebc83a18b47729849f033726fed15d0f6f4..d192c1f671717754cae4964dcd915d7ccc21d410 100644 (file)
@@ -1,5 +1,5 @@
 /* AbstractPreferences - Partial implementation of a Preference node
-   Copyright (C) 2001 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2003 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -51,8 +51,6 @@ import gnu.java.util.prefs.NodeWriter;
 /**
  * Partial implementation of a Preference node.
  *
- * Methods that still need to be implemented are <code>isUserNode(), XXX
- *
  * @since 1.4
  * @author Mark Wielaard (mark@klomp.org)
  */
@@ -158,7 +156,12 @@ public abstract class AbstractPreferences extends Preferences {
      * Returns true if this node comes from the user preferences tree, false
      * if it comes from the system preferences tree.
      */
-    abstract public boolean isUserNode();
+    public boolean isUserNode() {
+        AbstractPreferences root = this;
+       while (root.parent != null)
+           root = root.parent;
+       return root == Preferences.userRoot();
+    }
 
     /**
      * Returns the name of this preferences node. The name of the node cannot