Community
Participate
Working Groups
See Summary. Steps to reproduce (assert* methods from JUnit): EntityManagerFactory emf = ... // get an EMF EntityManager em = emf.createEntityManager(); assertNotNull(em); final Query q = em.createNamedQuery("someValidNamedQueryWithoutParameters"); assertNotNull(q); q.getParameters(); // observe NPE
Created attachment 195551 [details] Proposed fix, and testcase Moved existing HashMap creation to be initial statement within control statement for lazy initialization.
Update to EJBQueryImpl getInternalParameters() - Move instantiation of 'parameters' HashMap to initial statement in lazy initialization control structure to prevent a NullPointerException occurring in the situation where a query has zero parameters. - Test emptyParametersForNonParameterizedNamedQueryTest added to JUnitJPQLParameterTestSuite Reviewed: Andrei Ilitchev Testing: Core LRG JPA LRG Checked into trunk (2.3) at r9377
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink