From: Joncheng K. <ck...@sy...> - 2003-10-31 02:32:01
|
Stephen McConnell wrote: > Joncheng Kuo wrote: > >> I was looking into some TODO? in catches in the dynany package. My >> ideas is that, because many of these exceptions should not occur, we >> should probably do a signalIllegalCondition in these cases. Any >> comments? > > Why not just throw an IllegalStateException? That might be a choice. The javadoc of IllegalStateException says, "Signals that a method has been invoked at an illegal or inappropriate time. In other words, the Java environment or Java application is not in an appropriate state for the requested operation." The decision that is really important to me is that: should we throw a RuntimeException or an Error? In Java, RuntimeException is for programming errors and Error is for serious situations. However, CORBA does not use this distinction. Many methods to DynAny throw checked BadKind or Bound for programming errors. So, by principle, we can convert these checked exceptions into RuntimeExceptions. However, in many case, these exceptions should never be thrown unless there is a bug in programs (assuming JVM behaves normally). >> Besides, I also want to add a signalIllegalCondition method that >> takes an extra exception paramenter. In that way, we can put the >> cause of the illegal condition into the error to be thrown (in JDK >> 1.4). Any objection? > > As a message or as a accessible throwable cause? I'm thinking about both. The message part contains the name of the causing exception and the cause part contains the causing exception. Joncheng > > > Steve. > >> >> >> Joncheng >> >> >> >> >> >> ------------------------------------------------------- >> This SF.net email is sponsored by: SF.net Giveback Program. >> Does SourceForge.net help you be more productive? Does it >> help you create better code? SHARE THE LOVE, and help us help >> YOU! Click Here: http://sourceforge.net/donate/ >> _______________________________________________ >> openorb-devel mailing list >> ope...@li... >> https://lists.sourceforge.net/lists/listinfo/openorb-devel >> > |