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

Bug 302121: Cleanup to make code clearer

This commit is contained in:
Marc Khouzam 2010-11-15 19:13:19 +00:00
parent 6983c5dba7
commit b5c0570748

View file

@ -1555,7 +1555,7 @@ public class MIVariableManager implements ICommandControl {
private void addRealChildrenOfFake(MIVariableObject fakeChild, private void addRealChildrenOfFake(MIVariableObject fakeChild,
IExpressionDMContext frameCtxProvider, IExpressionDMContext frameCtxProvider,
final ExpressionInfo[][] realChildren, final int position, final ExpressionInfo[][] realChildren, final int position,
final CountingRequestMonitor rm) { final RequestMonitor rm) {
MIExpressionDMC fakeExprCtx = createExpressionCtx(frameCtxProvider, MIExpressionDMC fakeExprCtx = createExpressionCtx(frameCtxProvider,
fakeChild.exprInfo); fakeChild.exprInfo);
@ -2019,31 +2019,6 @@ public class MIVariableManager implements ICommandControl {
if (isSuccess()) { if (isSuccess()) {
setOutOfDate(false); setOutOfDate(false);
CountingRequestMonitor countingRm = new CountingRequestMonitor(fSession.getExecutor(), rm) {
@Override
protected void handleCompleted() {
if (!isSuccess()) {
rm.setStatus(getStatus());
}
rm.done();
while (updatesPending.size() > 0) {
DataRequestMonitor<Boolean> pendingRm = updatesPending.poll();
if (isSuccess()) {
pendingRm.setData(false);
} else {
rm.setStatus(getStatus());
}
pendingRm.done();
}
}
};
int rmCount = 0;
MIVarChange[] changes = getData().getMIVarChanges(); MIVarChange[] changes = getData().getMIVarChanges();
if (changes.length > 0 && changes[0].isInScope() == false) { if (changes.length > 0 && changes[0].isInScope() == false) {
// Object is out-of-scope // Object is out-of-scope
@ -2059,21 +2034,42 @@ public class MIVariableManager implements ICommandControl {
lruVariableList.remove(getInternalId()); lruVariableList.remove(getInternalId());
rm.setData(true); rm.setData(true);
rm.done();
while (updatesPending.size() > 0) {
DataRequestMonitor<Boolean> pendingRm = updatesPending.poll();
pendingRm.setData(false);
pendingRm.done();
}
} else { } else {
// The root object is now up-to-date, we must parse the changes, if any. // The root object is now up-to-date, we must parse the changes, if any.
++rmCount; processChanges(changes, new RequestMonitor(fSession.getExecutor(), rm) {
processChanges(changes, new RequestMonitor(fSession.getExecutor(), countingRm)); @Override
protected void handleCompleted() {
// We only mark this root as updated in our list if it is in-scope. // We only mark this root as updated in our list if it is in-scope.
// For out-of-scope object, we don't ever need to re-update them so // For out-of-scope object, we don't ever need to re-update them so
// we don't need to add them to this list. // we don't need to add them to this list.
rootVariableUpdated(MIRootVariableObject.this); rootVariableUpdated(MIRootVariableObject.this);
if (isSuccess()) {
rm.setData(false); rm.setData(false);
} else {
rm.setStatus(getStatus());
} }
rm.done();
countingRm.setDoneCount(rmCount); while (updatesPending.size() > 0) {
DataRequestMonitor<Boolean> pendingRm = updatesPending.poll();
if (isSuccess()) {
pendingRm.setData(false);
} else {
pendingRm.setStatus(getStatus());
}
pendingRm.done();
}
};
});
}
} else { } else {
// We were not able to update for some reason // We were not able to update for some reason
rm.setData(false); rm.setData(false);