Multiple file compilation patch

Mark Wielaard
Sun Mar 18 14:51:00 GMT 2001


On Mon, Mar 19, 2001 at 09:59:57AM +1200, Bryce McKinlay wrote:
> Can you tell what its trying to cast to what? I've seen this kind of
> thing happen when compiling from class files, or when compiling a mixture
> of class/source files.

By making the following patch to _Jv_CheckCast I can now see what is being
cast to what:

2001-03-18  Mark Wielaard  <>

        * java/lang/ (_Jv_CheckCast): add class names to exception

OK to commit?

I now get the following StackTrace:

$ gkjc 2>&1 | head
Exception in thread "main" java.lang.ClassCastException: at.dms.classfile.ClassConstant cannot be cast to at.dms.classfile.NameAndTypeConstant
   at 0x401ab81a: java.lang.Throwable.Throwable(java.lang.String) (/usr/local/gcc/lib/
   at 0x4019f9e1: java.lang.Exception.Exception(java.lang.String) (/usr/local/gcc/lib/
   at 0x401a3f21: java.lang.RuntimeException.RuntimeException(java.lang.String) (/usr/local/gcc/lib/
   at 0x4019de31:
java.lang.ClassCastException.ClassCastException(java.lang.String) (/usr/local/gcc/lib/
   at 0x4018bf82: _Jv_CheckCast (/usr/local/gcc/lib/
   at 0x0817fdf8: at.dms.classfile.UnresolvedConstant.resolveConstant(at.dms.classfile.PooledConstant[]) (/home/mark/src/KopiSusu/allsrc/src/at/dms/classfile/
   at 0x0816ba4a: at.dms.classfile.ConstantPool.ConstantPool(
[... etc ...]

And a ClassConstant really cannot be cast to a NameAndTypeConstant.
But I don't know how the code reached this point.



Stuff to read:
    < >
  What's Wrong with Copy Protection, by John Gilmore

More information about the Java-patches mailing list