PDA

View Full Version : Bug: "no setter" error when Generics are used


roman
May 17th, 2005, 01:04 PM
SpringIDE reports "No setter found for property 'xxx' in class 'yyy' when class yyy is using a generic type:

Example:

public abstract class AbstractCrudDaoHibernate<E extends DomainObject>
extends HibernateDaoSupport
implements CrudDao<E> {
...
}

public class CustomerDaoHibernate
extends AbstractCrudDaoHibernate<Customer>
implements CustomerDao {
...
}

If I try to set the property "sessionFactory" which is declared in the class HibernateDaoSupport on CustomerDaoHibernate the above error is reported. Without the generic type everthing works fine.


I´ve created an issue at http://opensource.atlassian.com/projects/spring/browse/IDE-43

Christian Dupuis
May 17th, 2005, 01:50 PM
Hi roman,

I've created a ticket at http://springide.org/project/ticket/45 .
Thanks for your report. This looks like a nice bug for Torsten to fix :D.

Greetings
Christian

Torsten Juergeleit
May 17th, 2005, 04:46 PM
This looks like a nice bug for Torsten to fix :D.
Hhm, this bug is a really tough one (I didn't grasp generics by now :-().

But anyway, to support generics we have to depend on Eclipse 3.1. IMHO we shouldn't introduce this dependency now. Let's wait for a final version of Eclipse 3.1 first before binding Spring IDE to it.

Cheers,
Torsten

roman
May 17th, 2005, 05:43 PM
I know nothing about Eclipse plugin development or the way SpringIDE is working. So if I´m wrong, just ignore me (or give me a hint) :-)

to support generics we have to depend on Eclipse 3.1

Sure? I guess SpringIDE doesn´t need to know anything about generics. The setter method doesn´t use a generic type. Only the class declares one.

Is there no Eclipse 3.0 API compliant way to ask: "Has class AA the method YY?" If there is one, SpringIDE doesn´t need to know if generics are used and should work on eclipse 3.0 and 3.1. If not, how is SpringIDE currently resolving the methods?

I´ve viewed Erich Gamma´s presentation at JavaPolis:
http://www.javalobby.org/av/javapolis/prezo-fullscreen.jsp?id=34
He said something about AST (Abstract Systax Tree) and that other plugins can use it to work with the project´s classes. Maybe it helps.

I really would like to contribute to SpringIDE, but currently I´m working on my thesis so I don´t have the time. Sorry.

But anyway, Thorsten and Co., thank you a lot for your great work!!!

Best regards,

Roman