ScrollableResultsIterator returns Object array instead of single result

Description

I've run into a problem while trying to invoke stream() method on query returning javax.persistence.Tuple object. Returned value was object array consisting of single Tuple object instead of just that Tuple object. Attached is changed TupleCriteriaTest with test method testTupleWithStream that will fail.
Problem is caused because getNumberOfTypes() from ScrollableResultsImplementor invoked from ScrollableResultsIterator is returning value > 1 while get() is returning array of length 1.

Changing line in ScrollableResultsIterator from

if ( scrollableResults.getNumberOfTypes() == 1 ) {

to

if ( scrollableResults.get().length == 1 ) {

will solve problem for that particular test case, but I do not know if this can cause problems elsewhere.

Environment

None

Assignee

Unassigned

Reporter

Cedomir Igaly

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Minor
Configure