From 94863d2e14ad7334fe5318d827878ce3b6424818 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 14 Apr 2012 20:48:07 +0200 Subject: Fix generics .. --- .../jogamp/gluegen/runtime/ProcAddressTable.java | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/java/com/jogamp/gluegen/runtime/ProcAddressTable.java b/src/java/com/jogamp/gluegen/runtime/ProcAddressTable.java index 6a73c0a..e137385 100644 --- a/src/java/com/jogamp/gluegen/runtime/ProcAddressTable.java +++ b/src/java/com/jogamp/gluegen/runtime/ProcAddressTable.java @@ -47,7 +47,6 @@ import java.security.PrivilegedAction; import java.util.Iterator; import java.util.LinkedHashSet; import java.util.Map; -import java.util.Map.Entry; import java.util.Set; import java.util.SortedMap; import java.util.TreeMap; @@ -85,8 +84,7 @@ public abstract class ProcAddressTable { private final FunctionAddressResolver resolver; static { - AccessController.doPrivileged(new PrivilegedAction() { - + AccessController.doPrivileged(new PrivilegedAction() { public Object run() { DEBUG = (System.getProperty("jogamp.debug.ProcAddressHelper") != null); if (DEBUG) { @@ -199,16 +197,16 @@ public abstract class ProcAddressTable { /** * Returns this table as map with the function name as key and the address as value. */ - public Map/**/ toMap() { + public Map toMap() { - SortedMap map = new TreeMap(); + SortedMap map = new TreeMap(); Field[] fields = getClass().getFields(); try { for (int i = 0; i < fields.length; ++i) { String addressFieldName = fields[i].getName(); if (isAddressField(addressFieldName)) { - map.put(fieldToFunctionName(addressFieldName), fields[i].get(this)); + map.put(fieldToFunctionName(addressFieldName), (Long)fields[i].get(this)); } } } catch (IllegalArgumentException ex) { @@ -251,12 +249,12 @@ public abstract class ProcAddressTable { /** * Returns all functions pointing to null. */ - public Set/**/ getNullPointerFunctions() { - Map table = toMap(); - Set nullPointers = new LinkedHashSet(); - for (Iterator it = table.entrySet().iterator(); it.hasNext();) { - Map.Entry entry = (Entry) it.next(); - long address = ((Long)entry.getValue()).longValue(); + public Set getNullPointerFunctions() { + Map table = toMap(); + Set nullPointers = new LinkedHashSet(); + for (Iterator> it = table.entrySet().iterator(); it.hasNext();) { + Map.Entry entry = it.next(); + long address = entry.getValue().longValue(); if(address == 0) { nullPointers.add(entry.getKey()); } -- cgit v1.2.3