spring-projects / spring-framework

Spring Framework
https://spring.io/projects/spring-framework
Apache License 2.0
56.62k stars 38.13k forks source link

requiredUniqueResult in DataAccessUtils returns (!!) IncorrectResultSizeDataAccessException [SPR-165] #4897

Closed spring-projects-issues closed 20 years ago

spring-projects-issues commented 20 years ago

Mathias Bogaert opened SPR-165 and commented

Typical 'tired developer and rapid release'-type of bug: instead of throwing the exception, returning the instance: return new IncorrectResultSizeDataAccessException(1, 0);. This breaks the requiredUniqueResult method.


No further details from SPR-165

spring-projects-issues commented 20 years ago

Juergen Hoeller commented

Thanks for spotting this! I guess your interpretation of the origin of the bug is quite on spot ;-)

DataAccessUtils.uniqueResult is the one that's used by other framework classes, so works and is tested. Unfortunately, the new DataAccessUtils.requiredUniqueResult method was not used or tested anywhere.

Juergen