commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Will N (JIRA)" <>
Subject [jira] [Created] (BCEL-178) ClassFormatException: [Invalid signature: `TT;'] when using Utility.signatureToString
Date Tue, 05 Aug 2014 17:28:11 GMT
Will N created BCEL-178:

             Summary: ClassFormatException: [Invalid signature: `TT;'] when using Utility.signatureToString
                 Key: BCEL-178
             Project: Commons BCEL
          Issue Type: Bug
            Reporter: Will N

A very similar issue to [Bug 48279|]
- {{Utility.signatureToString(...)}} can fail with this exception:

Caused by: org.apache.bcel.classfile.ClassFormatException: Invalid signature: `TT;'
	at org.apache.bcel.classfile.Utility.signatureToString(
	at org.apache.bcel.classfile.Utility.signatureToString(
	at org.apache.bcel.classfile.LocalVariable.toString(
	at org.apache.bcel.classfile.LocalVariableTypeTable.toString(

This is failing for my code which has a variable typed as {{T}} like this:
<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;

I've fixed this locally following the pattern used in  [Bug 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

View raw message