summaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/gluegen/FunctionEmitter.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-06-17 03:12:28 +0200
committerSven Gothel <[email protected]>2014-06-17 03:12:28 +0200
commitafb698ac3846713e5000226de9e28a9b06bf6f9a (patch)
tree83f795d0d9023ac022fe9b7af35f819125b79f17 /src/java/com/jogamp/gluegen/FunctionEmitter.java
parentc3054a01990e55ab35756ea23ab7d7c05f24dd37 (diff)
parent5d802fb8dd4004039d4597253712d24fffb90a36 (diff)
Merge remote-tracking branch 'hharrison/antlr-move'
Diffstat (limited to 'src/java/com/jogamp/gluegen/FunctionEmitter.java')
-rw-r--r--src/java/com/jogamp/gluegen/FunctionEmitter.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/java/com/jogamp/gluegen/FunctionEmitter.java b/src/java/com/jogamp/gluegen/FunctionEmitter.java
index 8bb2ca5..01a0e12 100644
--- a/src/java/com/jogamp/gluegen/FunctionEmitter.java
+++ b/src/java/com/jogamp/gluegen/FunctionEmitter.java
@@ -47,7 +47,7 @@ public abstract class FunctionEmitter {
public static final EmissionModifier STATIC = new EmissionModifier("static");
private boolean isInterfaceVal;
- private ArrayList<EmissionModifier> modifiers = new ArrayList<EmissionModifier>();
+ private final ArrayList<EmissionModifier> modifiers;
private CommentEmitter commentEmitter = null;
private PrintWriter defaultOutput;
@@ -56,6 +56,7 @@ public abstract class FunctionEmitter {
*/
public FunctionEmitter(PrintWriter defaultOutput, boolean isInterface) {
assert(defaultOutput != null);
+ this.modifiers = new ArrayList<EmissionModifier>();
this.defaultOutput = defaultOutput;
this.isInterfaceVal = isInterface;
}
@@ -63,9 +64,8 @@ public abstract class FunctionEmitter {
/**
* Makes this FunctionEmitter a copy of the passed one.
*/
- @SuppressWarnings("unchecked")
public FunctionEmitter(FunctionEmitter arg) {
- modifiers = (ArrayList<EmissionModifier>)arg.modifiers.clone();
+ modifiers = new ArrayList<EmissionModifier>(arg.modifiers);
commentEmitter = arg.commentEmitter;
defaultOutput = arg.defaultOutput;
isInterfaceVal = arg.isInterfaceVal;
@@ -169,7 +169,6 @@ public abstract class FunctionEmitter {
}
protected int emitModifiers(PrintWriter writer) {
- PrintWriter w = getDefaultOutput();
int numEmitted = 0;
for (Iterator<EmissionModifier> it = getModifiers(); it.hasNext(); ) {
writer.print(it.next());