eq throws NPE from ConstantImpl

Bug #720078 reported by Vesa Marttila
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Querydsl
Fix Released
Undecided
Unassigned

Bug Description

With an expression such as id.eq(null) the following exception is thrown:

java.lang.NullPointerException
        at com.mysema.query.types.ConstantImpl.<init>(ConstantImpl.java:124)
        at com.mysema.query.types.expr.SimpleExpression.eq(SimpleExpression.java:130)

This is due to this constructor:

public ConstantImpl(T constant){
    this((Class)constant.getClass(), constant);
}

The problem occurs at least in the Lucene module.

Revision history for this message
Timo Westkämper (timo-westkamper) wrote :

Ok, we need a more descriptive Exception for this.

id.eq(null) is not allowed, for "id is null" you need to use id.isNull()

Revision history for this message
Timo Westkämper (timo-westkamper) wrote :

The Exception is now : throw new IllegalArgumentException("eq(null) is not allowed. Use isNull() instead");

Changed in querydsl:
status: New → Fix Committed
Revision history for this message
Timo Westkämper (timo-westkamper) wrote :

Released in 2.1.2

Changed in querydsl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.