[jdom-interest] detach() [eg]

Joseph Bowbeer jozart at csi.com
Sat Apr 28 11:37:02 PDT 2001

edward.kenworthy writes:

> Thirdly, Document isn't a bean so I fail to see why it should be
> constrained to behave like one.

I never said constrained; I was talking about degrees of comfort.  Behaving
as users expect makes our API more intuitive.  User's wouldn't expect that a
"getter" of what looks to be a simple property might throw an ISE.

State-Testing Method of Illegal State?

A more serious objection is the apparent absence of a state-testing method.
I haven't seen concrete code for the ISE Document idea (hint hint), but as
far as I can tell, the idea is that every accessor except setRootElement can
throw ISE and that we aren't providing any direct way for the user to test
if the Document is in an illegal state.

This sounds broken to me.  To fix this, we'd either need to let
getRootElement return null, or we'd need to add a separate state-testing
method.  Which one should it be?  Note that if getRootElement is allowed to
return null, then ISE has lost much of its fail-fast capability (right?).

Joe Bowbeer

More information about the jdom-interest mailing list