Announcement Announcement Module
Collapse
No announcement yet.
(..) wildcard does not match parameterized type in signature Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • (..) wildcard does not match parameterized type in signature

    We have a parent interface:

    public interface AdManager<T extends Ad> {
    public void saveAd(T ad);
    }

    and a child interface:

    public interface CustomAdManager extends AdManager<CustomAd> {
    }

    and an implementation:

    public class CustomerAdManagerImpl implements CustomAdManager {

    public void saveAd(CustomAd ad) {
    // Etc...
    }

    }

    I want to apply transaction advice to all manager, using this pointcut:

    execution (public * com.example.service.*.*(..))

    (Omitting XML for now, since everything is working as expected, except for this single method)

    There are other methods in the CustomAdManager interface that are transactional, that do start and commit transactions according to debug output from org.springframework.transaction and org.springframework.orm.hibernate3. However, calls to customAdManager.saveAd(someAd) does NOT start a transaction. I've managed to isolate to this: if I override the "saveAd(T ad)" method inherited from AdManager with "saveAd(CustomAd ad)", the method is matched, but not otherwise. Any inherited method that doesn't have a parameterized type T in the signature is matched by (..), and consequently runs inside a transaction.

    Is this a limitation of AspectJ, or is it a bug in Spring? If it's a limitation, does anyone know a way to match every signature including parameterized types?

  • #2
    did you get any resolution to this I am finding the same problem

    Comment


    • #3
      Have you guys heard anything more on this issue or resolved it ? Because I think I'm having a fairly similar issue.

      Comment


      • #4
        No, unfortunately not. I haven't worked on the problem for some time though, we decided on a workaround using delegation between services instead of inheritance.

        Comment


        • #5
          http://opensource.atlassian.com/proj...rowse/SPR-3556

          Comment

          Working...
          X