diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CVariable.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CVariable.java index 86e63b89b5a..181ba86c82c 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CVariable.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CVariable.java @@ -176,6 +176,8 @@ public abstract class CVariable extends CDebugElement private ICType fType = null; + private String fQualifiedName = null; + public InternalVariable( ICDIVariableObject varObject ) { setCDIVariableObject( varObject ); @@ -292,7 +294,11 @@ public abstract class CVariable extends CDebugElement protected String getQualifiedName() throws CDIException { - return ( fCDIVariableObject != null ) ? fCDIVariableObject.getQualifiedName() : null; + if ( fQualifiedName == null ) + { + fQualifiedName = ( fCDIVariableObject != null ) ? fCDIVariableObject.getQualifiedName() : null; + } + return fQualifiedName; } } @@ -321,11 +327,6 @@ public abstract class CVariable extends CDebugElement */ private String fName = null; - /** - * The full name of this variable. - */ - protected String fQualifiedName = null; - /** * Change flag. */ @@ -902,18 +903,16 @@ public abstract class CVariable extends CDebugElement protected String getQualifiedName() throws DebugException { - if ( fQualifiedName == null ) + String result = null; + try { - try - { - fQualifiedName = getInternalVariable().getQualifiedName(); - } - catch( CDIException e ) - { - requestFailed( "Qualified name is not available.", e ); - } + result = getInternalVariable().getQualifiedName(); } - return fQualifiedName; + catch( CDIException e ) + { + requestFailed( "Qualified name is not available.", e ); + } + return result; } /* (non-Javadoc)