Projectable.uniqueResult() Javadoc does not discuss what happens if no match is found
Bug #705527 reported by
cowwoc
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Querydsl |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Projectable.
Projectable.
have Javadoc but do not discuss what happens if no match is found. Does the method return an empty array? Does it return null? Does it throw an exception?
I suggest returning an empty array or list instead of null whenever possible (as suggested by the Effective Java book).
To post a comment you must log in.
I updated the javadocs
Projectable. uniqueResult( Expression< ?>[])
* returns an array with the size of the Expression array or null for no result
Projectable. uniqueResult( Expression< ?>[], Expression<?>[], Expression<?>[]...)
* returns an array with the combined size of the Expression arrays or null for no result
Return empty arrays for null results would be confusing in this case, but in cases returning multiple results as Collection types, no null results are returned.