mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-21 07:55:24 +02:00
Bug 419738 - Avoid blind casting when adding support to override
MIVariableManager and friends Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
This commit is contained in:
parent
8852f2d73e
commit
1b15d0bdc3
1 changed files with 12 additions and 3 deletions
|
@ -1234,7 +1234,7 @@ public class MIVariableManager implements ICommandControl {
|
||||||
* The data request monitor that will hold the children
|
* The data request monitor that will hold the children
|
||||||
* returned
|
* returned
|
||||||
*/
|
*/
|
||||||
private void getChildren(final MIExpressionDMC exprDmc,
|
private void getChildren(final IExpressionDMContext exprDmc,
|
||||||
final int clientNumChildrenLimit, final DataRequestMonitor<ChildrenInfo> rm) {
|
final int clientNumChildrenLimit, final DataRequestMonitor<ChildrenInfo> rm) {
|
||||||
|
|
||||||
if (fetchingChildren) {
|
if (fetchingChildren) {
|
||||||
|
@ -1346,7 +1346,16 @@ public class MIVariableManager implements ICommandControl {
|
||||||
}
|
}
|
||||||
for (int i= 0; i < childrenOfArray.length; i++) {
|
for (int i= 0; i < childrenOfArray.length; i++) {
|
||||||
String fullExpr = exprName + "[" + i + "]";//$NON-NLS-1$//$NON-NLS-2$
|
String fullExpr = exprName + "[" + i + "]";//$NON-NLS-1$//$NON-NLS-2$
|
||||||
String relExpr = ((MIExpressionDMC)exprDmc).getRelativeExpression() + "[" + (castingIndex + i) + "]";//$NON-NLS-1$//$NON-NLS-2$
|
|
||||||
|
String relExpr;
|
||||||
|
if (exprDmc instanceof MIExpressionDMC) {
|
||||||
|
relExpr = ((MIExpressionDMC)exprDmc).getRelativeExpression();
|
||||||
|
} else {
|
||||||
|
// Unexpected, but avoid exception
|
||||||
|
relExpr = exprDmc.getExpression();
|
||||||
|
}
|
||||||
|
relExpr = relExpr + "[" + (castingIndex + i) + "]";//$NON-NLS-1$//$NON-NLS-2$
|
||||||
|
|
||||||
|
|
||||||
childrenOfArray[i] = new ExpressionInfo(fullExpr, relExpr, false, exprInfo, i);
|
childrenOfArray[i] = new ExpressionInfo(fullExpr, relExpr, false, exprInfo, i);
|
||||||
}
|
}
|
||||||
|
@ -1830,7 +1839,7 @@ public class MIVariableManager implements ICommandControl {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
getChildren((MIExpressionDMC)exprDmc, numChildrenLimit,
|
getChildren(exprDmc, numChildrenLimit,
|
||||||
new DataRequestMonitor<ChildrenInfo>(fSession.getExecutor(), rm) {
|
new DataRequestMonitor<ChildrenInfo>(fSession.getExecutor(), rm) {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Add table
Reference in a new issue