You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2004/09/08 10:24:59 UTC
DO NOT REPLY [Bug 31111] New: -
Composite Configuration does not catch error on a Configuration entry
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=31111>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=31111
Composite Configuration does not catch error on a Configuration entry
Summary: Composite Configuration does not catch error on a
Configuration entry
Product: Commons
Version: 1.0 Final
Platform: All
OS/Version: All
Status: NEW
Severity: Major
Priority: Other
Component: Configuration
AssignedTo: commons-dev@jakarta.apache.org
ReportedBy: hermod.opstvedt@dnb.no
The Composite configuration getKeys() as is will return nothing if there is an
error in one of the configured entries. I think it should catch any errors, log
it (logging is by the way missing) and continue with the next. Along these
lines :
public Iterator getKeys()
{
List keys = new ArrayList();
for (Iterator i = configList.iterator(); i.hasNext();)
{
Configuration config = null;
try
{
config = (Configuration) i.next();
Iterator j = config.getKeys();
while (j.hasNext())
{
String key = (String) j.next();
if (!keys.contains(key))
{
keys.add(key);
}
}
}
catch (Exception e)
{
e.printStackTrace();
}
}
return keys.iterator();
}
Hermod
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org