From c045393b507ba21e0bcb82b0ca79c30ccd9bf20a Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Fri, 4 Apr 2003 14:01:31 +0000 Subject: [PATCH] Patch for Hoda Amer: - Delta Builder Helper Functions in the CModel - Plus some cleanups --- .../eclipse/cdt/core/model/INamespace.java | 5 -- .../org/eclipse/cdt/core/model/ITypeDef.java | 4 -- .../cdt/internal/core/model/CElement.java | 2 +- .../cdt/internal/core/model/Enumeration.java | 30 ++++---- .../internal/core/model/EnumerationInfo.java | 21 ++++++ .../cdt/internal/core/model/Field.java | 11 --- .../cdt/internal/core/model/FieldInfo.java | 35 +++++---- .../core/model/FunctionDeclaration.java | 5 +- .../cdt/internal/core/model/FunctionInfo.java | 19 ++--- .../core/model/MethodDeclaration.java | 15 ++-- .../cdt/internal/core/model/MethodInfo.java | 14 ++++ .../cdt/internal/core/model/Namespace.java | 4 -- .../core/model/SourceManipulation.java | 5 ++ .../core/model/SourceManipulationInfo.java | 2 +- .../internal/core/model/StructureInfo.java | 72 ++----------------- .../cdt/internal/core/model/TypeDef.java | 15 +--- .../cdt/internal/core/model/VariableInfo.java | 24 ++++--- .../core/model/SimpleDeclarationWrapper.java | 2 + .../eclipse/cdt/ui/CElementLabelProvider.java | 2 + 19 files changed, 114 insertions(+), 173 deletions(-) create mode 100644 core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/EnumerationInfo.java diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/INamespace.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/INamespace.java index ba8a5d6652f..fdc504d1d18 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/INamespace.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/INamespace.java @@ -8,9 +8,4 @@ package org.eclipse.cdt.core.model; * Represents a package declaration in a C translation unit. */ public interface INamespace extends ICElement, IParent, ISourceManipulation, ISourceReference { - /** - * Returns the name of the package the statement refers to. - * This is a handle-only method. - */ - String getElementName(); } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ITypeDef.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ITypeDef.java index eae2e26fbcc..17a6fc9e176 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ITypeDef.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/ITypeDef.java @@ -9,8 +9,4 @@ package org.eclipse.cdt.core.model; * Represents a field declared in a type. */ public interface ITypeDef extends ICElement, ISourceManipulation, ISourceReference { - /** - * Return the type beeing alias. - */ - String getType() throws CModelException; } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElement.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElement.java index bc6262f65d4..b1699885079 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElement.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElement.java @@ -185,7 +185,7 @@ public abstract class CElement extends PlatformObject implements ICElement { return false; if (fType != other.fType) return false; - if (other.fName != null && fName.equals(other.fName)) { + if (fName.equals(other.fName)) { if (fParent != null && fParent.equals(other.fParent)) { return true; } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Enumeration.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Enumeration.java index 5c8736f6174..09444485a0e 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Enumeration.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Enumeration.java @@ -16,19 +16,17 @@ import org.eclipse.cdt.core.model.IEnumeration; public class Enumeration extends SourceManipulation implements IEnumeration{ - String typeName = ""; - boolean isStatic = false; - boolean isConst = false; - boolean isVolatile = false; - public Enumeration(ICElement parent, String name) { - super(parent, name, CElement.C_ENUMERATION); + super(parent, name, CElement.C_ENUMERATION); } protected CElementInfo createElementInfo () { - return new SourceManipulationInfo(this); + return new EnumerationInfo(this); } + private EnumerationInfo getEnumerationInfo(){ + return (EnumerationInfo) getElementInfo(); + } /** * @see org.eclipse.cdt.core.model.IVariable#getInitializer() */ @@ -40,14 +38,14 @@ public class Enumeration extends SourceManipulation implements IEnumeration{ * @see org.eclipse.cdt.core.model.IVariableDeclaration#getTypeName() */ public String getTypeName() { - return typeName; + return getEnumerationInfo().getTypeName(); } /** * @see org.eclipse.cdt.core.model.IVariableDeclaration#setTypeName(java.lang.String) */ public void setTypeName(String type) { - typeName = type; + getEnumerationInfo().setTypeName(type); } /** @@ -61,21 +59,21 @@ public class Enumeration extends SourceManipulation implements IEnumeration{ * @see org.eclipse.cdt.core.model.IDeclaration#isConst() */ public boolean isConst() { - return isConst; + return getEnumerationInfo().isConst(); } /** * @see org.eclipse.cdt.core.model.IDeclaration#isStatic() */ public boolean isStatic() { - return isStatic; + return getEnumerationInfo().isStatic(); } /** * @see org.eclipse.cdt.core.model.IDeclaration#isVolatile() */ public boolean isVolatile() { - return isVolatile; + return getEnumerationInfo().isVolatile(); } /** @@ -83,7 +81,7 @@ public class Enumeration extends SourceManipulation implements IEnumeration{ * @param isConst The isConst to set */ public void setConst(boolean isConst) { - this.isConst = isConst; + getEnumerationInfo().setConst(isConst); } /** @@ -91,7 +89,7 @@ public class Enumeration extends SourceManipulation implements IEnumeration{ * @param isStatic The isStatic to set */ public void setStatic(boolean isStatic) { - this.isStatic = isStatic; + getEnumerationInfo().setStatic( isStatic); } /** @@ -99,7 +97,7 @@ public class Enumeration extends SourceManipulation implements IEnumeration{ * @param isVolatile The isVolatile to set */ public void setVolatile(boolean isVolatile) { - this.isVolatile = isVolatile; - } + getEnumerationInfo().setVolatile(isVolatile); + } } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/EnumerationInfo.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/EnumerationInfo.java new file mode 100644 index 00000000000..511a8a79a00 --- /dev/null +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/EnumerationInfo.java @@ -0,0 +1,21 @@ +package org.eclipse.cdt.internal.core.model; + +/********************************************************************** + * Copyright (c) 2002,2003 Rational Software Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v0.5 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v05.html + * + * Contributors: + * Rational Software - Initial API and implementation +***********************************************************************/ +public class EnumerationInfo extends VariableInfo{ + + + protected EnumerationInfo(CElement element) { + super(element); + } + + +} diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Field.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Field.java index 9526548008e..c60529c114c 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Field.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Field.java @@ -86,15 +86,4 @@ public class Field extends SourceManipulation implements IField { protected CElementInfo createElementInfo () { return new FieldInfo(this); } - - // tests both info stored in element and element info - public boolean isIdentical(Field other){ - FieldInfo otherInfo= other.getFieldInfo(); - if ( (this.equals(other)) - && (getFieldInfo().hasSameContentsAs(otherInfo)) - ) - return true; - else - return false; - } } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FieldInfo.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FieldInfo.java index 4dd86e3adde..49d7a196190 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FieldInfo.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FieldInfo.java @@ -36,25 +36,6 @@ public class FieldInfo extends SourceManipulationInfo { protected String getTypeName(){ return typeStr; } - - /** - * Tests info stored in element info only - * @param otherInfo - * @return boolean - */ - public boolean hasSameContentsAs( SourceManipulationInfo info){ - FieldInfo otherInfo = (FieldInfo) info; - if( (typeStr.equals(otherInfo.getTypeName())) - && (isConst == otherInfo.isConst()) - && (isVolatile == otherInfo.isVolatile()) - && (isMutable == otherInfo.isMutable()) - && (visibility == otherInfo.getVisibility()) - && (isStatic == otherInfo.isStatic()) - ) - return true; - else - return false; - } protected void setAccessControl(int flags) { this.flags = flags; @@ -110,4 +91,20 @@ public class FieldInfo extends SourceManipulationInfo { public void setVisibility(int visibility) { this.visibility = visibility; } + + /** + * @see org.eclipse.cdt.internal.core.model.SourceManipulationInfo#hasSameContentsAs(SourceManipulationInfo) + */ + public boolean hasSameContentsAs( SourceManipulationInfo info){ + + return( super.hasSameContentsAs(info) + && (typeStr.equals(((FieldInfo)info).getTypeName())) + && (isConst == ((FieldInfo)info).isConst()) + && (isVolatile == ((FieldInfo)info).isVolatile()) + && (isMutable == ((FieldInfo)info).isMutable()) + && (visibility == ((FieldInfo)info).getVisibility()) + && (isStatic == ((FieldInfo)info).isStatic()) + ); + } + } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FunctionDeclaration.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FunctionDeclaration.java index 66a3640ccd8..89a20823fd3 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FunctionDeclaration.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FunctionDeclaration.java @@ -35,7 +35,6 @@ public class FunctionDeclaration extends SourceManipulation implements IFunction public void setReturnType(String type){ returnType = type; - getFunctionInfo().setReturnType(type); } public int getNumberOfParameters() { @@ -91,8 +90,12 @@ public class FunctionDeclaration extends SourceManipulation implements IFunction } public boolean equals(Object other) { + // Two function declarations are equal if + // Their parents and names are equal and return ( super.equals(other) + // their parameter types are equal and && Util.equalArraysOrNull(fParameterTypes, ((FunctionDeclaration)other).fParameterTypes) + // their return types are equal && getReturnType().equals(((FunctionDeclaration)other).getReturnType()) ); } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FunctionInfo.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FunctionInfo.java index e3b21d18710..980e600f5a5 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FunctionInfo.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FunctionInfo.java @@ -8,8 +8,6 @@ package org.eclipse.cdt.internal.core.model; class FunctionInfo extends SourceManipulationInfo { protected int flags; - protected String returnType = ""; - protected int numOfParams; protected boolean isStatic; protected boolean isVolatile; @@ -27,13 +25,6 @@ class FunctionInfo extends SourceManipulationInfo { this.flags = flags; } - protected String getReturnType(){ - return returnType; - } - - protected void setReturnType(String type){ - returnType = type; - } /** * Returns the isStatic. * @return boolean @@ -66,4 +57,14 @@ class FunctionInfo extends SourceManipulationInfo { this.isVolatile = isVolatile; } + /** + * @see org.eclipse.cdt.internal.core.model.SourceManipulationInfo#hasSameContentsAs(org.eclipse.cdt.internal.core.model.SourceManipulationInfo) + */ + public boolean hasSameContentsAs(SourceManipulationInfo otherInfo) { + return (super.hasSameContentsAs(otherInfo) + && (this.isStatic() == ((FunctionInfo)otherInfo).isStatic()) + && (this.isVolatile() == ((FunctionInfo)otherInfo).isVolatile()) + ); + } + } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MethodDeclaration.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MethodDeclaration.java index 7f6e260d6b8..1f9bce352f7 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MethodDeclaration.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MethodDeclaration.java @@ -17,7 +17,7 @@ import org.eclipse.cdt.core.model.IMethodDeclaration; public class MethodDeclaration extends FunctionDeclaration implements IMethodDeclaration{ boolean isConst; - boolean isVolatile; +; public MethodDeclaration(ICElement parent, String name){ super(parent, name, CElement.C_METHOD_DECLARATION); @@ -90,15 +90,6 @@ public class MethodDeclaration extends FunctionDeclaration implements IMethodDec getMethodInfo().setConst(isConst); } - public boolean isVolatile(){ - return isVolatile; - } - - public void setVolatile(boolean isVolatile){ - this.isVolatile = isVolatile; - getMethodInfo().setVolatile(isVolatile); - } - public int getVisibility(){ return getMethodInfo().getVisibility(); } @@ -119,9 +110,11 @@ public class MethodDeclaration extends FunctionDeclaration implements IMethodDec * See if we need anything else to put in equals here */ public boolean equals(Object other) { + // Two methods are equal if + // their parents, names, parameter types and return types are equal and return ( super.equals(other) + // their constant directive is the same && isConst() == ((MethodDeclaration)other).isConst() - && isVolatile() == ((MethodDeclaration)other).isVolatile() ); } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MethodInfo.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MethodInfo.java index eb3b34d72b7..908d9a3ead0 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MethodInfo.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MethodInfo.java @@ -83,4 +83,18 @@ public class MethodInfo extends FunctionInfo { this.visibility = visibility; } + /** + * @see org.eclipse.cdt.internal.core.model.SourceManipulationInfo#hasSameContentsAs(org.eclipse.cdt.internal.core.model.SourceManipulationInfo) + */ + public boolean hasSameContentsAs(SourceManipulationInfo otherInfo) { + return (super.hasSameContentsAs(otherInfo) + && (isConst == ((MethodInfo)otherInfo).isConst()) + && (isAbstract == ((MethodInfo)otherInfo).isAbstract()) + && (isInline == ((MethodInfo)otherInfo).isInline()) + && (isVirtual == ((MethodInfo)otherInfo).isVirtual()) + && (isFriend == ((MethodInfo)otherInfo).isFriend()) + && (visibility == ((MethodInfo)otherInfo).getVisibility()) + ); + } + } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Namespace.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Namespace.java index 46c6baa0de9..d52bca43905 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Namespace.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Namespace.java @@ -20,8 +20,4 @@ public class Namespace extends SourceManipulation implements INamespace{ super(parent, name, CElement.C_NAMESPACE); } - protected CElementInfo createElementInfo () { - return new SourceManipulationInfo(this); - } - } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulation.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulation.java index c97e537db55..35a9a9e7b34 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulation.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulation.java @@ -152,4 +152,9 @@ public class SourceManipulation extends Parent implements ISourceManipulation, I protected SourceManipulationInfo getSourceManipulationInfo() { return (SourceManipulationInfo)getElementInfo(); } + + public boolean isIdentical(SourceManipulation other){ + return (this.equals(other) + && (this.getSourceManipulationInfo().hasSameContentsAs(other.getSourceManipulationInfo()))); + } } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulationInfo.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulationInfo.java index 132aee5a55d..02ac28e2727 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulationInfo.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulationInfo.java @@ -146,7 +146,7 @@ class SourceManipulationInfo extends CElementInfo { * subclasses should override */ public boolean hasSameContentsAs( SourceManipulationInfo otherInfo){ - return true; + return (this.element.fType == otherInfo.element.fType); } } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/StructureInfo.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/StructureInfo.java index 99b7f92534f..e50ba53ac5b 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/StructureInfo.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/StructureInfo.java @@ -12,22 +12,17 @@ package org.eclipse.cdt.internal.core.model; ***********************************************************************/ import org.eclipse.cdt.core.model.ICElement; -public class StructureInfo extends SourceManipulationInfo { +public class StructureInfo extends VariableInfo { - String type; - boolean isConst = false; - boolean isVolatile = false; - boolean isStatic = false; - protected StructureInfo (CElement element) { super(element); if (element.getElementType() == ICElement.C_CLASS) - type = "class"; + this.setTypeName("class"); else if (element.getElementType() == ICElement.C_UNION) - type = "union"; + this.setTypeName("union"); else - type = "struct"; + this.setTypeName("struct"); } public boolean isUnion() { @@ -42,64 +37,5 @@ public class StructureInfo extends SourceManipulationInfo { return element.getElementType() == ICElement.C_STRUCT; } - public String getTypeName(){ - return type; - } - - public void setTypeString(String elmType){ - type = elmType; - } - public boolean hasSameContentsAs( StructureInfo otherInfo){ - return true; - } - - /** - * Returns the isConst. - * @return boolean - */ - public boolean isConst() { - return isConst; - } - - /** - * Returns the isStatic. - * @return boolean - */ - public boolean isStatic() { - return isStatic; - } - - /** - * Returns the isVolatile. - * @return boolean - */ - public boolean isVolatile() { - return isVolatile; - } - - /** - * Sets the isConst. - * @param isConst The isConst to set - */ - public void setConst(boolean isConst) { - this.isConst = isConst; - } - - /** - * Sets the isStatic. - * @param isStatic The isStatic to set - */ - public void setStatic(boolean isStatic) { - this.isStatic = isStatic; - } - - /** - * Sets the isVolatile. - * @param isVolatile The isVolatile to set - */ - public void setVolatile(boolean isVolatile) { - this.isVolatile = isVolatile; - } - } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TypeDef.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TypeDef.java index 87bd5e2bd4a..b2225698a4f 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TypeDef.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TypeDef.java @@ -11,26 +11,13 @@ package org.eclipse.cdt.internal.core.model; * Rational Software - Initial API and implementation ***********************************************************************/ -import org.eclipse.cdt.core.model.CModelException; import org.eclipse.cdt.core.model.ICElement; import org.eclipse.cdt.core.model.ITypeDef; public class TypeDef extends SourceManipulation implements ITypeDef{ - + public TypeDef(ICElement parent, String name) { super(parent, name, CElement.C_TYPEDEF); } - protected CElementInfo createElementInfo () { - return new SourceManipulationInfo(this); - } - - - /** - * @see org.eclipse.cdt.core.model.ITypeDef#getType() - */ - public String getType() throws CModelException { - return null; - } - } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/VariableInfo.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/VariableInfo.java index 17f634ee6b3..4e7f3d1f659 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/VariableInfo.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/VariableInfo.java @@ -29,13 +29,6 @@ class VariableInfo extends SourceManipulationInfo { protected void setTypeName(String type){ typeStr = type; } - - protected boolean hasSameContentsAs( VariableInfo otherInfo){ - if(typeStr.equals(otherInfo.getTypeName())) - return true; - else - return false; - } protected void setAccessControl(int flags) { this.flags = flags; @@ -60,12 +53,25 @@ class VariableInfo extends SourceManipulationInfo { this.isVolatile = isVolatile; } - public boolean isStatic() { + protected boolean isStatic() { return isStatic; } - public void setStatic(boolean isStatic) { + protected void setStatic(boolean isStatic) { this.isStatic = isStatic; } + /** + * @see org.eclipse.cdt.internal.core.model.SourceManipulationInfo#hasSameContentsAs(org.eclipse.cdt.internal.core.model.SourceManipulationInfo) + */ + public boolean hasSameContentsAs(SourceManipulationInfo otherInfo) { + return + ( super.hasSameContentsAs(otherInfo) + && ( typeStr.equals(((VariableInfo)otherInfo).getTypeName()) ) + && ( isConst() == ((VariableInfo)otherInfo).isConst() ) + && (isVolatile() == ((VariableInfo)otherInfo).isVolatile() ) + && (isStatic() == ((VariableInfo)otherInfo).isStatic() ) + ); + } + } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/model/SimpleDeclarationWrapper.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/model/SimpleDeclarationWrapper.java index 7a3d86a7082..f127fe6038b 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/model/SimpleDeclarationWrapper.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/model/SimpleDeclarationWrapper.java @@ -325,6 +325,7 @@ public class SimpleDeclarationWrapper extends DeclSpecifier implements DeclSpeci newElement.setVisibility(this.getCurrentVisibility()); newElement.setVolatile(isVolatile()); newElement.setStatic(isStatic()); + newElement.setConst(isConst()); return newElement; } @@ -349,6 +350,7 @@ public class SimpleDeclarationWrapper extends DeclSpecifier implements DeclSpeci newElement.setVisibility(this.getCurrentVisibility()); newElement.setVolatile(isVolatile()); newElement.setStatic(isStatic()); + newElement.setConst(isConst()); return newElement; } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementLabelProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementLabelProvider.java index 976598bd277..faeed71f3cd 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementLabelProvider.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CElementLabelProvider.java @@ -74,6 +74,8 @@ public class CElementLabelProvider extends LabelProvider { case ICElement.C_METHOD_DECLARATION: IFunctionDeclaration fDecl = (IFunctionDeclaration) celem; name = fDecl.getSignature(); + name += " : "; + name += fDecl.getReturnType(); break; case ICElement.C_STRUCT: case ICElement.C_UNION: