Bug 49332 - Type.getReturnTypeSize() doesn't decode Type.getTypeSize() output
Summary: Type.getReturnTypeSize() doesn't decode Type.getTypeSize() output
Status: RESOLVED FIXED
Alias: None
Product: BCEL - Now in Jira
Classification: Unclassified
Component: Main (show other bugs)
Version: unspecified
Hardware: All All
: P2 blocker
Target Milestone: ---
Assignee: issues@commons.apache.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-24 11:09 UTC by William Pugh
Modified: 2010-05-24 22:06 UTC (History)
0 users



Attachments
Fix for this bug (512 bytes, text/plain)
2010-05-24 11:09 UTC, William Pugh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description William Pugh 2010-05-24 11:09:00 UTC
Created attachment 25475 [details]
Fix for this bug

The Type.getReturnTypeSize() method doesn't decode Type.getTypeSize() output.

The same bug was present in FieldInstruction.getFieldSize(), filed and fixed as bug 48280   https://issues.apache.org/bugzilla/show_bug.cgi?id=48280

As a result of this bug, the BCEL calculates the wrong size of the return type for methods, leading to FindBugs going off the rails. 

The fix is the same as to fix FieldInstruction.getFieldSize(): use Type.size() to decode the coded value.
I've attached a patch with the fix, and I've also looked at the other uses of getTypeSize(), and all the other invocations seem OK.
Comment 1 Dave Brosius 2010-05-24 22:06:53 UTC
Applied to head, thanks!