Buggy code:
public abstract class EntityManagerFactoryUtils { public static final int ENTITY_MANAGER_SYNCHRONIZATION_ORDER = ( DataSourceUtils . CONNECTION_SYNCHRONIZATION_ORDER ) - 100 ; private static final Log logger = LogFactory . getLog ( EntityManagerFactoryUtils . class ) ; public static EntityManagerFactory findEntityManagerFactory ( ListableBeanFactory beanFactory , String unitName ) throws NoSuchBeanDefinitionException { } public static EntityManager getTransactionalEntityManager ( EntityManagerFactory emf ) throws DataAccessResourceFailureException { } public static EntityManager getTransactionalEntityManager ( EntityManagerFactory emf , Map properties ) throws DataAccessResourceFailureException { } public static EntityManager doGetTransactionalEntityManager ( EntityManagerFactory emf , Map properties ) throws PersistenceException { } private static Object prepareTransaction ( EntityManager em , EntityManagerFactory emf ) { } private static void cleanupTransaction ( Object transactionData , EntityManagerFactory emf ) { } public static void applyTransactionTimeout ( Query query , EntityManagerFactory emf ) { } public static DataAccessException convertJpaAccessExceptionIfPossible ( RuntimeException ex ) { if ( ex instanceof IllegalStateException ) { return new InvalidDataAccessApiUsageException ( ex . getMessage ( ) , ex ) ; } if ( ex instanceof IllegalArgumentException ) { return new InvalidDataAccessApiUsageException ( ex . getMessage ( ) , ex ) ; } if ( ex instanceof EntityNotFoundException ) { return new JpaObjectRetrievalFailureException ( ( ( EntityNotFoundException ) ( ex ) ) ) ; } if ( ex instanceof NoResultException ) { return new EmptyResultDataAccessException ( ex . getMessage ( ) , 1 ) ; } if ( ex instanceof NonUniqueResultException ) { <START_BUG> return new IncorrectResultSizeDataAccessException ( ex . getMessage ( ) , 1 ) ; <END_BUG> } if ( ex instanceof OptimisticLockException ) { return new JpaOptimisticLockingFailureException ( ( ( OptimisticLockException ) ( ex ) ) ) ; } if ( ex instanceof EntityExistsException ) { return new DataIntegrityViolationException ( ex . getMessage ( ) , ex ) ; } if ( ex instanceof TransactionRequiredException ) { return new InvalidDataAccessApiUsageException ( ex . getMessage ( ) , ex ) ; } if ( ex instanceof PersistenceException ) { return new JpaSystemException ( ( ( PersistenceException ) ( ex ) ) ) ; } return null ; } public static void closeEntityManager ( EntityManager em ) { } private static class EntityManagerSynchronization extends ResourceHolderSynchronization < EntityManagerHolder , EntityManagerFactory > implements Ordered { private final Object transactionData ; private final JpaDialect jpaDialect ; private final boolean newEntityManager ; public EntityManagerSynchronization ( EntityManagerHolder emHolder , EntityManagerFactory emf , Object txData , boolean newEm ) { } public int getOrder ( ) { } @ Override protected void flushResource ( EntityManagerHolder resourceHolder ) { } @ Override protected boolean shouldUnbindAtCompletion ( ) { } @ Override protected void releaseResource ( EntityManagerHolder resourceHolder , EntityManagerFactory resourceKey ) { } @ Override protected void cleanupResource ( EntityManagerHolder resourceHolder , EntityManagerFactory resourceKey , boolean committed ) { } } }

Fix:
return new IncorrectResultSizeDataAccessException ( ex . getMessage ( ) , 1 , ex ) ;