diff options
3 files changed, 4 insertions, 7 deletions
diff --git a/src/java/com/jogamp/gluegen/cgram/types/CompoundType.java b/src/java/com/jogamp/gluegen/cgram/types/CompoundType.java index 8893283..746212d 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/CompoundType.java +++ b/src/java/com/jogamp/gluegen/cgram/types/CompoundType.java @@ -71,11 +71,10 @@ public abstract class CompoundType extends MemoryLayoutType implements Cloneable } } - @SuppressWarnings("unchecked") public Object clone() { CompoundType n = (CompoundType) super.clone(); if(null!=this.fields) { - n.fields = (ArrayList<Field>) this.fields.clone(); + n.fields = new ArrayList<Field>(this.fields); } return n; } diff --git a/src/java/com/jogamp/gluegen/cgram/types/EnumType.java b/src/java/com/jogamp/gluegen/cgram/types/EnumType.java index 99d0f7e..d21774f 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/EnumType.java +++ b/src/java/com/jogamp/gluegen/cgram/types/EnumType.java @@ -85,14 +85,13 @@ public class EnumType extends IntType implements Cloneable { this.underlyingType = underlyingType; } - @SuppressWarnings("unchecked") public Object clone() { EnumType n = (EnumType) super.clone(); if(null!=this.underlyingType) { n.underlyingType = (IntType) this.underlyingType.clone(); } if(null!=this.enums) { - n.enums = (ArrayList<Enum>) this.enums.clone(); + n.enums = new ArrayList<Enum>(this.enums); } return n; } diff --git a/src/java/com/jogamp/gluegen/cgram/types/FunctionType.java b/src/java/com/jogamp/gluegen/cgram/types/FunctionType.java index ca625cb..fcaf97b 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/FunctionType.java +++ b/src/java/com/jogamp/gluegen/cgram/types/FunctionType.java @@ -54,14 +54,13 @@ public class FunctionType extends Type implements Cloneable { this.returnType = returnType; } - @SuppressWarnings("unchecked") public Object clone() { FunctionType n = (FunctionType) super.clone(); if(null!=this.argumentTypes) { - n.argumentTypes = (ArrayList<Type>) this.argumentTypes.clone(); + n.argumentTypes = new ArrayList<Type>(this.argumentTypes); } if(null!=this.argumentNames) { - n.argumentNames = (ArrayList<String>) this.argumentNames.clone(); + n.argumentNames = new ArrayList<String>(this.argumentNames); } return n; } |