[ https://issues.apache.org/jira/browse/OWB-1292?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16870514#comment-16870514 ]
Romain Manni-Bucau commented on OWB-1292: ----------------------------------------- We could do a deep "eager" resolution - with the same protection since some types are really recursive and not resolvable - enabling to manage a bit more types (but also harder to use as a dev since it is less explicit), or we can keep the current algo and use a lazily materialization where the generic could be checked against equals but then we loose isAssignable behavior. In both cases it makes generic resolution impacted so can be very impacting at startup and until today we never needed it so not sure it is a real need. In any case you can always use a cdi extension to make the type resolved and not rely on scanning only for the few exceptions so while we dont fail the boot i guess we are covered. Dont hesitate to propose a patch if you have a better idea, I dont say i thought to all solutions ;). > StackOverflowError in GenericsUtil.satisfiesDependency with parametrized type > ----------------------------------------------------------------------------- > > Key: OWB-1292 > URL: https://issues.apache.org/jira/browse/OWB-1292 > Project: OpenWebBeans > Issue Type: Bug > Components: Core > Reporter: Cergey Chaulin > Assignee: Romain Manni-Bucau > Priority: Major > Fix For: 2.0.12 > > > When trying to inject parametrized bean to concrete required type (like the > one below), StackOverflowError occures in GenericsUtil.satisfiesDependency > {code:java} > interface GenericFoo<T extends Comparable<T>> { > T someMethod(); > } > class FooImpl<T extends Comparable<T>> implements GenericFoo<T> { > @Override > public T someMethod() { > return null; > } > } > class Bar { > GenericFoo<Long> foo; > }{code} > Code to reproduce: > {code:java} > //creating injection point of GenericFoo<Long> > ParameterizedType injectionPointType = new OwbParametrizedTypeImpl(null, > GenericFoo.class, Long.class); > CoreReflectionFactory factory = > CoreReflectionFactory.make(GenericFoo.class, > ClassScope.make(GenericFoo.class)); > //constructing parametrized type manually > TypeVariable<?> t = factory.makeTypeVariable("T", new FieldTypeSignature[]{ > ClassTypeSignature.make(Collections.singletonList( > SimpleClassTypeSignature.make(Comparable.class.getName(), > false, > new > TypeArgument[]{TypeVariableSignature.make("T")}))) > }); > ParameterizedType beanType = new OwbParametrizedTypeImpl(null, > GenericFoo.class, t); > GenericsUtil.satisfiesDependency(false, false, injectionPointType, > beanType); > {code} > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)