[gcj trunk / gnu-classpath] String.format(...) undefined

Hanno Meyer-Thurow h.mth@web.de
Tue Feb 27 02:36:00 GMT 2007

On Wed, 21 Feb 2007 14:50:27 +0000
Andrew Haley <aph@redhat.com> wrote:

> Anyway, if you can get me an easily reproducible test case I'll have a
> look.  Let me know what to download, how to run it, etc.

I got this issue debugged down to this:

Any kind of annotation method as array type declared is stored as Object array.
(libjava/java/lang/natClass.cc, parseAnnotationElement)

In libjava/classpath/sun/reflect/annotation/AnnotationInvocationHandler.java:375
	if (! getBoxedReturnType(method).isInstance(val))
		throw Exception

method.return_type is a Class array
val is an Object array

Then via isInstance call in libjava/java/lang/natClass.cc:1745
	_Jv_IsAssignableFrom(jclass source, jclass target)

source = val
target = method.return_type

If source is an Object type the function passes to the end and returns false.
And therefore the Exception is thrown. Or do I miss something?

Any chance to get the array type right for annotation methods?
Or to check source and target in _Jv_IsAssignableFrom for equation
if both are arrays?

Anyone any ideas?


More information about the Java mailing list