Issue Details (XML | Word | Printable)

Key: NUCJPA-120
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Unassigned
Reporter: FireSign
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
DataNucleus API JPA

Incomplete JPA Query causes NPE

Created: 21/Mar/11 09:09 PM   Updated: 13/Aug/12 03:16 PM   Resolved: 01/Apr/11 05:24 PM
Component/s: API
Affects Version/s: 2.1.7
Fix Version/s: 3.0.0.m3

File Attachments: 1. Zip Archive jpa-query-npe.zip (4 kB)

Environment:
Windows XP, Java 1.6.0_21-b07

Datastore: HSQL
Severity: Proof of Concept


 Description  « Hide
The following JPA Query is incomplete, and throws a NullPointerException.
Expected behaviour: some more meaningful Exception.

"select p from Product"

Exception in thread "main" java.lang.NullPointerException
at org.datanucleus.query.compiler.JavaQueryCompiler.getType(JavaQueryCompiler.java:970)
at org.datanucleus.query.compiler.JavaQueryCompiler.getType(JavaQueryCompiler.java:947)
at org.datanucleus.query.symbol.SymbolTable.getType(SymbolTable.java:162)
at org.datanucleus.query.expression.PrimaryExpression.bind(PrimaryExpression.java:129)
at org.datanucleus.query.compiler.JavaQueryCompiler.compileResult(JavaQueryCompiler.java:653)
at org.datanucleus.query.compiler.JPQLCompiler.compile(JPQLCompiler.java:83)
at org.datanucleus.store.query.AbstractJPQLQuery.compileInternal(AbstractJPQLQuery.java:240)
at org.datanucleus.store.rdbms.query.JPQLQuery.compileInternal(JPQLQuery.java:191)
at org.datanucleus.store.query.Query.executeQuery(Query.java:1663)
at org.datanucleus.store.query.Query.executeWithMap(Query.java:1554)
at org.datanucleus.jpa.JPAQuery.getResultList(JPAQuery.java:171)

FireSign added a comment - 21/Mar/11 09:10 PM
Attaching test program.

FireSign made changes - 21/Mar/11 09:10 PM
Field Original Value New Value
Attachment jpa-query-npe.zip [ 11395 ]
Andy Jefferson added a comment - 01/Apr/11 05:24 PM
Current SVN gives a correct user-error exception.

Andy Jefferson made changes - 01/Apr/11 05:24 PM
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 3.0.0.m3 [ 11193 ]
Resolution Fixed [ 1 ]
Andy Jefferson made changes - 14/Jun/11 12:27 PM
Status Resolved [ 5 ] Closed [ 6 ]
Andy Jefferson made changes - 13/Aug/12 03:16 PM
Component/s API [ 10181 ]
Component/s Queries [ 10180 ]