<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=mbogoevici" rel="nofollow">Marius Bogoevici</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-8656?redirect=false" rel="nofollow">SPR-8656</a></strong> and commented</p>
<p dir="auto">Suppose there is a class</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@Controller
@RequestMapping(&quot;/foo&quot;)
public class FooController{

        @RequestMapping(value=&quot;/{id}&quot;, method=RequestMethod.GET)
	public String viewFoo(@PathVariable(&quot;id&quot;) Long id) {
		...
	}

}"><pre class="notranslate"><span class="pl-c1">@</span><span class="pl-c1">Controller</span>
<span class="pl-c1">@</span><span class="pl-c1">RequestMapping</span>(<span class="pl-s">"/foo"</span>)
<span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">FooController</span>{

        <span class="pl-c1">@</span><span class="pl-c1">RequestMapping</span>(<span class="pl-s1">value</span>=<span class="pl-s">"/{id}"</span>, <span class="pl-s1">method</span>=<span class="pl-smi">RequestMethod</span>.<span class="pl-c1">GET</span>)
	<span class="pl-k">public</span> <span class="pl-smi">String</span> <span class="pl-en">viewFoo</span>(<span class="pl-c1">@</span><span class="pl-c1">PathVariable</span>(<span class="pl-s">"id"</span>) <span class="pl-smi">Long</span> <span class="pl-s1">id</span>) {
		...
	}

}</pre></div>
<p dir="auto">After applying an advice (e.g. using &lt;aop:aspectj-autoproxy proxy-target-class="true"/&gt;), a proxy class instance will be used as a controller. However, the framework will try use information from the proxy class to handle the request, which will result in various errors (e.g. parameter mappings are not available due to the fact that <code class="notranslate">@PathVariable</code> is lost, etc).</p>
<p dir="auto">A suggestion in this case would be to detect that the controller is in fact a proxy and to try to read the metadata from the target class.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.1 M2</p>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=tuomas_kiviaho" rel="nofollow">Tuomas Kiviaho</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-8491?redirect=false" rel="nofollow">SPR-8491</a></strong> and commented</p>
<p dir="auto">java.awt.Component has both</p>
<p dir="auto">public void setSize(int width, int height)<br>
and<br>
public void setSize(Dimension d)</p>
<p dir="auto">introspection of classes derived from this base class (using BeanUtils.getPropertyDescriptor) now crashes with following exception</p>
<p dir="auto">...<br>
Caused by: java.beans.IntrospectionException: type mismatch between indexed and non-indexed methods: size<br>
at java.beans.IndexedPropertyDescriptor.findIndexedPropertyType(IndexedPropertyDescriptor.java:341)<br>
at java.beans.IndexedPropertyDescriptor.setIndexedWriteMethod(IndexedPropertyDescriptor.java:248)<br>
at org.springframework.beans.ExtendedBeanInfo.addOrUpdatePropertyDescriptor(ExtendedBeanInfo.java:233)<br>
at org.springframework.beans.ExtendedBeanInfo.addOrUpdatePropertyDescriptor(ExtendedBeanInfo.java:178)<br>
at org.springframework.beans.ExtendedBeanInfo.&lt;init&gt;(ExtendedBeanInfo.java:108)<br>
at org.springframework.beans.CachedIntrospectionResults.&lt;init&gt;(CachedIntrospectionResults.java:224)<br>
... 92 more</p>
<p dir="auto">I guess that this can be omitted by first checking whether or not index method really has to be updated or not (it seems to be already null)</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.1 M2</p>
<p dir="auto"><strong>Attachments:</strong></p>
<ul dir="auto">
<li><a href="https://jira.spring.io/secure/attachment/18416/SPR-8491.zip" rel="nofollow">SPR-8491.zip</a> (<em>3.02 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="398115291" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/13448" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/13448/hovercard" href="https://github.com/spring-projects/spring-framework/issues/13448">#13448</a> ExtendedBeanInfo raises 'type mismatch' error with covariant property types (<em><strong>"duplicates"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398116085" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/13571" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/13571/hovercard" href="https://github.com/spring-projects/spring-framework/issues/13571">#13571</a> Regression - Introspection with BeanUtils started failing for java.math.BigDecimal</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398155112" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/14663" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/14663/hovercard" href="https://github.com/spring-projects/spring-framework/issues/14663">#14663</a> Overhaul non-void JavaBean write method support</li>
</ul>
<p dir="auto">3 votes, 5 watchers</p>