Line 123 shows:
{code: title= AbstractPathImpl.java |borderStyle=solid } SingularAttributePath<Y> path = (SingularAttributePath<Y>) resolveCachedAttributePath( attribute.getName() ); {code}
The assumption that attribute is not null might not be valid.
It would be helpful if an exception was thrown to indicate an unexpected null attribute.
Something like:
{code: title= AbstractPathImpl.java |borderStyle=solid } public <Y> Path<Y> get(SingularAttribute<? super X, Y> attribute) { if ( ! canBeDereferenced() ) { throw illegalDereference(); }
if( attribute == null ) { throw new MissingAttributeException( "SingularAttribute is null." ); }
SingularAttributePath<Y> path = (SingularAttributePath<Y>) resolveCachedAttributePath( attribute.getName() ); if ( path == null ) { path = new SingularAttributePath<Y>( criteriaBuilder(), attribute.getJavaType(), getPathSourceForSubPaths(), attribute ); registerAttributePath( attribute.getName(), path ); } return path; } {code}
A more helpful message to assist with isolating the issue would be fantastic. |
|