diff options
author | Sven Gothel <[email protected]> | 2013-06-21 02:17:44 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-06-21 02:17:44 +0200 |
commit | 19bef683d38f4ce7b0dcb5c516244c6f87504e41 (patch) | |
tree | e6508edbaacca4a82c9ebd57e428839ee768aafa /src/java/com | |
parent | 2d811311976077bae9522afe533a140b97e62f8f (diff) |
Fix regression of f69831574d4927d03d40c330d0b047d8c89622a4: Use getDeclaredField() and setAccessible(true) due to package private handle fields.
Diffstat (limited to 'src/java/com')
-rw-r--r-- | src/java/com/jogamp/gluegen/runtime/ProcAddressTable.java | 8 |
1 files changed, 5 insertions, 3 deletions
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) { |