Buggy code:
@ SuppressWarnings ( "serial" ) public class PersistenceAnnotationBeanPostProcessor implements Serializable , BeanFactoryAware , DestructionAwareBeanPostProcessor , InstantiationAwareBeanPostProcessor , MergedBeanDefinitionPostProcessor , PriorityOrdered { private static final Method synchronizationTypeAttribute = ClassUtils . getMethodIfAvailable ( PersistenceContext . class , "synchronizationType" ) ; private Object jndiEnvironment ; private boolean resourceRef = true ; private transient Map < String , String > persistenceUnits ; private transient Map < String , String > persistenceContexts ; private transient Map < String , String > extendedPersistenceContexts ; private transient String defaultPersistenceUnitName = "" ; private int order = ( Ordered . LOWEST_PRECEDENCE ) - 4 ; private transient ListableBeanFactory beanFactory ; private transient final Map < String , InjectionMetadata > injectionMetadataCache = new ConcurrentHashMap < String , InjectionMetadata > ( 64 ) ; private final Map < Object , EntityManager > extendedEntityManagersToClose = new ConcurrentHashMap < Object , EntityManager > ( 16 ) ; public void setJndiTemplate ( Object jndiTemplate ) { } public void setJndiEnvironment ( Properties jndiEnvironment ) { } public void setResourceRef ( boolean resourceRef ) { } public void setPersistenceUnits ( Map < String , String > persistenceUnits ) { } public void setPersistenceContexts ( Map < String , String > persistenceContexts ) { } public void setExtendedPersistenceContexts ( Map < String , String > extendedPersistenceContexts ) { } public void setDefaultPersistenceUnitName ( String unitName ) { } public void setOrder ( int order ) { } @ Override public int getOrder ( ) { } @ Override public void setBeanFactory ( BeanFactory beanFactory ) { } @ Override public void postProcessMergedBeanDefinition ( RootBeanDefinition beanDefinition , Class < ? > beanType , String beanName ) { } @ Override public Object postProcessBeforeInstantiation ( Class < ? > beanClass , String beanName ) throws BeansException { } @ Override public boolean postProcessAfterInstantiation ( Object bean , String beanName ) throws BeansException { } @ Override public PropertyValues postProcessPropertyValues ( PropertyValues pvs , PropertyDescriptor [ ] pds , Object bean , String beanName ) throws BeansException { } @ Override public Object postProcessBeforeInitialization ( Object bean , String beanName ) throws BeansException { } @ Override public Object postProcessAfterInitialization ( Object bean , String beanName ) throws BeansException { } @ Override public void postProcessBeforeDestruction ( Object bean , String beanName ) throws BeansException { } private InjectionMetadata findPersistenceMetadata ( String beanName , final Class < ? > clazz ) { String cacheKey = ( StringUtils . hasLength ( beanName ) ) ? beanName : clazz . getName ( ) ; InjectionMetadata metadata = this . injectionMetadataCache . get ( cacheKey ) ; if ( InjectionMetadata . needsRefresh ( metadata , clazz ) ) { synchronized ( this . injectionMetadataCache ) { metadata = this . injectionMetadataCache . get ( cacheKey ) ; if ( InjectionMetadata . needsRefresh ( metadata , clazz ) ) { LinkedList < InjectionMetadata . InjectedElement > elements = new LinkedList < InjectionMetadata . InjectedElement > ( ) ; Class < ? > targetClass = clazz ; do { LinkedList < InjectionMetadata . InjectedElement > currElements = new LinkedList < InjectionMetadata . InjectedElement > ( ) ; for ( Field field : targetClass . getDeclaredFields ( ) ) { PersistenceContext pc = field . getAnnotation ( PersistenceContext . class ) ; PersistenceUnit pu = field . getAnnotation ( PersistenceUnit . class ) ; if ( ( pc != null ) || ( pu != null ) ) { if ( Modifier . isStatic ( field . getModifiers ( ) ) ) { throw new IllegalStateException ( "Persistence<seq2seq4repair_space>annotations<seq2seq4repair_space>are<seq2seq4repair_space>not<seq2seq4repair_space>supported<seq2seq4repair_space>on<seq2seq4repair_space>static<seq2seq4repair_space>fields" ) ; } currElements . add ( new PersistenceAnnotationBeanPostProcessor . PersistenceElement ( field , null ) ) ; } } for ( Method method : targetClass . getDeclaredMethods ( ) ) { PersistenceContext pc = method . getAnnotation ( PersistenceContext . class ) ; PersistenceUnit pu = method . getAnnotation ( PersistenceUnit . class ) ; <START_BUG> if ( ( ( pc != null ) || ( pu != null ) ) && ( method . equals ( ClassUtils . getMostSpecificMethod ( method , clazz ) ) ) ) { <END_BUG> if ( Modifier . isStatic ( method . getModifiers ( ) ) ) { throw new IllegalStateException ( "Persistence<seq2seq4repair_space>annotations<seq2seq4repair_space>are<seq2seq4repair_space>not<seq2seq4repair_space>supported<seq2seq4repair_space>on<seq2seq4repair_space>static<seq2seq4repair_space>methods" ) ; } if ( ( method . getParameterTypes ( ) . length ) != 1 ) { throw new IllegalStateException ( ( "Persistence<seq2seq4repair_space>annotation<seq2seq4repair_space>requires<seq2seq4repair_space>a<seq2seq4repair_space>single-arg<seq2seq4repair_space>method:<seq2seq4repair_space>" + method ) ) ; } PropertyDescriptor pd = BeanUtils . findPropertyForMethod ( method ) ; currElements . add ( new PersistenceAnnotationBeanPostProcessor . PersistenceElement ( method , pd ) ) ; } } elements . addAll ( 0 , currElements ) ; targetClass = targetClass . getSuperclass ( ) ; } while ( ( targetClass != null ) && ( targetClass != ( Object . class ) ) ) ; metadata = new InjectionMetadata ( clazz , elements ) ; this . injectionMetadataCache . put ( cacheKey , metadata ) ; } } } return metadata ; } protected EntityManagerFactory getPersistenceUnit ( String unitName ) { } protected EntityManager getPersistenceContext ( String unitName , boolean extended ) { } protected EntityManagerFactory findEntityManagerFactory ( String unitName , String requestingBeanName ) throws NoSuchBeanDefinitionException { } protected EntityManagerFactory findNamedEntityManagerFactory ( String unitName , String requestingBeanName ) throws NoSuchBeanDefinitionException { } protected EntityManagerFactory findDefaultEntityManagerFactory ( String requestingBeanName ) throws NoSuchBeanDefinitionException { } protected < T > T lookup ( String jndiName , Class < T > requiredType ) throws Exception { } private class LocatorDelegate { public < T > T lookup ( String jndiName , Class < T > requiredType ) throws Exception { } } private class PersistenceElement extends InjectionMetadata . InjectedElement { private final String unitName ; private PersistenceContextType type ; private boolean synchronizedWithTransaction = false ; private Properties properties ; public PersistenceElement ( Member member , PropertyDescriptor pd ) { } @ Override protected Object getResourceToInject ( Object target , String requestingBeanName ) { } private EntityManagerFactory resolveEntityManagerFactory ( String requestingBeanName ) { } private EntityManager resolveEntityManager ( String requestingBeanName ) { }

Fix:
if ( ( ( ( pc != null ) || ( pu != null ) ) && ( ! ( method . isBridge ( ) ) ) ) && ( method . equals ( ClassUtils . getMostSpecificMethod ( method , clazz ) ) ) ) {