You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by "Eugene Vologzhanin (JIRA)" <ji...@apache.org> on 2016/09/19 06:34:21 UTC
[jira] [Updated] (TAP5-2564) Unwanted auto-boxing while annotation
visiting
[ https://issues.apache.org/jira/browse/TAP5-2564?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eugene Vologzhanin updated TAP5-2564:
-------------------------------------
Description:
class org.apache.tapestry5.ioc.internal.services.AnnotationMemberValueVisitor
Line #64: final Object result = method.invoke(value);
If method return boolean, result wil be <b>java.lang.Boolean</b> not <b>boolean</b>.
In this case in rutime will be Caused by: java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.Enum.
I fix with:
{code}
MemberValue memberValue;
if (method.getReturnType().isPrimitive()) {
memberValue = Annotation.createMemberValue(this.constPool,
this.classPool.get(method.getReturnType().getName()));
} else {
memberValue = Annotation.createMemberValue(this.constPool,
this.classPool.get(result.getClass().getName()));
}
{code}
was:
class org.apache.tapestry5.ioc.internal.services.AnnotationMemberValueVisitor
Line #64: final Object result = method.invoke(value);
If method return boolean, result wil be <b>java.lang.Boolean</b> not <b>boolean</b>.
In this case in rutime will be Caused by: java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.Enum.
I fix with:
<pre>
MemberValue memberValue;
if (method.getReturnType().isPrimitive()) {
memberValue = Annotation.createMemberValue(this.constPool,
this.classPool.get(method.getReturnType().getName()));
} else {
memberValue = Annotation.createMemberValue(this.constPool,
this.classPool.get(result.getClass().getName()));
}
</pre>
> Unwanted auto-boxing while annotation visiting
> -----------------------------------------------
>
> Key: TAP5-2564
> URL: https://issues.apache.org/jira/browse/TAP5-2564
> Project: Tapestry 5
> Issue Type: Bug
> Components: tapestry-ioc
> Affects Versions: 5.3.8
> Reporter: Eugene Vologzhanin
>
> class org.apache.tapestry5.ioc.internal.services.AnnotationMemberValueVisitor
> Line #64: final Object result = method.invoke(value);
> If method return boolean, result wil be <b>java.lang.Boolean</b> not <b>boolean</b>.
> In this case in rutime will be Caused by: java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.Enum.
> I fix with:
> {code}
> MemberValue memberValue;
> if (method.getReturnType().isPrimitive()) {
> memberValue = Annotation.createMemberValue(this.constPool,
> this.classPool.get(method.getReturnType().getName()));
> } else {
> memberValue = Annotation.createMemberValue(this.constPool,
> this.classPool.get(result.getClass().getName()));
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)