Mantis - Resin
Viewing Issue Advanced Details
4551 block always 05-15-11 11:07 05-19-11 14:44
dicr  
ferg  
normal  
closed 4.0.18  
fixed  
none    
none 4.0.19  
0004551: ejb: invalid proxy code generation with generics
I have bean with method methods, which using generics:

public <DO> DO getById(final Class<DO> clazz, final long id) throws NotFoundException
and
public <DO> Collection<DO> listAll(Class<DO> clazz, boolean withDeleted);

This generated to stateless proxy java-code:

public <T_0 extends java.lang.Object>
  T_0 getById(java.lang.Class<T_0> a0, long a1)
   throws org.dicr.util.data.exc.NotFoundException;
and
public java.util.Collection<T_0> listAll(java.lang.Class<T_0> a0, boolean a1)

First is Ok, but seconds is inccorrect and this code can't be compiled:

cannot find symbol
symbol : class T_0

Second methos must be traslated in the same way as first:

public <T_0> java.util.Collection<T_0> listAll(java.lang.Class<T_0> a0, boolean a1)
instead of
public java.util.Collection<T_0> listAll(java.lang.Class<T_0> a0, boolean a1)



Notes
(0005245)
dicr   
05-15-11 11:10   
<T_0> is absent in generated method listAll.
Seems this problem is presend, when return type is Collection<T>, and not present when return type is T.
(0005246)
dicr   
05-15-11 16:08   
I tested with another return type - array:

public <DO extends BaseEntity> DO[] listAll(Class<DO> clazz, boolean withDeleted)

in MyBean_StatelessProxy.java transleted to:

public T_0[] listAll(java.lang.Class<T_0> a0, boolean a1)

should be:

public <T_0> T_0[] listAll(java.lang.Class<T_0> a0, boolean a1)

Generics collections return in bean method not supported by resin, but return with single generics type working.
(0005264)
ferg   
05-19-11 14:44   
ejb/40c8