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=31540>.
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=31540

[Configuration] Property throwExceptionOnMissing is not respected for subsets

           Summary: [Configuration] Property throwExceptionOnMissing is not
                    respected for subsets
           Product: Commons
           Version: 1.0 Beta 2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Critical
          Priority: Other
         Component: Configuration
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


public void testNoSuchElementExceptionFoSubsets() {
    BaseConfiguration config = new BaseConfiguration();
    config.setThrowExceptionOnMissing(true);
    config.addProperty("subset.foo", "bar");
    try {
        config.getString("subset.foobar");
        fail("NoSuchElementException expected");
    } catch(NoSuchElementException e) {
        // expected
    }
    try {
        config.subset("subset").getString("foobar");
        fail("NoSuchElementException expected");
    } catch(NoSuchElementException e) {
        // expected
    }
}

This behaviour is currently a showstopper, since I rely on the thrown exception.
Note: subset() returns a plain Configuration interface, that does not have the
setThrowExceptionOnMissing setter.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to