Buggy code:
public class BeanRecipe extends AbstractRecipe { static class UnwrapperedBeanHolder { final Object unwrapperedBean ; final BeanRecipe recipe ; public UnwrapperedBeanHolder ( Object unwrapperedBean , BeanRecipe recipe ) { } } public class VoidableCallable implements Callable < Object > , Voidable { private final AtomicReference < Object > ref = new AtomicReference < Object > ( ) ; private final Semaphore sem = new Semaphore ( 1 ) ; private final ThreadLocal < Object > deadlockDetector = new ThreadLocal < Object > ( ) ; public void voidReference ( ) { } public Object call ( ) throws ComponentDefinitionException { } } private static final Logger LOGGER = LoggerFactory . getLogger ( BeanRecipe . class ) ; private final ExtendedBlueprintContainer blueprintContainer ; private final LinkedHashMap < String , Object > properties = new LinkedHashMap < String , Object > ( ) ; private final Object type ; private String initMethod ; private String destroyMethod ; private List < Recipe > explicitDependencies ; private Recipe factory ; private String factoryMethod ; private List < Object > arguments ; private List < String > argTypes ; private boolean reorderArguments ; private final boolean allowsFieldInjection ; private BeanMetadata interceptorLookupKey ; public BeanRecipe ( String name , ExtendedBlueprintContainer blueprintContainer , Object type , boolean allowsFieldInjection ) { } public Object getProperty ( String name ) { } public Map < String , Object > getProperties ( ) { } public void setProperty ( String name , Object value ) { } public void setFactoryMethod ( String method ) { } public void setFactoryComponent ( Recipe factory ) { } public void setArgTypes ( List < String > argTypes ) { } public void setArguments ( List < Object > arguments ) { } public void setReorderArguments ( boolean reorder ) { } public void setInitMethod ( String initMethod ) { } public String getInitMethod ( ) { } public void setDestroyMethod ( String destroyMethod ) { } public String getDestroyMethod ( ) { } public List < Recipe > getExplicitDependencies ( ) { } public void setExplicitDependencies ( List < Recipe > explicitDependencies ) { } public void setInterceptorLookupKey ( BeanMetadata metadata ) { } @ Override public List < Recipe > getConstructorDependencies ( ) { } public List < Recipe > getDependencies ( ) { } private void instantiateExplicitDependencies ( ) { } @ Override protected Class loadClass ( String className ) { } @ Override protected ReifiedType loadType ( String className ) { } private Object getInstance ( ) throws ComponentDefinitionException { } private Map < Method , List < Object > > findMatchingMethods ( Class type , String name , boolean instance , List < Object > args , List < ReifiedType > types ) { Map < Method , List < Object > > matches = new HashMap < Method , List < Object > > ( ) ; <START_BUG> List < Method > methods = getPublicMethods ( type ) ; <END_BUG> for ( Iterator < Method > it = methods . iterator ( ) ; it . hasNext ( ) ; ) { Method mth = it . next ( ) ; if ( ! ( mth . getName ( ) . equals ( name ) ) ) { it . remove ( ) ; } else if ( ( mth . getParameterTypes ( ) . length ) != ( args . size ( ) ) ) { it . remove ( ) ; } else if ( instance ^ ( ! ( Modifier . isStatic ( mth . getModifiers ( ) ) ) ) ) { it . remove ( ) ; } else if ( mth . isBridge ( ) ) { it . remove ( ) ; } } if ( ! instance ) { methods = BeanRecipe . applyStaticHidingRules ( methods ) ; } if ( ( matches . size ( ) ) != 1 ) { Map < Method , List < Object > > nmatches = new HashMap < Method , List < Object > > ( ) ; for ( Method mth : methods ) { boolean found = true ; List < Object > match = new ArrayList < Object > ( ) ; for ( int i = 0 ; i < ( args . size ( ) ) ; i ++ ) { ReifiedType argType = new GenericType ( mth . getGenericParameterTypes ( ) [ i ] ) ; if ( ( ( types . get ( i ) ) != null ) && ( ! ( argType . getRawClass ( ) . equals ( types . get ( i ) . getRawClass ( ) ) ) ) ) { found = false ; break ; } Object arg = args . get ( i ) ; Object argToTest = arg ; if ( arg instanceof BeanRecipe . UnwrapperedBeanHolder ) argToTest = ( ( BeanRecipe . UnwrapperedBeanHolder ) ( arg ) ) . unwrapperedBean ; if ( ! ( AggregateConverter . isAssignable ( argToTest , argType ) ) ) { found = false ; break ; } try { match . add ( convert ( arg , mth . getGenericParameterTypes ( ) [ i ] ) ) ; } catch ( Throwable t ) { found = false ; break ; } } if ( found ) { nmatches . put ( mth , match ) ; } } if ( ( nmatches . size ( ) ) > 0 ) { matches = nmatches ; } } if ( ( matches . size ( ) ) != 1 ) { Map < Method , List < Object > > nmatches = new HashMap < Method , List < Object > > ( ) ; for ( Method mth : methods ) { boolean found = true ; List < Object > match = new ArrayList < Object > ( ) ; for ( int i = 0 ; i < ( args . size ( ) ) ;

Fix:
List < Method > methods = new ArrayList < Method > ( Arrays . asList ( getPublicMethods ( type ) ) ) ;