summaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/gluegen/procaddress
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-07-03 16:06:47 +0200
committerSven Gothel <[email protected]>2014-07-03 16:06:47 +0200
commitdf9ff7f340a5ab4e07efc613f5f264eeae63d4c7 (patch)
tree239ae276b82024b140428e6c0fe5d739fdd686a4 /src/java/com/jogamp/gluegen/procaddress
parenteb47aaba63e3b1bf55f274a0f338f1010a017ae4 (diff)
Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74)
Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74) - Change non static accesses to static members using declaring type - Change indirect accesses to static members to direct accesses (accesses through subtypes) - Add final modifier to private fields - Add final modifier to method parameters - Add final modifier to local variables - Remove unnecessary casts - Remove unnecessary '$NON-NLS$' tags - Remove trailing white spaces on all lines
Diffstat (limited to 'src/java/com/jogamp/gluegen/procaddress')
-rw-r--r--src/java/com/jogamp/gluegen/procaddress/ProcAddressCMethodBindingEmitter.java28
-rw-r--r--src/java/com/jogamp/gluegen/procaddress/ProcAddressConfiguration.java90
-rw-r--r--src/java/com/jogamp/gluegen/procaddress/ProcAddressEmitter.java52
-rw-r--r--src/java/com/jogamp/gluegen/procaddress/ProcAddressJavaMethodBindingEmitter.java20
4 files changed, 95 insertions, 95 deletions
diff --git a/src/java/com/jogamp/gluegen/procaddress/ProcAddressCMethodBindingEmitter.java b/src/java/com/jogamp/gluegen/procaddress/ProcAddressCMethodBindingEmitter.java
index 49ff4fc..351e0cd 100644
--- a/src/java/com/jogamp/gluegen/procaddress/ProcAddressCMethodBindingEmitter.java
+++ b/src/java/com/jogamp/gluegen/procaddress/ProcAddressCMethodBindingEmitter.java
@@ -55,8 +55,8 @@ public class ProcAddressCMethodBindingEmitter extends CMethodBindingEmitter {
private static final String procAddressJavaTypeName = JavaType.createForClass(Long.TYPE).jniTypeName();
private ProcAddressEmitter emitter;
- public ProcAddressCMethodBindingEmitter(CMethodBindingEmitter methodToWrap, final boolean callThroughProcAddress,
- boolean needsLocalTypedef, String localTypedefCallingConvention, ProcAddressEmitter emitter) {
+ public ProcAddressCMethodBindingEmitter(final CMethodBindingEmitter methodToWrap, final boolean callThroughProcAddress,
+ final boolean needsLocalTypedef, final String localTypedefCallingConvention, final ProcAddressEmitter emitter) {
super(
new MethodBinding(methodToWrap.getBinding()) {
@@ -97,7 +97,7 @@ public class ProcAddressCMethodBindingEmitter extends CMethodBindingEmitter {
}
@Override
- protected int emitArguments(PrintWriter writer) {
+ protected int emitArguments(final PrintWriter writer) {
int numEmitted = super.emitArguments(writer);
if (callThroughProcAddress) {
if (numEmitted > 0) {
@@ -112,11 +112,11 @@ public class ProcAddressCMethodBindingEmitter extends CMethodBindingEmitter {
}
@Override
- protected void emitBodyVariableDeclarations(PrintWriter writer) {
+ protected void emitBodyVariableDeclarations(final PrintWriter writer) {
if (callThroughProcAddress) {
// create variable for the function pointer with the right type, and set
// it to the value of the passed-in proc address
- FunctionSymbol cSym = getBinding().getCSymbol();
+ final FunctionSymbol cSym = getBinding().getCSymbol();
String funcPointerTypedefName =
emitter.getFunctionPointerTypedefName(cSym);
@@ -124,7 +124,7 @@ public class ProcAddressCMethodBindingEmitter extends CMethodBindingEmitter {
// We (probably) didn't get a typedef for this function
// pointer type in the header file; the user requested that we
// forcibly generate one. Here we force the emission of one.
- PointerType funcPtrType = new PointerType(null, cSym.getType(), 0);
+ final PointerType funcPtrType = new PointerType(null, cSym.getType(), 0);
// Just for safety, emit this name slightly differently than
// the mangling would otherwise produce
funcPointerTypedefName = "_local_" + funcPointerTypedefName;
@@ -145,18 +145,18 @@ public class ProcAddressCMethodBindingEmitter extends CMethodBindingEmitter {
}
@Override
- protected void emitBodyVariablePreCallSetup(PrintWriter writer) {
+ protected void emitBodyVariablePreCallSetup(final PrintWriter writer) {
super.emitBodyVariablePreCallSetup(writer);
if (callThroughProcAddress) {
// set the function pointer to the value of the passed-in procAddress
- FunctionSymbol cSym = getBinding().getCSymbol();
+ final FunctionSymbol cSym = getBinding().getCSymbol();
String funcPointerTypedefName = emitter.getFunctionPointerTypedefName(cSym);
if (needsLocalTypedef) {
funcPointerTypedefName = "_local_" + funcPointerTypedefName;
}
- String ptrVarName = "ptr_" + cSym.getName();
+ final String ptrVarName = "ptr_" + cSym.getName();
writer.print(" ");
writer.print(ptrVarName);
@@ -169,7 +169,7 @@ public class ProcAddressCMethodBindingEmitter extends CMethodBindingEmitter {
}
@Override
- protected void emitBodyCallCFunction(PrintWriter writer) {
+ protected void emitBodyCallCFunction(final PrintWriter writer) {
if (!callThroughProcAddress) {
super.emitBodyCallCFunction(writer);
} else {
@@ -178,12 +178,12 @@ public class ProcAddressCMethodBindingEmitter extends CMethodBindingEmitter {
// WARNING: this code assumes that the return type has already been
// typedef-resolved.
- Type cReturnType = binding.getCReturnType();
+ final Type cReturnType = binding.getCReturnType();
if (!cReturnType.isVoid()) {
writer.print("_res = ");
}
- MethodBinding mBinding = getBinding();
+ final MethodBinding mBinding = getBinding();
if (mBinding.hasContainingType()) {
// FIXME: this can and should be handled and unified with the
// associated code in the CMethodBindingEmitter
@@ -201,8 +201,8 @@ public class ProcAddressCMethodBindingEmitter extends CMethodBindingEmitter {
}
@Override
- protected String jniMangle(MethodBinding binding) {
- StringBuilder buf = new StringBuilder(super.jniMangle(binding));
+ protected String jniMangle(final MethodBinding binding) {
+ final StringBuilder buf = new StringBuilder(super.jniMangle(binding));
if (callThroughProcAddress) {
jniMangle(Long.TYPE, buf, false); // to account for the additional _addr_ parameter
}
diff --git a/src/java/com/jogamp/gluegen/procaddress/ProcAddressConfiguration.java b/src/java/com/jogamp/gluegen/procaddress/ProcAddressConfiguration.java
index 3341e45..7fc720c 100644
--- a/src/java/com/jogamp/gluegen/procaddress/ProcAddressConfiguration.java
+++ b/src/java/com/jogamp/gluegen/procaddress/ProcAddressConfiguration.java
@@ -61,10 +61,10 @@ public class ProcAddressConfiguration extends JavaConfiguration {
// This is needed only on Windows. Ideally we would modify the
// HeaderParser and PCPP to automatically pick up the calling
// convention from the headers
- private Map<String, String> localProcAddressCallingConventionMap = new HashMap<String, String>();
+ private final Map<String, String> localProcAddressCallingConventionMap = new HashMap<String, String>();
@Override
- protected void dispatch(String cmd, StringTokenizer tok, File file, String filename, int lineNo) throws IOException {
+ protected void dispatch(final String cmd, final StringTokenizer tok, final File file, final String filename, final int lineNo) throws IOException {
if (cmd.equalsIgnoreCase("EmitProcAddressTable")) {
emitProcAddressTable = readBoolean("EmitProcAddressTable", tok, filename, lineNo).booleanValue();
} else if (cmd.equalsIgnoreCase("ProcAddressTablePackage")) {
@@ -72,10 +72,10 @@ public class ProcAddressConfiguration extends JavaConfiguration {
} else if (cmd.equalsIgnoreCase("ProcAddressTableClassName")) {
tableClassName = readString("ProcAddressTableClassName", tok, filename, lineNo);
} else if (cmd.equalsIgnoreCase("SkipProcAddressGen")) {
- String sym = readString("SkipProcAddressGen", tok, filename, lineNo);
+ final String sym = readString("SkipProcAddressGen", tok, filename, lineNo);
skipProcAddressGen.add(sym);
} else if (cmd.equalsIgnoreCase("ForceProcAddressGen")) {
- String funcName = readString("ForceProcAddressGen", tok, filename, lineNo);
+ final String funcName = readString("ForceProcAddressGen", tok, filename, lineNo);
if (funcName.equals("__ALL__")) {
forceProcAddressGen4All = true;
} else {
@@ -92,24 +92,24 @@ public class ProcAddressConfiguration extends JavaConfiguration {
}
}
- protected String readGetProcAddressTableExpr(StringTokenizer tok, String filename, int lineNo) {
+ protected String readGetProcAddressTableExpr(final StringTokenizer tok, final String filename, final int lineNo) {
try {
- String restOfLine = tok.nextToken("\n\r\f");
+ final String restOfLine = tok.nextToken("\n\r\f");
return restOfLine.trim();
- } catch (NoSuchElementException e) {
+ } catch (final NoSuchElementException e) {
throw new RuntimeException("Error parsing \"GetProcAddressTableExpr\" command at line " + lineNo
+ " in file \"" + filename + "\"", e);
}
}
- protected void setProcAddressNameExpr(String expr) {
+ protected void setProcAddressNameExpr(final String expr) {
// Parse this into something allowing us to map from a function
// name to the typedef'ed function pointer name
- List<String> tokens = new ArrayList<String>();
- StringTokenizer tok1 = new StringTokenizer(expr);
+ final List<String> tokens = new ArrayList<String>();
+ final StringTokenizer tok1 = new StringTokenizer(expr);
while (tok1.hasMoreTokens()) {
- String sstr = tok1.nextToken();
- StringTokenizer tok2 = new StringTokenizer(sstr, "$()", true);
+ final String sstr = tok1.nextToken();
+ final StringTokenizer tok2 = new StringTokenizer(sstr, "$()", true);
while (tok2.hasMoreTokens()) {
tokens.add(tok2.nextToken());
}
@@ -122,40 +122,40 @@ public class ProcAddressConfiguration extends JavaConfiguration {
}
}
- protected void readProcAddressNameExpr(StringTokenizer tok, String filename, int lineNo) {
+ protected void readProcAddressNameExpr(final StringTokenizer tok, final String filename, final int lineNo) {
try {
String restOfLine = tok.nextToken("\n\r\f");
restOfLine = restOfLine.trim();
setProcAddressNameExpr(restOfLine);
- } catch (NoSuchElementException e) {
+ } catch (final NoSuchElementException e) {
throw new RuntimeException("Error parsing \"ProcAddressNameExpr\" command at line " + lineNo
+ " in file \"" + filename + "\"", e);
}
}
- protected void readLocalProcAddressCallingConvention(StringTokenizer tok, String filename, int lineNo) throws IOException {
+ protected void readLocalProcAddressCallingConvention(final StringTokenizer tok, final String filename, final int lineNo) throws IOException {
try {
- String functionName = tok.nextToken();
- String callingConvention = tok.nextToken();
+ final String functionName = tok.nextToken();
+ final String callingConvention = tok.nextToken();
if (functionName.equals("__ALL__")) {
localProcAddressCallingConvention4All = callingConvention;
} else {
localProcAddressCallingConventionMap.put(functionName, callingConvention);
}
- } catch (NoSuchElementException e) {
+ } catch (final NoSuchElementException e) {
throw new RuntimeException("Error parsing \"LocalProcAddressCallingConvention\" command at line " + lineNo
+ " in file \"" + filename + "\"", e);
}
}
- private static ConvNode makeConverter(Iterator<String> iter) {
- List<ConvNode> result = new ArrayList<ConvNode>();
+ private static ConvNode makeConverter(final Iterator<String> iter) {
+ final List<ConvNode> result = new ArrayList<ConvNode>();
while (iter.hasNext()) {
- String str = iter.next();
+ final String str = iter.next();
if (str.equals("$")) {
- String command = iter.next();
- String openParen = iter.next();
+ final String command = iter.next();
+ final String openParen = iter.next();
if (!openParen.equals("(")) {
throw new NoSuchElementException("Expected \"(\"");
}
@@ -191,15 +191,15 @@ public class ProcAddressConfiguration extends JavaConfiguration {
static class FormatNode extends ConvNode {
- private MessageFormat msgFmt;
+ private final MessageFormat msgFmt;
- FormatNode(String fmt) {
+ FormatNode(final String fmt) {
msgFmt = new MessageFormat(fmt);
}
@Override
- String convert(String funcName) {
- StringBuffer buf = new StringBuffer();
+ String convert(final String funcName) {
+ final StringBuffer buf = new StringBuffer();
msgFmt.format(new Object[]{funcName}, buf, null);
return buf.toString();
}
@@ -207,30 +207,30 @@ public class ProcAddressConfiguration extends JavaConfiguration {
static class ConstStringNode extends ConvNode {
- private String str;
+ private final String str;
- ConstStringNode(String str) {
+ ConstStringNode(final String str) {
this.str = str;
}
@Override
- String convert(String funcName) {
+ String convert(final String funcName) {
return str;
}
}
static class ConcatNode extends ConvNode {
- private List<ConvNode> children;
+ private final List<ConvNode> children;
- ConcatNode(List<ConvNode> children) {
+ ConcatNode(final List<ConvNode> children) {
this.children = children;
}
@Override
- String convert(String funcName) {
- StringBuilder res = new StringBuilder();
- for (ConvNode node : children) {
+ String convert(final String funcName) {
+ final StringBuilder res = new StringBuilder();
+ for (final ConvNode node : children) {
res.append(node.convert(funcName));
}
return res.toString();
@@ -239,16 +239,16 @@ public class ProcAddressConfiguration extends JavaConfiguration {
static class CaseNode extends ConvNode {
- private boolean upperCase;
- private ConvNode child;
+ private final boolean upperCase;
+ private final ConvNode child;
- CaseNode(boolean upperCase, ConvNode child) {
+ CaseNode(final boolean upperCase, final ConvNode child) {
this.upperCase = upperCase;
this.child = child;
}
@Override
- public String convert(String funcName) {
+ public String convert(final String funcName) {
if (upperCase) {
return child.convert(funcName).toUpperCase();
} else {
@@ -269,7 +269,7 @@ public class ProcAddressConfiguration extends JavaConfiguration {
return tableClassName;
}
- public boolean skipProcAddressGen(String name) {
+ public boolean skipProcAddressGen(final String name) {
return skipProcAddressGen.contains(name);
}
@@ -288,27 +288,27 @@ public class ProcAddressConfiguration extends JavaConfiguration {
return getProcAddressTableExpr;
}
- public String convertToFunctionPointerName(String funcName) {
+ public String convertToFunctionPointerName(final String funcName) {
if (procAddressNameConverter == null) {
throw new RuntimeException("ProcAddressNameExpr was not defined in .cfg file");
}
return procAddressNameConverter.convert(funcName);
}
- public boolean forceProcAddressGen(String funcName) {
+ public boolean forceProcAddressGen(final String funcName) {
return forceProcAddressGen4All || forceProcAddressGenSet.contains(funcName);
}
- public void addForceProcAddressGen(String funcName) {
+ public void addForceProcAddressGen(final String funcName) {
forceProcAddressGen.add(funcName);
forceProcAddressGenSet.add(funcName);
}
- public void addLocalProcAddressCallingConvention(String funcName, String callingConvention) {
+ public void addLocalProcAddressCallingConvention(final String funcName, final String callingConvention) {
localProcAddressCallingConventionMap.put(funcName, callingConvention);
}
- public String getLocalProcAddressCallingConvention(String funcName) {
+ public String getLocalProcAddressCallingConvention(final String funcName) {
if (isLocalProcAddressCallingConvention4All()) {
return getLocalProcAddressCallingConvention4All();
}
diff --git a/src/java/com/jogamp/gluegen/procaddress/ProcAddressEmitter.java b/src/java/com/jogamp/gluegen/procaddress/ProcAddressEmitter.java
index 6acaacd..a0adbd0 100644
--- a/src/java/com/jogamp/gluegen/procaddress/ProcAddressEmitter.java
+++ b/src/java/com/jogamp/gluegen/procaddress/ProcAddressEmitter.java
@@ -78,7 +78,7 @@ public class ProcAddressEmitter extends JavaEmitter {
protected String tableClassName;
@Override
- public void beginFunctions(TypeDictionary typedefDictionary, TypeDictionary structDictionary, Map<Type, Type> canonMap) throws Exception {
+ public void beginFunctions(final TypeDictionary typedefDictionary, final TypeDictionary structDictionary, final Map<Type, Type> canonMap) throws Exception {
this.typedefDictionary = typedefDictionary;
if (getProcAddressConfig().emitProcAddressTable()) {
@@ -96,7 +96,7 @@ public class ProcAddressEmitter extends JavaEmitter {
}
@Override
- public void beginStructs(TypeDictionary typedefDictionary, TypeDictionary structDictionary, Map<Type, Type> canonMap) throws Exception {
+ public void beginStructs(final TypeDictionary typedefDictionary, final TypeDictionary structDictionary, final Map<Type, Type> canonMap) throws Exception {
super.beginStructs(typedefDictionary, structDictionary, canonMap);
}
@@ -114,11 +114,11 @@ public class ProcAddressEmitter extends JavaEmitter {
}
@Override
- protected List<? extends FunctionEmitter> generateMethodBindingEmitters(Set<MethodBinding> methodBindingSet, FunctionSymbol sym) throws Exception {
+ protected List<? extends FunctionEmitter> generateMethodBindingEmitters(final Set<MethodBinding> methodBindingSet, final FunctionSymbol sym) throws Exception {
return generateMethodBindingEmittersImpl(methodBindingSet, sym);
}
- protected boolean needsModifiedEmitters(FunctionSymbol sym) {
+ protected boolean needsModifiedEmitters(final FunctionSymbol sym) {
if (!needsProcAddressWrapper(sym) || getConfig().isUnimplemented(getAliasedSymName(sym))) {
return false;
}
@@ -126,8 +126,8 @@ public class ProcAddressEmitter extends JavaEmitter {
return true;
}
- private List<? extends FunctionEmitter> generateMethodBindingEmittersImpl(Set<MethodBinding> methodBindingSet, FunctionSymbol sym) throws Exception {
- List<? extends FunctionEmitter> defaultEmitters = super.generateMethodBindingEmitters(methodBindingSet, sym);
+ private List<? extends FunctionEmitter> generateMethodBindingEmittersImpl(final Set<MethodBinding> methodBindingSet, final FunctionSymbol sym) throws Exception {
+ final List<? extends FunctionEmitter> defaultEmitters = super.generateMethodBindingEmitters(methodBindingSet, sym);
// if the superclass didn't generate any bindings for the symbol, let's
// honor that (for example, the superclass might have caught an Ignore
@@ -142,7 +142,7 @@ public class ProcAddressEmitter extends JavaEmitter {
return defaultEmitters;
}
- ArrayList<FunctionEmitter> modifiedEmitters = new ArrayList<FunctionEmitter>(defaultEmitters.size());
+ final ArrayList<FunctionEmitter> modifiedEmitters = new ArrayList<FunctionEmitter>(defaultEmitters.size());
if (needsProcAddressWrapper(sym)) {
if (getProcAddressConfig().emitProcAddressTable()) {
@@ -150,7 +150,7 @@ public class ProcAddressEmitter extends JavaEmitter {
emitProcAddressTableEntryForString(getAliasedSymName(sym));
}
}
- for (FunctionEmitter emitter : defaultEmitters) {
+ for (final FunctionEmitter emitter : defaultEmitters) {
if (emitter instanceof JavaMethodBindingEmitter) {
generateModifiedEmitters((JavaMethodBindingEmitter)emitter, modifiedEmitters);
} else if (emitter instanceof CMethodBindingEmitter) {
@@ -171,7 +171,7 @@ public class ProcAddressEmitter extends JavaEmitter {
* "PFNGLFUNCNAMEPROC". This returns a valid string regardless of
* whether or not the typedef is actually defined.
*/
- protected String getFunctionPointerTypedefName(FunctionSymbol sym) {
+ protected String getFunctionPointerTypedefName(final FunctionSymbol sym) {
return getProcAddressConfig().convertToFunctionPointerName(sym.getName());
}
@@ -180,7 +180,7 @@ public class ProcAddressEmitter extends JavaEmitter {
//
/** If 'native', enforce 'private native' modifiers. */
- protected void fixSecurityModifiers(JavaMethodBindingEmitter javaEmitter) {
+ protected void fixSecurityModifiers(final JavaMethodBindingEmitter javaEmitter) {
if( javaEmitter.hasModifier(JavaMethodBindingEmitter.NATIVE) &&
!javaEmitter.hasModifier(JavaMethodBindingEmitter.PRIVATE) )
{
@@ -192,9 +192,9 @@ public class ProcAddressEmitter extends JavaEmitter {
}
}
- protected void generateModifiedEmitters(JavaMethodBindingEmitter baseJavaEmitter, List<FunctionEmitter> emitters) {
+ protected void generateModifiedEmitters(final JavaMethodBindingEmitter baseJavaEmitter, final List<FunctionEmitter> emitters) {
// See whether we need a proc address entry for this one
- boolean callThroughProcAddress = needsProcAddressWrapper(baseJavaEmitter.getBinding().getCSymbol());
+ final boolean callThroughProcAddress = needsProcAddressWrapper(baseJavaEmitter.getBinding().getCSymbol());
// If this emitter doesn't have a body (i.e., is a direct native
// call with no intervening argument processing), we need to force
@@ -238,13 +238,13 @@ public class ProcAddressEmitter extends JavaEmitter {
}
}
- protected void generateModifiedEmitters(CMethodBindingEmitter baseCEmitter, List<FunctionEmitter> emitters) {
+ protected void generateModifiedEmitters(final CMethodBindingEmitter baseCEmitter, final List<FunctionEmitter> emitters) {
- FunctionSymbol cSymbol = baseCEmitter.getBinding().getCSymbol();
+ final FunctionSymbol cSymbol = baseCEmitter.getBinding().getCSymbol();
// See whether we need a proc address entry for this one
- boolean callThroughProcAddress = needsProcAddressWrapper(cSymbol);
- boolean forceProcAddress = getProcAddressConfig().forceProcAddressGen(cSymbol.getName());
+ final boolean callThroughProcAddress = needsProcAddressWrapper(cSymbol);
+ final boolean forceProcAddress = getProcAddressConfig().forceProcAddressGen(cSymbol.getName());
String forcedCallingConvention = null;
if (forceProcAddress) {
@@ -257,17 +257,17 @@ public class ProcAddressEmitter extends JavaEmitter {
// The C-side JNI binding for this particular function will have an
// extra final argument, which is the address (the OpenGL procedure
// address) of the function it needs to call
- ProcAddressCMethodBindingEmitter res = new ProcAddressCMethodBindingEmitter(
+ final ProcAddressCMethodBindingEmitter res = new ProcAddressCMethodBindingEmitter(
baseCEmitter, callThroughProcAddress, forceProcAddress, forcedCallingConvention, this);
- MessageFormat exp = baseCEmitter.getReturnValueCapacityExpression();
+ final MessageFormat exp = baseCEmitter.getReturnValueCapacityExpression();
if (exp != null) {
res.setReturnValueCapacityExpression(exp);
}
emitters.add(res);
}
- private String getAliasedSymName(FunctionSymbol sym) {
+ private String getAliasedSymName(final FunctionSymbol sym) {
String symName = getConfig().getJavaSymbolRename(sym.getName());
if (null == symName) {
symName = sym.getName();
@@ -275,14 +275,14 @@ public class ProcAddressEmitter extends JavaEmitter {
return symName;
}
- protected boolean needsProcAddressWrapper(FunctionSymbol sym) {
- String symName = getAliasedSymName(sym);
+ protected boolean needsProcAddressWrapper(final FunctionSymbol sym) {
+ final String symName = getAliasedSymName(sym);
- ProcAddressConfiguration config = getProcAddressConfig();
+ final ProcAddressConfiguration config = getProcAddressConfig();
// We should only generate code to call through a function pointer
// if the symbol has an associated function pointer typedef.
- String funcPointerTypedefName = getFunctionPointerTypedefName(sym);
+ final String funcPointerTypedefName = getFunctionPointerTypedefName(sym);
boolean shouldWrap = typedefDictionary.containsKey(funcPointerTypedefName);
//System.err.println(funcPointerTypedefName + " defined: " + shouldWrap);
@@ -319,7 +319,7 @@ public class ProcAddressEmitter extends JavaEmitter {
tableWriter.println("package " + implPackageName + ";");
tableWriter.println();
- for (String imporT : getConfig().imports()) {
+ for (final String imporT : getConfig().imports()) {
tableWriter.println("import " + imporT + ";");
}
tableWriter.println("import " + ProcAddressTable.class.getName() + ";");
@@ -333,7 +333,7 @@ public class ProcAddressEmitter extends JavaEmitter {
tableWriter.println(tableClassAccess.getJavaName() + " final class " + tableClassName + " extends "+ ProcAddressTable.class.getSimpleName() + " {");
tableWriter.println();
- for (String string : getProcAddressConfig().getForceProcAddressGen()) {
+ for (final String string : getProcAddressConfig().getForceProcAddressGen()) {
emitProcAddressTableEntryForString(string);
}
@@ -351,7 +351,7 @@ public class ProcAddressEmitter extends JavaEmitter {
tableWriter.close();
}
- protected void emitProcAddressTableEntryForString(String str) {
+ protected void emitProcAddressTableEntryForString(final String str) {
// Deal gracefully with forced proc address generation in the face
// of having the function pointer typedef in the header file too
if (emittedTableEntries.contains(str)) {
diff --git a/src/java/com/jogamp/gluegen/procaddress/ProcAddressJavaMethodBindingEmitter.java b/src/java/com/jogamp/gluegen/procaddress/ProcAddressJavaMethodBindingEmitter.java
index f28c50d..a70c18d 100644
--- a/src/java/com/jogamp/gluegen/procaddress/ProcAddressJavaMethodBindingEmitter.java
+++ b/src/java/com/jogamp/gluegen/procaddress/ProcAddressJavaMethodBindingEmitter.java
@@ -53,8 +53,8 @@ public class ProcAddressJavaMethodBindingEmitter extends JavaMethodBindingEmitte
protected String getProcAddressTableExpr;
protected ProcAddressEmitter emitter;
- public ProcAddressJavaMethodBindingEmitter(JavaMethodBindingEmitter methodToWrap, boolean callThroughProcAddress,
- String getProcAddressTableExpr, boolean changeNameAndArguments, ProcAddressEmitter emitter) {
+ public ProcAddressJavaMethodBindingEmitter(final JavaMethodBindingEmitter methodToWrap, final boolean callThroughProcAddress,
+ final String getProcAddressTableExpr, final boolean changeNameAndArguments, final ProcAddressEmitter emitter) {
super(methodToWrap);
@@ -74,14 +74,14 @@ public class ProcAddressJavaMethodBindingEmitter extends JavaMethodBindingEmitte
}
}
- public ProcAddressJavaMethodBindingEmitter(ProcAddressJavaMethodBindingEmitter methodToWrap) {
+ public ProcAddressJavaMethodBindingEmitter(final ProcAddressJavaMethodBindingEmitter methodToWrap) {
this(methodToWrap, methodToWrap.callThroughProcAddress, methodToWrap.getProcAddressTableExpr,
methodToWrap.changeNameAndArguments, methodToWrap.emitter);
}
@Override
public String getName() {
- String res = super.getName();
+ final String res = super.getName();
if (changeNameAndArguments) {
return ProcAddressEmitter.WRAP_PREFIX + res;
}
@@ -89,7 +89,7 @@ public class ProcAddressJavaMethodBindingEmitter extends JavaMethodBindingEmitte
}
@Override
- protected int emitArguments(PrintWriter writer) {
+ protected int emitArguments(final PrintWriter writer) {
int numEmitted = super.emitArguments(writer);
if (callThroughProcAddress) {
if (changeNameAndArguments) {
@@ -107,7 +107,7 @@ public class ProcAddressJavaMethodBindingEmitter extends JavaMethodBindingEmitte
@Override
protected String getImplMethodName() {
- String name = super.getImplMethodName();
+ final String name = super.getImplMethodName();
if (callThroughProcAddress) {
return ProcAddressEmitter.WRAP_PREFIX + name;
}
@@ -115,11 +115,11 @@ public class ProcAddressJavaMethodBindingEmitter extends JavaMethodBindingEmitte
}
@Override
- protected void emitPreCallSetup(MethodBinding binding, PrintWriter writer) {
+ protected void emitPreCallSetup(final MethodBinding binding, final PrintWriter writer) {
super.emitPreCallSetup(binding, writer);
if (callThroughProcAddress) {
- String procAddressVariable = ProcAddressEmitter.PROCADDRESS_VAR_PREFIX + binding.getName();
+ final String procAddressVariable = ProcAddressEmitter.PROCADDRESS_VAR_PREFIX + binding.getName();
writer.println(" final long __addr_ = " + getProcAddressTableExpr + "." + procAddressVariable + ";");
writer.println(" if (__addr_ == 0) {");
writer.format(" throw new %s(String.format(\"Method \\\"%%s\\\" not available\", \"%s\"));%n",
@@ -129,7 +129,7 @@ public class ProcAddressJavaMethodBindingEmitter extends JavaMethodBindingEmitte
}
@Override
- protected int emitCallArguments(MethodBinding binding, PrintWriter writer) {
+ protected int emitCallArguments(final MethodBinding binding, final PrintWriter writer) {
int numEmitted = super.emitCallArguments(binding, writer);
if (callThroughProcAddress) {
if (numEmitted > 0) {
@@ -146,7 +146,7 @@ public class ProcAddressJavaMethodBindingEmitter extends JavaMethodBindingEmitte
public class WrappedMethodCommentEmitter extends JavaMethodBindingEmitter.DefaultCommentEmitter {
@Override
- protected void emitBeginning(FunctionEmitter methodEmitter, PrintWriter writer) {
+ protected void emitBeginning(final FunctionEmitter methodEmitter, final PrintWriter writer) {
writer.print("Entry point (through function pointer) to C language function: <br> ");
}
}