persistence@glassfish.java.net

Re: EJBQL: fixing NPE in not equals expression

From: Tom Ware <tom.ware_at_oracle.com>
Date: Wed, 07 Dec 2005 09:08:29 -0500

Michael,

  'looks good. Go ahead and check in.

-Tom

Michael Bouschen wrote:

>Hi Tom,
>
>there is a bug in the EJBQL compiler causing a NullPointerException in
>the code handling a not equals expression. It occurs in case the right
>hand side of the not equals is a more complicated expression requiring
>its own helper during parse tree creation. Here is an example:
> co.totalPrice <> ALL (Select MIN(o.totalPrice) FROM Order o)
>The generate parse tree is not correct, because the NotNode is created
>as a child node of the EqualsNode. So the NotNode does not have a child
>node which results in the NPE.
>
>Attached you find a fix, where I introduced a new node NotEqualsNode.
>Please have a look.
>
>Thanks!
>
>Regards Michael
>
>