[ 
https://issues.apache.org/jira/browse/BCEL-180?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14168466#comment-14168466
 ] 

Maxim Degtyarev commented on BCEL-180:
--------------------------------------

>> In some cases such as JDI API we have the class constant pool content only 
>> in form of separate byte array.

> What do you mean? Please provide some reference.

Assume we need to disassemble some code, being traced using Java Debug 
Interface (JDI) API 
http://docs.oracle.com/javase/7/docs/jdk/api/jpda/jdi/overview-summary.html

To do so using BCEL we need to pass to the method Utility.codeToString() 
 - byte array with method bytecodes which can be retrieved by calling 
http://docs.oracle.com/javase/7/docs/jdk/api/jpda/jdi/com/sun/jdi/Method.html#bytecodes%28%29
 - ConstantPool instance

So we need a way to create ConstantPool instance from byte array we can 
retrieve by calling 
http://docs.oracle.com/javase/7/docs/jdk/api/jpda/jdi/com/sun/jdi/ReferenceType.html#constantPool%28%29

N.B. Byte array returned by ReferenceType::constantPool() does not contain 
entry count at the start expected by ConstantPool(DataInputStream) 
implementation.


> Enable loading ConstantPool from a byte array
> ---------------------------------------------
>
>                 Key: BCEL-180
>                 URL: https://issues.apache.org/jira/browse/BCEL-180
>             Project: Commons BCEL
>          Issue Type: Improvement
>            Reporter: Maxim Degtyarev
>
> In some cases such as JDI API we have the class constant pool content only in 
> form of separate byte array. Currently there is no way to load constant pool 
> from byte array.
> The proposed patch add new public constructor to the 
> org.apache.bcel.classfile.ConstantPool that allow loading ConstantPool from 
> byte array representation.
> GitHub pull request: https://github.com/apache/commons-bcel/pull/1



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

Reply via email to