diff options
author | Harvey Harrison <[email protected]> | 2014-05-18 10:01:56 -0700 |
---|---|---|
committer | Harvey Harrison <[email protected]> | 2014-05-18 10:03:15 -0700 |
commit | 775ec79d5d719c1eba9c4687ae066f6b82696e4f (patch) | |
tree | 8bc2e6e44929502fed91ab000eea7de701b401d9 /src/java | |
parent | 274dbc38e4b671579a07cce8bf7ecab6520e22d6 (diff) |
gluegen: avoid a suppressed warning annotation by using the ArrayList copy constructor
clone() can't be used without warnigns and is no more efficient that the copy constructor,
replace the call and kill the suppressed warning annotation. While here, mark the
modifier list as private final.
Signed-off-by: Harvey Harrison <[email protected]>
Diffstat (limited to 'src/java')
-rw-r--r-- | src/java/com/jogamp/gluegen/FunctionEmitter.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/java/com/jogamp/gluegen/FunctionEmitter.java b/src/java/com/jogamp/gluegen/FunctionEmitter.java index 8bb2ca5..723af3a 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; |