From a8e9be19b0215fe349c1861c5ea866e929923337 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 16 Oct 2012 06:56:14 +0200 Subject: Intermediate revised Type.java edit before reducing --- src/java/com/jogamp/gluegen/cgram/types/Type.java | 42 ++++++++++++++++++----- 1 file changed, 34 insertions(+), 8 deletions(-) (limited to 'src/java/com/jogamp/gluegen/cgram') 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 -- cgit v1.2.3