From 775ec79d5d719c1eba9c4687ae066f6b82696e4f Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Sun, 18 May 2014 10:01:56 -0700 Subject: 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 --- src/java/com/jogamp/gluegen/FunctionEmitter.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/java/com') 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 modifiers = new ArrayList(); + private final ArrayList 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(); 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)arg.modifiers.clone(); + modifiers = new ArrayList(arg.modifiers); commentEmitter = arg.commentEmitter; defaultOutput = arg.defaultOutput; isInterfaceVal = arg.isInterfaceVal; -- cgit v1.2.3