From: Eric B. R. <eb...@tc...> - 2002-11-25 06:42:43
|
On Monday, November 25, 2002, at 01:14 AM, Keats Kirsch wrote: > +1 for the change. > > It has always bothered me that an exception in an #if is evaluated as=20= > 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. Ditto, because changing DEEH would change it for normal variable=20 references also. eric > > Keats > > Eric B. Ridge wrote: > > On Friday, November 22, 2002, at 07:22 AM, Endre St=F8lsvik 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=20 > "false", > > neither would throw. > > > > I think this is a GoodThing, but it's important to note because=20 > people > > that rely on this behavior with #if/DefaultEEH (default=20 > configuration > > of WM) will start getting exceptions where previously they did not.=20= > If > > nothing else, at least now NoSuchMethodException is being handled > > consistently. > > > > If anyone thinks this is bad, please yell. > > > > eric > > > |