Multiple file compilation patch
Mark Wielaard
mark@klomp.org
Sun Mar 18 14:51:00 GMT 2001
Hi,
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 <mark@klomp.org>
* java/lang/natClass.cc (_Jv_CheckCast): add class names to exception
OK to commit?
I now get the following StackTrace:
$ gkjc CompilerCheck.java 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/libgcj.so.1)
at 0x4019f9e1: java.lang.Exception.Exception(java.lang.String) (/usr/local/gcc/lib/libgcj.so.1)
at 0x401a3f21: java.lang.RuntimeException.RuntimeException(java.lang.String) (/usr/local/gcc/lib/libgcj.so.1)
at 0x4019de31:
java.lang.ClassCastException.ClassCastException(java.lang.String) (/usr/local/gcc/lib/libgcj.so.1)
at 0x4018bf82: _Jv_CheckCast (/usr/local/gcc/lib/libgcj.so.1)
at 0x0817fdf8: at.dms.classfile.UnresolvedConstant.resolveConstant(at.dms.classfile.PooledConstant[]) (/home/mark/src/KopiSusu/allsrc/src/at/dms/classfile/UnresolvedConstant.java:0)
at 0x0816ba4a: at.dms.classfile.ConstantPool.ConstantPool(java.io.DataInput)
(/home/mark/src/KopiSusu/allsrc/src/at/dms/classfile/ConstantPool.java:0)
[... etc ...]
And a ClassConstant really cannot be cast to a NameAndTypeConstant.
But I don't know how the code reached this point.
Cheers,
Mark
--
Stuff to read:
< http://www.toad.com/gnu/whatswrong.html >
What's Wrong with Copy Protection, by John Gilmore
More information about the Java-patches
mailing list