This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
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
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |