From: Keats K. <kea...@na...> - 2002-11-25 06:14:23
|
+1 for the change. It has always bothered me that an exception in an #if is evaluated as false. It seems like you could still choose to not throw in the DfltEEH if you wanted to preserve backwards compatability, but I'd vote against it. Keats Eric B. Ridge wrote: > On Friday, November 22, 2002, at 07:22 AM, Endre Stølsvik wrote: > >> Shouldn't the cranky-dude kick on _everything_?? > > > I've spent some time looking at this, and I'm changing it, but the > "fix" has an interesting side effect when using the > DefaultEvaluationExceptionHandler. > > Currently, #if (b/c of Expression.java) treats all expressions that > throw as "false". When using CrankyEEH, this isn't good because you > miss the exceptions (as Endre reported). The solution is to make > Expression.java (and IfDirective) honor whatever EEH says to do. > > However, with Endre's examples, WM is throwing > PropertyException.NoSuchMethodException. This is an exception that > DefaultEEH also wants to throw. So, with this fix, CrankyEEH and > DefaultEEH both will throw when when you #if ($foo.noSuchMethod()), > whereas previously, because the exception was being treated as "false", > neither would throw. > > I think this is a GoodThing, but it's important to note because people > that rely on this behavior with #if/DefaultEEH (default configuration > of WM) will start getting exceptions where previously they did not. If > nothing else, at least now NoSuchMethodException is being handled > consistently. > > If anyone thinks this is bad, please yell. > > eric |