You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by "Cergey Chaulin (JIRA)" <ji...@apache.org> on 2019/06/21 16:25:00 UTC

[jira] [Updated] (OWB-1292) StackOverflowError in GenericsUtil.satisfiesDependency with parametrized type

     [ https://issues.apache.org/jira/browse/OWB-1292?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Cergey Chaulin updated OWB-1292:
--------------------------------
    Description: 
When using classes like the one below, StackOverflowError occures in GenericsUtil.satisfiesDependency
{code:java}
interface GenericFoo<T extends Comparable<T>> {
 T someMethod();
}{code}
Code to reproduce:
{code:java}
  OwbParametrizedTypeImpl 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")})))
  });

  OwbParametrizedTypeImpl beanType = new OwbParametrizedTypeImpl(null, GenericFoo.class, t);
GenericsUtil.satisfiesDependency(false, false, injectionPointType, beanType);
{code}
 

 

  was:
When using classes like the one below, StackOverflowError occuress in GenericsUtil.satisfiesDependency
{code:java}
interface GenericFoo<T extends Comparable<T>> {
 T someMethod();
}{code}
Code to reproduce:
{code:java}
  OwbParametrizedTypeImpl 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")})))
  });

  OwbParametrizedTypeImpl beanType = new OwbParametrizedTypeImpl(null, GenericFoo.class, t);
GenericsUtil.satisfiesDependency(false, false, injectionPointType, beanType);
{code}
 

 


> StackOverflowError in GenericsUtil.satisfiesDependency with parametrized type
> -----------------------------------------------------------------------------
>
>                 Key: OWB-1292
>                 URL: https://issues.apache.org/jira/browse/OWB-1292
>             Project: OpenWebBeans
>          Issue Type: Bug
>            Reporter: Cergey Chaulin
>            Priority: Major
>
> When using classes like the one below, StackOverflowError occures in GenericsUtil.satisfiesDependency
> {code:java}
> interface GenericFoo<T extends Comparable<T>> {
>  T someMethod();
> }{code}
> Code to reproduce:
> {code:java}
>   OwbParametrizedTypeImpl 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")})))
>   });
>   OwbParametrizedTypeImpl 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)