From 73e8828566404e864170688dfb4fd530a83f8add Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 17 Oct 2012 18:42:32 +0200 Subject: Minor revert of clone replacement w/ copt-ctor of commit d7fb6a7bcfbd2d5ac452abdcdd31fb4d71441c70 clone of ArrayList is more shallow than it's clone operation (?) --- src/java/com/jogamp/gluegen/cgram/types/CompoundType.java | 3 ++- src/java/com/jogamp/gluegen/cgram/types/EnumType.java | 3 ++- src/java/com/jogamp/gluegen/cgram/types/FunctionType.java | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/java/com/jogamp/gluegen/cgram/types/CompoundType.java b/src/java/com/jogamp/gluegen/cgram/types/CompoundType.java index 746212d..8893283 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/CompoundType.java +++ b/src/java/com/jogamp/gluegen/cgram/types/CompoundType.java @@ -71,10 +71,11 @@ public abstract class CompoundType extends MemoryLayoutType implements Cloneable } } + @SuppressWarnings("unchecked") public Object clone() { CompoundType n = (CompoundType) super.clone(); if(null!=this.fields) { - n.fields = new ArrayList(this.fields); + n.fields = (ArrayList) this.fields.clone(); } 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 d21774f..99d0f7e 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/EnumType.java +++ b/src/java/com/jogamp/gluegen/cgram/types/EnumType.java @@ -85,13 +85,14 @@ 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 = new ArrayList(this.enums); + n.enums = (ArrayList) this.enums.clone(); } 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 fcaf97b..ca625cb 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/FunctionType.java +++ b/src/java/com/jogamp/gluegen/cgram/types/FunctionType.java @@ -54,13 +54,14 @@ 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 = new ArrayList(this.argumentTypes); + n.argumentTypes = (ArrayList) this.argumentTypes.clone(); } if(null!=this.argumentNames) { - n.argumentNames = new ArrayList(this.argumentNames); + n.argumentNames = (ArrayList) this.argumentNames.clone(); } return n; } -- cgit v1.2.3