<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=astefan" rel="nofollow">Andrei Stefan</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-3904?redirect=false" rel="nofollow">SPR-3904</a></strong> and commented</p>
<p dir="auto">Having an interface like:<br>
interface GenericIFace&lt;B&gt; {<br>
public void save(B bean);</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="public void saveAll(Collection&lt;B&gt; beans);"><pre class="notranslate"><code class="notranslate">public void saveAll(Collection&lt;B&gt; beans);
</code></pre></div>
<p dir="auto">}</p>
<p dir="auto">and a pointcut like: execution(* GenericIFace.save*(..)) - first method is intercepted, the second one isn't, except the case of execution(* GenericIFace+.save*(..)).</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.0.6, 2.1 M4</p>
<p dir="auto"><strong>Attachments:</strong></p>
<ul dir="auto">
<li><a href="https://jira.spring.io/secure/attachment/12925/aspectj.zip" rel="nofollow">aspectj.zip</a> (<em>1.48 kB</em>)</li>
</ul>
<p dir="auto">2 votes, 2 watchers</p>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=astefan" rel="nofollow">Andrei Stefan</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-3556?redirect=false" rel="nofollow">SPR-3556</a></strong> and commented</p>
<p dir="auto">I made two tests:</p>
<ul dir="auto">
<li>one with AspectJ support;</li>
<li>one with Spring's AspectJ support.</li>
</ul>
<p dir="auto">The tests involve two interfaces: Base&lt;T&gt; and DerivedInterface&lt;T&gt; extends Base&lt;T&gt;.<br>
A Before pointcut matching all methods from Base and DerivedInterface is defined: <code class="notranslate">@Before</code>("execution(* example.Base+.*(..))")<br>
In AspectJ a test creating an instance of a class implementing DerivedInterface: DerivedInterface&lt;String&gt; obj = new DerivedString(); and then calling methods on both interfaces demonstrates advice being applied on both methods.<br>
The same test in Spring getting a bean instance from ApplicationContext like DerivedInterface&lt;String&gt; bean = (DerivedInterface&lt;String&gt;) context.getBean("myBean"); and calling methods on both interfaces, the advice is not applied to methods receiving as parameter the generic type &lt;T&gt;.</p>
<p dir="auto">Methods like method(&lt;T&gt;) don't get the advice applied, but method2() have the advice applied.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.0.5, 2.1 M3</p>
<p dir="auto"><strong>Attachments:</strong></p>
<ul dir="auto">
<li><a href="https://jira.spring.io/secure/attachment/12641/SpringAspectJ.zip" rel="nofollow">SpringAspectJ.zip</a> (<em>1.86 kB</em>)</li>
</ul>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398079012" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/8309" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/8309/hovercard" href="https://github.com/spring-projects/spring-framework/issues/8309">#8309</a> Spring AOP <code class="notranslate">@Aspect</code> pointcut ignores generic type params and matches to many join points  (<em><strong>"is depended on by"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398080881" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/8559" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/8559/hovercard" href="https://github.com/spring-projects/spring-framework/issues/8559">#8559</a> AspectJ pointcut expressions fail to match generically parameterized methods (<em><strong>"is duplicated by"</strong></em>)</li>
</ul>