summaryrefslogtreecommitdiffstats
path: root/src/java/com/sun/gluegen
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/com/sun/gluegen')
-rw-r--r--src/java/com/sun/gluegen/cgram/types/CompoundType.java4
-rw-r--r--src/java/com/sun/gluegen/cgram/types/EnumType.java8
-rw-r--r--src/java/com/sun/gluegen/cgram/types/FunctionType.java8
3 files changed, 15 insertions, 5 deletions
diff --git a/src/java/com/sun/gluegen/cgram/types/CompoundType.java b/src/java/com/sun/gluegen/cgram/types/CompoundType.java
index 51efad5..0a880de 100644
--- a/src/java/com/sun/gluegen/cgram/types/CompoundType.java
+++ b/src/java/com/sun/gluegen/cgram/types/CompoundType.java
@@ -69,7 +69,9 @@ public class CompoundType extends Type implements Cloneable {
public Object clone() {
CompoundType n = (CompoundType) super.clone();
- n.fields = (ArrayList) this.fields.clone();
+ if(null!=this.fields) {
+ n.fields = (ArrayList) this.fields.clone();
+ }
return n;
}
diff --git a/src/java/com/sun/gluegen/cgram/types/EnumType.java b/src/java/com/sun/gluegen/cgram/types/EnumType.java
index c6f8541..49f962d 100644
--- a/src/java/com/sun/gluegen/cgram/types/EnumType.java
+++ b/src/java/com/sun/gluegen/cgram/types/EnumType.java
@@ -87,8 +87,12 @@ public class EnumType extends IntType implements Cloneable {
public Object clone() {
EnumType n = (EnumType) super.clone();
- n.underlyingType = (IntType) this.underlyingType.clone();
- n.enums = (ArrayList) this.enums.clone();
+ if(null!=this.underlyingType) {
+ n.underlyingType = (IntType) this.underlyingType.clone();
+ }
+ if(null!=this.enums) {
+ n.enums = (ArrayList) this.enums.clone();
+ }
return n;
}
diff --git a/src/java/com/sun/gluegen/cgram/types/FunctionType.java b/src/java/com/sun/gluegen/cgram/types/FunctionType.java
index 35b62b7..3b09d8b 100644
--- a/src/java/com/sun/gluegen/cgram/types/FunctionType.java
+++ b/src/java/com/sun/gluegen/cgram/types/FunctionType.java
@@ -56,8 +56,12 @@ public class FunctionType extends Type implements Cloneable {
public Object clone() {
FunctionType n = (FunctionType) super.clone();
- n.argumentTypes = (ArrayList) this.argumentTypes.clone();
- n.argumentNames = (ArrayList) this.argumentNames.clone();
+ if(null!=this.argumentTypes) {
+ n.argumentTypes = (ArrayList) this.argumentTypes.clone();
+ }
+ if(null!=this.argumentNames) {
+ n.argumentNames = (ArrayList) this.argumentNames.clone();
+ }
return n;
}