mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 10:46:02 +02:00
Bug 302121: Cleanup to make code clearer
This commit is contained in:
parent
6983c5dba7
commit
b5c0570748
1 changed files with 33 additions and 37 deletions
|
@ -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.
|
||||||
|
// 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.
|
||||||
|
rootVariableUpdated(MIRootVariableObject.this);
|
||||||
|
|
||||||
// We only mark this root as updated in our list if it is in-scope.
|
if (isSuccess()) {
|
||||||
// For out-of-scope object, we don't ever need to re-update them so
|
rm.setData(false);
|
||||||
// we don't need to add them to this list.
|
} else {
|
||||||
rootVariableUpdated(MIRootVariableObject.this);
|
rm.setStatus(getStatus());
|
||||||
|
}
|
||||||
|
rm.done();
|
||||||
|
|
||||||
rm.setData(false);
|
while (updatesPending.size() > 0) {
|
||||||
}
|
DataRequestMonitor<Boolean> pendingRm = updatesPending.poll();
|
||||||
|
if (isSuccess()) {
|
||||||
countingRm.setDoneCount(rmCount);
|
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);
|
||||||
|
|
Loading…
Add table
Reference in a new issue