Pierre van Rooden wrote: > Michiel Meeuwissen wrote: > > >There was some argument for BridgeExceptions not being explicitely thrown, > >but it has escaped me... > > > > > The argument is that quite a number of methods may, at some time, throw > an exception, and you would essentially need to enclose all calls to the > bridge in try/catch block just to be able to compile. > At the time that didn't seem desirable as the idea of the bridge was, at > that time, to act as a scripting language.
Throwing runtime exceptions can of course be defended (see eg. http://www.mindview.net/Etc/Discussions/CheckedExceptions). Whether we agree or not, it does anyhow not take away that it would perhaps be nice if it at least would be clearly documented if and when this may happen, perhaps only with the @throws javadoc tag, or with the throws keyword. Actually this happens already here and there for the BridgeException extensions 'NotFoundException' and 'AlreadyExistsException'. I think we should simply consider it a bug if there are methods which can throw some BridgeException but do not document that. So, this thread was initiated because of Node#commit and so on. I suppose these can wrap a StorageException in a BridgeException, and this should be explicitely noted in the javadoc. Runtime exceptions most commonly occur for programming errors (NPE, ClastCastException...). Such onces should of course not be documented, but solved.... Michiel -- Michiel Meeuwissen mihxil' Mediacentrum 140 H'sum [] () +31 (0)35 6772979 nl_NL eo_XX en_US _______________________________________________ Developers mailing list [email protected] http://lists.mmbase.org/mailman/listinfo/developers
