[PATCH] java.awt

Tom Tromey tromey@redhat.com
Fri Feb 14 22:05:00 GMT 2003


Michael> When using the following I need to catch IllegalAccessException:
Michael> return (representationClass.newInstance() instanceof ByteBuffer);

Sorry, I didn't read closely enough.  instanceof won't work.
But how about

    java.nio.ByteBuffer.class.isAssignableFrom(representationClass)

I think that's more idiomatic than using Class.forName.

Tom



More information about the Java-patches mailing list