commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Allen, Justin" <Justin.Al...@Teradata.com>
Subject PropertiesConfiguration returning duplicate values from
Date Mon, 29 Mar 2010 21:56:28 GMT
Hi,

I'm looking to get some insight on why I'm getting some unexpected
output from the method getList() from the class PropertiesConfiguration
as part of the commons-configuration-1.6 java lib.

This line of code produces duplicate values in the returned list loaded
from my applications property file:

PropertiesConfiguration myAppProps= new
PropertiesConfiguration(MY_APP_FILE);
myAppProps.load();
MyController ctrl = MyController.getInstance();
ctrl.setAlertOnLamb(myAppProps.getBoolean("foo.fighter"));
ctrl.setAlertOnRpe(myAppProps.getBoolean("bar.high"));
ctrl.setMyBazNamesList(myAppProps.getList("baz.names"));

System.out.println("This is the baz list: " +
myAppProps.getList("baz.names"));


Application Output is:

This is the baz list: [larry, curly, moe, larry, curly, moe]


This is the underlying property file which is loaded by the
PropertiesConfiguration class:

#############################################################
# Properties Configuration File for myApp
#############################################################

#Set this value for foo
foo.fighter = false

#Set this value for bar
bar.high = false

#List of baz names
baz.names = larry, curly, moe



Any reason why this would produce a list with duplicate entries? This
doesn't appear to be normal behavior according to the documentation on
this class. Let me know if there is any more information I can provide
to clarify this bug, I'm getting.

Thanks for looking into this,

Justin Allen




Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message