You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bcel-user@jakarta.apache.org by SH <ha...@gmail.com> on 2004/08/16 10:50:28 UTC

BCEL with jdk 1.5beta2

Hi,
I have trouble analyzing  class files generated with sun's JDK 1.5 beta2.
a LDC_W.getType() seems to always throw the following exception:

Exception in thread "main" java.lang.RuntimeException: Unknown or
invalid constant type at 34
at org.apache.bcel.generic.LDC.getType(LDC.java:148)
...

Inevitable,  a javap -v <class> on the constant pool offset printed 
(34 in the example above) has something like this
--
...
const #11 = Asciz   com/sun/corba/se/spi/logging/LogWrapperBase;
...
const #33 = Asciz   setThrown;
const #34 = class   #11;    //  com/sun/corba/se/spi/logging/LogWrapperBase
--

i.e. CP entry #34 seems to be redirected to #11. it looks like the getType() 
is unable to handle this redirection.

is this something new to the 1.5 class file format or the 1.5b2 compiler ?
Is there a known workaround ? All the classes I am trying to analyze are in
rt.jar. thanks.

/sgh

---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-user-help@jakarta.apache.org


Re: BCEL with jdk 1.5beta2

Posted by David Hovemeyer <da...@cs.umd.edu>.
JDK 1.5 changed the classfile format so that LDC instructions
can directly reference class constants.

The latest CVS version of BCEL should correctly handle this.

-Dave

On Mon, Aug 16, 2004 at 02:20:28PM +0530, SH wrote:
> Hi,
> I have trouble analyzing  class files generated with sun's JDK 1.5 beta2.
> a LDC_W.getType() seems to always throw the following exception:
> 
> Exception in thread "main" java.lang.RuntimeException: Unknown or
> invalid constant type at 34
> at org.apache.bcel.generic.LDC.getType(LDC.java:148)
> ...
> 
> Inevitable,  a javap -v <class> on the constant pool offset printed 
> (34 in the example above) has something like this
> --
> ...
> const #11 = Asciz   com/sun/corba/se/spi/logging/LogWrapperBase;
> ...
> const #33 = Asciz   setThrown;
> const #34 = class   #11;    //  com/sun/corba/se/spi/logging/LogWrapperBase
> --
> 
> i.e. CP entry #34 seems to be redirected to #11. it looks like the getType() 
> is unable to handle this redirection.
> 
> is this something new to the 1.5 class file format or the 1.5b2 compiler ?
> Is there a known workaround ? All the classes I am trying to analyze are in
> rt.jar. thanks.
> 
> /sgh
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: bcel-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: bcel-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-user-help@jakarta.apache.org