Hi,

there is a bug in ExtendedProperties.subset() in combination with comma
delimited
strings.

Define:
test.prop1 = Hey\, thats a bug

call conf.getString("test.prop1") will return "Hey, thats a bug" -> thats
fine.

but:

Configuration newConf = conf.subset("test")
String str = newConf.getString("prop1")

will throw a ClassCastException, because a Vector is now stored under key
"prop1".

The problem is, that reading the property at startup removes the "\", so the
value has no escaped "," inside anymore.
In subset() the unescaped String is read and added to the Configuration with
addProperty(). There the PropertyTokenizer is
used which splits the String because there are no escaped "," *bang*

Any solutions ?

subset() should call another Method that avoids using PropertyTokenizer ...

I have extended the test case for this class (but in a very dirty manner ;)
Just to show what is expected.

bye
Thomas

TestExtendedProperties.java

Reply via email to