On 5/7/2010 5:39 PM, Jeff Schnitzer wrote:
> I doublechecked the spec and the current Resin behavior is the proper
> behavior. I don't think this behavior has changed in the spec, so the
> old behavior was a bug. You can't use the empty operator to test for
> the existence of fields (or methods).
> As to the rationale for the spec... it does make some amount of sense,
> helping to reduce one very common type of bug (I'm getting properties
> of a ThingA and the object turns out to be a ThingB). I'm sure all
> the arguments for static typing vs duck typing apply here.
That's a bummer. I preferred the old behavior as it's closer to
because we were relying on that behavior. :)
> Note: There is nothing special about the empty operator; expressions
> are resolved as normal and then the result is tested for null or empty
> collection. If expression evaluation ever tries to access a field or
> method that doesn't exist on an object, the EL resolver throws
> PropertyNotFoundException or MethodNotFoundException.
resin-interest mailing list