Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0004551 [Resin] block always 05-15-11 11:07 05-19-11 14:44
Reporter dicr View Status public  
Assigned To ferg
Priority normal Resolution fixed  
Status closed   Product Version 4.0.18
Summary 0004551: ejb: invalid proxy code generation with generics
Description 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)


Additional Information
Attached Files

- Relationships

- 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
 

- Issue History
Date Modified Username Field Change
05-15-11 11:07 dicr New Issue
05-15-11 11:08 dicr Issue Monitored: dicr
05-15-11 11:10 dicr Note Added: 0005245
05-15-11 16:08 dicr Note Added: 0005246
05-19-11 14:44 ferg Note Added: 0005264
05-19-11 14:44 ferg Assigned To  => ferg
05-19-11 14:44 ferg Status new => closed
05-19-11 14:44 ferg Resolution open => fixed
05-19-11 14:44 ferg Fixed in Version  => 4.0.19


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
34 total queries executed.
28 unique queries executed.
Powered by Mantis Bugtracker