From 19bef683d38f4ce7b0dcb5c516244c6f87504e41 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 21 Jun 2013 02:17:44 +0200 Subject: Fix regression of f69831574d4927d03d40c330d0b047d8c89622a4: Use getDeclaredField() and setAccessible(true) due to package private handle fields. --- src/java/com/jogamp/gluegen/runtime/ProcAddressTable.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/java/com') diff --git a/src/java/com/jogamp/gluegen/runtime/ProcAddressTable.java b/src/java/com/jogamp/gluegen/runtime/ProcAddressTable.java index a175c89..a4ead86 100644 --- a/src/java/com/jogamp/gluegen/runtime/ProcAddressTable.java +++ b/src/java/com/jogamp/gluegen/runtime/ProcAddressTable.java @@ -119,15 +119,16 @@ public abstract class ProcAddressTable { throw new RuntimeException("Passed null DynamicLookupHelper"); } + final Field[] fields = getClass().getDeclaredFields(); + final PrintStream dout; if (DEBUG) { dout = getDebugOutStream(); - dout.println(getClass().getName()+".reset()"); + dout.println(getClass().getName()+".reset() (w/ "+fields.length+" prospective fields)"); } else { dout = null; } - final Field[] fields = getClass().getFields(); for (int i = 0; i < fields.length; ++i) { final String fieldName = fields[i].getName(); if ( isAddressField(fieldName) ) { @@ -155,10 +156,11 @@ public abstract class ProcAddressTable { setEntry(field, name, lookup); } - private final void setEntry(Field addressField, String funcName, DynamicLookupHelper lookup) { + private final void setEntry(Field addressField, String funcName, DynamicLookupHelper lookup) throws SecurityException { try { assert (addressField.getType() == Long.TYPE); long newProcAddress = resolver.resolve(funcName, lookup); + addressField.setAccessible(true); // set the current value of the proc address variable in the table object addressField.setLong(this, newProcAddress); if (DEBUG) { -- cgit v1.2.3