Buggy code:
public abstract class SessionFactoryUtils { public static final int SESSION_SYNCHRONIZATION_ORDER = ( DataSourceUtils . CONNECTION_SYNCHRONIZATION_ORDER ) - 100 ; static final Log logger = LogFactory . getLog ( SessionFactoryUtils . class ) ; private static final ThreadLocal < Map < SessionFactory , Set < Session > > > deferredCloseHolder = new org . springframework . core . NamedThreadLocal < Map < SessionFactory , Set < Session > > > ( "Hibernate<seq2seq4repair_space>Sessions<seq2seq4repair_space>registered<seq2seq4repair_space>for<seq2seq4repair_space>deferred<seq2seq4repair_space>close" ) ; public static DataSource getDataSource ( SessionFactory sessionFactory ) { } public static SQLExceptionTranslator newJdbcExceptionTranslator ( SessionFactory sessionFactory ) { } public static TransactionManager getJtaTransactionManager ( SessionFactory sessionFactory , Session session ) { } public static Session getSession ( SessionFactory sessionFactory , boolean allowCreate ) throws IllegalStateException , DataAccessResourceFailureException { } public static Session getSession ( SessionFactory sessionFactory , Interceptor entityInterceptor , SQLExceptionTranslator jdbcExceptionTranslator ) throws DataAccessResourceFailureException { } public static Session doGetSession ( SessionFactory sessionFactory , boolean allowCreate ) throws IllegalStateException , HibernateException { } private static Session doGetSession ( SessionFactory sessionFactory , Interceptor entityInterceptor , SQLExceptionTranslator jdbcExceptionTranslator , boolean allowCreate ) throws IllegalStateException , HibernateException { } private static Session getJtaSynchronizedSession ( SessionHolder sessionHolder , SessionFactory sessionFactory , SQLExceptionTranslator jdbcExceptionTranslator ) throws DataAccessResourceFailureException { } private static void registerJtaSynchronization ( Session session , SessionFactory sessionFactory , SQLExceptionTranslator jdbcExceptionTranslator , SessionHolder sessionHolder ) { } public static Session getNewSession ( SessionFactory sessionFactory ) { } public static Session getNewSession ( SessionFactory sessionFactory , Interceptor entityInterceptor ) { } public static String toString ( Session session ) { } public static boolean hasTransactionalSession ( SessionFactory sessionFactory ) { } public static boolean isSessionTransactional ( Session session , SessionFactory sessionFactory ) { } public static void applyTransactionTimeout ( Query query , SessionFactory sessionFactory ) { } public static void applyTransactionTimeout ( Criteria criteria , SessionFactory sessionFactory ) { } public static DataAccessException convertHibernateAccessException ( HibernateException ex ) { if ( ex instanceof JDBCConnectionException ) { return new DataAccessResourceFailureException ( ex . getMessage ( ) , ex ) ; } if ( ex instanceof SQLGrammarException ) { SQLGrammarException jdbcEx = ( ( SQLGrammarException ) ( ex ) ) ; return new org . springframework . dao . InvalidDataAccessResourceUsageException ( ( ( ( ( ex . getMessage ( ) ) + ";<seq2seq4repair_space>SQL<seq2seq4repair_space>[" ) + ( jdbcEx . getSQL ( ) ) ) + "]" ) , ex ) ; } if ( ex instanceof LockAcquisitionException ) { LockAcquisitionException jdbcEx = ( ( LockAcquisitionException ) ( ex ) ) ; return new org . springframework . dao . CannotAcquireLockException ( ( ( ( ( ex . getMessage ( ) ) + ";<seq2seq4repair_space>SQL<seq2seq4repair_space>[" ) + ( jdbcEx . getSQL ( ) ) ) + "]" ) , ex ) ; } if ( ex instanceof ConstraintViolationException ) { ConstraintViolationException jdbcEx = ( ( ConstraintViolationException ) ( ex ) ) ; return new org . springframework . dao . DataIntegrityViolationException ( ( ( ( ( ( ( ex . getMessage ( ) ) + ";<seq2seq4repair_space>SQL<seq2seq4repair_space>[" ) + ( jdbcEx . getSQL ( ) ) ) + "];<seq2seq4repair_space>constraint<seq2seq4repair_space>[" ) + ( jdbcEx . getConstraintName ( ) ) ) + "]" ) , ex ) ; } if ( ex instanceof DataException ) { DataException jdbcEx = ( ( DataException ) ( ex ) ) ; return new org . springframework . dao . DataIntegrityViolationException ( ( ( ( ( ex . getMessage ( ) ) + ";<seq2seq4repair_space>SQL<seq2seq4repair_space>[" ) + ( jdbcEx . getSQL ( ) ) ) + "]" ) , ex ) ; } if ( ex instanceof JDBCException ) { return new HibernateJdbcException ( ( ( JDBCException ) ( ex ) ) ) ; } if ( ex instanceof PropertyValueException ) { return new org . springframework . dao . DataIntegrityViolationException ( ex . getMessage ( ) , ex ) ; } if ( ex instanceof PersistentObjectException ) { return new org . springframework . dao . InvalidDataAccessApiUsageException ( ex . getMessage ( ) , ex ) ; } if ( ex instanceof TransientObjectException ) { return new org . springframework . dao . InvalidDataAccessApiUsageException ( ex . getMessage ( ) , ex ) ; } if ( ex instanceof ObjectDeletedException ) { return new org . springframework . dao . InvalidDataAccessApiUsageException ( ex . getMessage ( ) , ex ) ; } if ( ex instanceof QueryException ) { return new HibernateQueryException ( ( ( QueryException ) ( ex ) ) ) ; } if ( ex instanceof UnresolvableObjectException ) { return new HibernateObjectRetrievalFailureException ( ( ( UnresolvableObjectException ) ( ex ) ) ) ; } if ( ex instanceof WrongClassException ) { return new HibernateObjectRetrievalFailureException ( ( ( WrongClassException ) ( ex ) ) ) ; } if ( ex instanceof NonUniqueResultException ) { <START_BUG> return new org . springframework . dao . IncorrectResultSizeDataAccessException ( ex . getMessage ( ) , 1 ) ; <END_BUG> } if ( ex instanceof StaleObjectStateException ) { return new HibernateOptimisticLockingFailureException ( ( ( StaleObjectStateException ) ( ex ) ) ) ; } if ( ex instanceof StaleStateException ) { return new HibernateOptimisticLockingFailureException ( ( ( StaleStateException ) ( ex ) ) ) ; } return new HibernateSystemException ( ex ) ; } public static boolean isDeferredCloseActive ( SessionFactory sessionFactory ) { } public static void initDeferredClose ( SessionFactory sessionFactory ) { } public static void processDeferredClose ( SessionFactory sessionFactory ) { } public static void releaseSession ( Session session , SessionFactory sessionFactory ) { } static void closeSessionOrRegisterDeferredClose ( Session session , SessionFactory sessionFactory ) { } public static void closeSession ( Session session ) { } }

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