diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPBasicType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPBasicType.java index b5a188a2e02..0fb977363d8 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPBasicType.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPBasicType.java @@ -23,7 +23,6 @@ import org.eclipse.cdt.internal.core.index.IIndexType; * Integral c++ type. */ public class CPPBasicType implements ICPPBasicType { - protected int qualifierBits = 0; protected int type; protected IASTExpression expression = null; @@ -32,9 +31,9 @@ public class CPPBasicType implements ICPPBasicType { type = t; qualifierBits = bits; - if (type == IBasicType.t_unspecified) { - if ((qualifierBits & (IS_LONG | IS_SHORT | IS_SIGNED | IS_UNSIGNED)) != 0) - type = IBasicType.t_int; + if (type == IBasicType.t_unspecified && + (qualifierBits & (IS_LONG | IS_SHORT | IS_SIGNED | IS_UNSIGNED)) != 0) { + type = IBasicType.t_int; } } @@ -44,29 +43,30 @@ public class CPPBasicType implements ICPPBasicType { expression= fromExpression; } - public boolean isSameType( IType object ) { - if( object == this ) + public boolean isSameType(IType object) { + if (object == this) return true; - if( object instanceof ITypedef || object instanceof IIndexType) - return object.isSameType( this ); + if (object instanceof ITypedef || object instanceof IIndexType) + return object.isSameType(this); - if( !(object instanceof CPPBasicType) ) + if (!(object instanceof CPPBasicType)) return false; - if( type == -1 ) + if (type == -1) return false; CPPBasicType t = (CPPBasicType) object; - if( type != t.type ) + if (type != t.type) return false; - if( type == IBasicType.t_int ){ + if (type == IBasicType.t_int) { //signed int and int are equivalent - return (qualifierBits & ~IS_SIGNED ) == (t.qualifierBits & ~IS_SIGNED ); + return (qualifierBits & ~IS_SIGNED) == (t.qualifierBits & ~IS_SIGNED); } - return ( type == t.type && qualifierBits == t.qualifierBits ); + return (type == t.type && qualifierBits == t.qualifierBits); } + /* (non-Javadoc) * @see org.eclipse.cdt.core.dom.ast.IBasicType#getType() */ @@ -78,36 +78,36 @@ public class CPPBasicType implements ICPPBasicType { * @see org.eclipse.cdt.core.dom.ast.IBasicType#isSigned() */ public boolean isSigned() { - return ( qualifierBits & IS_SIGNED ) != 0; + return (qualifierBits & IS_SIGNED) != 0; } /* (non-Javadoc) * @see org.eclipse.cdt.core.dom.ast.IBasicType#isUnsigned() */ public boolean isUnsigned() { - return ( qualifierBits & IS_UNSIGNED ) != 0; + return (qualifierBits & IS_UNSIGNED) != 0; } /* (non-Javadoc) * @see org.eclipse.cdt.core.dom.ast.IBasicType#isShort() */ public boolean isShort() { - return ( qualifierBits & IS_SHORT) != 0; + return (qualifierBits & IS_SHORT) != 0; } /* (non-Javadoc) * @see org.eclipse.cdt.core.dom.ast.IBasicType#isLong() */ public boolean isLong() { - return ( qualifierBits & IS_LONG ) != 0; + return (qualifierBits & IS_LONG) != 0; } @Override - public Object clone(){ + public Object clone() { IType t = null; try { t = (IType) super.clone(); - } catch ( CloneNotSupportedException e ) { + } catch (CloneNotSupportedException e) { //not going to happen } return t;