diff options
author | Sven Gothel <[email protected]> | 2012-10-16 06:56:14 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-10-16 06:56:14 +0200 |
commit | a8e9be19b0215fe349c1861c5ea866e929923337 (patch) | |
tree | 6c9371ab9523b536cbe2e08b7b74d9e0dfad5f03 /src/java/com/jogamp/gluegen/cgram | |
parent | 5e0af71477289c7686a0f4b348dfe36fb8e5b644 (diff) |
Intermediate revised Type.java edit before reducing
Diffstat (limited to 'src/java/com/jogamp/gluegen/cgram')
-rw-r--r-- | src/java/com/jogamp/gluegen/cgram/types/Type.java | 42 |
1 files changed, 34 insertions, 8 deletions
diff --git a/src/java/com/jogamp/gluegen/cgram/types/Type.java b/src/java/com/jogamp/gluegen/cgram/types/Type.java index a269ae0..caa6d96 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/Type.java +++ b/src/java/com/jogamp/gluegen/cgram/types/Type.java @@ -187,23 +187,49 @@ public abstract class Type implements Cloneable { */ @Override public boolean equals(Object arg) { - if (arg == this) + if (arg == this) { return true; + } - if (!(arg instanceof Type)) + if ( !(arg instanceof Type) ) { return false; + } - Type t = (Type)arg; - if (size != t.size) + final Type t = (Type)arg; + if ( size != t.size ) { return false; + } - if (cvAttributes != t.cvAttributes) + if ( cvAttributes != t.cvAttributes ) { return false; + } - if (name != null) + if ( null == name ) { + return null == t.name; + } else { return name.equals(t.name); - else - return name == t.name; + } + + /* + * Orig: + * + return ( ( name == null ? t.name == null : name.equals(t.name) ) || + ( name != null && name.equals(name) ) + ) && size == t.size && cvAttributes == t.cvAttributes; + + Cleaned-1: + + return size == t.size && cvAttributes == t.cvAttributes && + ( ( name == null ? t.name == null : name.equals(t.name) ) || + ( name != null && name.equals(name) ) + ); + + Cleaned-2: + + return size == t.size && cvAttributes == t.cvAttributes && + ( null == name ? null == t.name : name.equals(t.name) ) ; + + */ } /** Returns a string representation of this type. This string is not |