1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-05 23:35:48 +02:00

Use 'equals' to compare variables instead of names.

This commit is contained in:
Mikhail Khodjaiants 2003-01-27 18:31:43 +00:00
parent ddbb11efa5
commit 2e0af82c97
2 changed files with 6 additions and 14 deletions

View file

@ -1,3 +1,7 @@
2003-01-27 Mikhail Khodjaiants
Use 'equals' to compare CDI variables instead of names.
* CStackFrame.java
2003-01-27 Alain Magloire 2003-01-27 Alain Magloire
* src/org/eclipse/cdt/debug/core/cdi/model/ICDIVariableObject.java: * src/org/eclipse/cdt/debug/core/cdi/model/ICDIVariableObject.java:

View file

@ -130,11 +130,6 @@ public class CStackFrame extends CDebugElement
ICDIVariable var = findVariable( locals, local.getCDIVariable() ); ICDIVariable var = findVariable( locals, local.getCDIVariable() );
if ( var != null ) if ( var != null )
{ {
// update variable with new underling CDI LocalVariable
if ( !var.equals( local.getCDIVariable() ) )
{
local.setCDIVariable( var );
}
locals.remove( var ); locals.remove( var );
index++; index++;
} }
@ -718,21 +713,14 @@ public class CStackFrame extends CDebugElement
} }
} }
// temporary solution
protected ICDIVariable findVariable( List list, ICDIVariable var ) protected ICDIVariable findVariable( List list, ICDIVariable var )
{ {
Iterator it = list.iterator(); Iterator it = list.iterator();
while( it.hasNext() ) while( it.hasNext() )
{ {
ICDIVariable newVar = (ICDIVariable)it.next(); ICDIVariable newVar = (ICDIVariable)it.next();
try if ( newVar.equals( var ) )
{ return newVar;
if ( newVar.getName().equals( var.getName() ) )
return newVar;
}
catch( CDIException e )
{
}
} }
return null; return null;
} }