1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 02:06:01 +02:00

Return a meaningful name if we can.

This commit is contained in:
Sergey Prigogin 2009-04-29 03:28:10 +00:00
parent 2b86aeb5b9
commit c9a37ff6c0

View file

@ -109,14 +109,14 @@ public class ProblemBinding extends PlatformObject implements IProblemBinding, I
* @see org.eclipse.cdt.core.dom.ast.IBinding#getName() * @see org.eclipse.cdt.core.dom.ast.IBinding#getName()
*/ */
public String getName() { public String getName() {
return CPPSemantics.EMPTY_NAME; return node instanceof IASTName ? new String(((IASTName) node).getSimpleID()) : CPPSemantics.EMPTY_NAME;
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IBinding#getNameCharArray() * @see org.eclipse.cdt.core.dom.ast.IBinding#getNameCharArray()
*/ */
public char[] getNameCharArray() { public char[] getNameCharArray() {
return CharArrayUtils.EMPTY; return node instanceof IASTName ? ((IASTName) node).getSimpleID() : CharArrayUtils.EMPTY;
} }
/* (non-Javadoc) /* (non-Javadoc)