Bug in childrenNames() api for Preference class?  
Author Message
uprakash





PostPosted: 2004-6-9 18:48:00 Top

java-programmer, Bug in childrenNames() api for Preference class? Hi,

The following code trhrows an Illegal Argument Exception.

import java.uitl.prefs.*;

try{
String xyz[] = (Preferences.userRoot()).childrenNames();
} catch (Exception e) {
e.printStackTrace();
}

The exception caught is :
java.lang.IllegalArgumentException: String length must be a multiple
of four.
at java.util.prefs.Base64.base64ToByteArray(Base64.java:134)
at java.util.prefs.Base64.altBase64ToByteArray(Base64.java:126)
at java.util.prefs.FileSystemPreferences.nodeName(FileSystemPreferences.java:859)
at java.util.prefs.FileSystemPreferences.access$1900(FileSystemPreferences.java:33)
at java.util.prefs.FileSystemPreferences$10.run(FileSystemPreferences.java:640)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.prefs.FileSystemPreferences.childrenNamesSpi(FileSystemPreferences.java:632)
at java.util.prefs.AbstractPreferences.childrenNames(AbstractPreferences.java:699)
at test.main(test.java:9)

Is this a BUG in java?
My requirement is that I have many NODES under the root node of user
preferences(userRoot).I want the list of nodes, for futher
processing.How do i retrieve them?

Please help.
(Also send a cc to my email:email***@***.com)
Thanks,
Prakash.
 
Liz





PostPosted: 2004-6-10 4:15:00 Top

java-programmer >> Bug in childrenNames() api for Preference class?
"Prakash" <email***@***.com> wrote in message
news:email***@***.com...
> Hi,
>
> The following code trhrows an Illegal Argument Exception.

My guess is that you do not have Windows ;-)
and that it is trying to read a file and there
is something wrong with the file.

>
> import java.uitl.prefs.*;
>
> try{
> String xyz[] = (Preferences.userRoot()).childrenNames();
> } catch (Exception e) {
> e.printStackTrace();
> }
>
> The exception caught is :
> java.lang.IllegalArgumentException: String length must be a multiple
> of four.
> at java.util.prefs.Base64.base64ToByteArray(Base64.java:134)
> at java.util.prefs.Base64.altBase64ToByteArray(Base64.java:126)
> at
java.util.prefs.FileSystemPreferences.nodeName(FileSystemPreferences.java:85
9)
> at
java.util.prefs.FileSystemPreferences.access$1900(FileSystemPreferences.java
:33)
> at
java.util.prefs.FileSystemPreferences$10.run(FileSystemPreferences.java:640)
> at java.security.AccessController.doPrivileged(Native Method)
> at
java.util.prefs.FileSystemPreferences.childrenNamesSpi(FileSystemPreferences
.java:632)
> at
java.util.prefs.AbstractPreferences.childrenNames(AbstractPreferences.java:6
99)
> at test.main(test.java:9)
>
> Is this a BUG in java?
> My requirement is that I have many NODES under the root node of user
> preferences(userRoot).I want the list of nodes, for futher
> processing.How do i retrieve them?
>
> Please help.
> (Also send a cc to my email:email***@***.com)
> Thanks,
> Prakash.


 
uprakash





PostPosted: 2004-6-10 14:40:00 Top

java-programmer >> Bug in childrenNames() api for Preference class? Hi Liz,

Java is platform independent.So it should work in Linux as well.
Any other pointers in this regard would be helpful.

Thanks,
Prakash.


"Liz" <email***@***.com> wrote in message news:<QcKxc.1321$eu.299@attbi_s02>...
> "Prakash" <email***@***.com> wrote in message
> news:email***@***.com...
> > Hi,
> >
> > The following code trhrows an Illegal Argument Exception.
>
> My guess is that you do not have Windows ;-)
> and that it is trying to read a file and there
> is something wrong with the file.
>
> >
> > import java.uitl.prefs.*;
> >
> > try{
> > String xyz[] = (Preferences.userRoot()).childrenNames();
> > } catch (Exception e) {
> e.printStackTrace();
> > }
> >
> > The exception caught is :
> > java.lang.IllegalArgumentException: String length must be a multiple
> > of four.
> > at java.util.prefs.Base64.base64ToByteArray(Base64.java:134)
> > at java.util.prefs.Base64.altBase64ToByteArray(Base64.java:126)
> > at
> java.util.prefs.FileSystemPreferences.nodeName(FileSystemPreferences.java:85
> 9)
> > at
> java.util.prefs.FileSystemPreferences.access$1900(FileSystemPreferences.java
> :33)
> > at
> java.util.prefs.FileSystemPreferences$10.run(FileSystemPreferences.java:640)
> > at java.security.AccessController.doPrivileged(Native Method)
> > at
> java.util.prefs.FileSystemPreferences.childrenNamesSpi(FileSystemPreferences
> .java:632)
> > at
> java.util.prefs.AbstractPreferences.childrenNames(AbstractPreferences.java:6
> 99)
> > at test.main(test.java:9)
> >
> > Is this a BUG in java?
> > My requirement is that I have many NODES under the root node of user
> > preferences(userRoot).I want the list of nodes, for futher
> > processing.How do i retrieve them?
> >
> > Please help.
> > (Also send a cc to my email:email***@***.com)
> > Thanks,
> > Prakash.