commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emmanuel Bourg (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (BCEL-178) ClassFormatException: [Invalid signature: `TT;'] when using Utility.signatureToString
Date Fri, 20 Feb 2015 01:34:12 GMT

     [ https://issues.apache.org/jira/browse/BCEL-178?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Emmanuel Bourg resolved BCEL-178.
---------------------------------
       Resolution: Duplicate
    Fix Version/s: 6.0

Thank you for the report Will, this was also reported in BCEL-197 and is now fixed on the
trunk.

> ClassFormatException: [Invalid signature: `TT;'] when using Utility.signatureToString
> -------------------------------------------------------------------------------------
>
>                 Key: BCEL-178
>                 URL: https://issues.apache.org/jira/browse/BCEL-178
>             Project: Commons BCEL
>          Issue Type: Bug
>            Reporter: Will N
>             Fix For: 6.0
>
>         Attachments: BCEL-178-Utility.java.patch
>
>
> {{Utility.signatureToString(...)}} can fail with this exception:
> {noformat}
> Caused by: org.apache.bcel.classfile.ClassFormatException: Invalid signature: `TT;'
> 	at org.apache.bcel.classfile.Utility.signatureToString(Utility.java:855)
> 	at org.apache.bcel.classfile.Utility.signatureToString(Utility.java:765)
> 	at org.apache.bcel.classfile.LocalVariable.toString(LocalVariable.java:236)
> 	at org.apache.bcel.classfile.LocalVariableTypeTable.toString(LocalVariableTypeTable.java:122)
> 	... 
> {noformat}
> I'm using the current HEAD version (built from r1614210). It's a very similar issue to
[Bug 48279|https://issues.apache.org/bugzilla/show_bug.cgi?id=48279] (fixed in Jan 2010).
> This is failing for my code which has a variable typed as {{T}} like this:
> {code:java}
> <T> Envelope buildRequest(Class<T> contentClass) {
>     Envelope result = buildEnvelope(); // some holder type
>     T body = Utils.newInstance(contentClass); // generic method returning an instance
of contentClass
>     // ... more work ...
>     return result;
> }
> {code}
> I've fixed this locally following the pattern used in  [Bug 48279|https://issues.apache.org/bugzilla/show_bug.cgi?id=48279]'s
fix (see r897699), essentially adding the {{'T'}} option next to {{'L'}} in the {{Switch}}
statement (see attached patch)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message