mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
Cosmetics
Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
This commit is contained in:
parent
1a11a46fda
commit
677a49200d
1 changed files with 10 additions and 7 deletions
|
@ -56,31 +56,34 @@ public abstract class DsfDebugViewLayoutCommand implements IDebugCommandHandler{
|
||||||
*/
|
*/
|
||||||
protected IExecutionDMContext[] getDMContexts(IDebugCommandRequest request) {
|
protected IExecutionDMContext[] getDMContexts(IDebugCommandRequest request) {
|
||||||
|
|
||||||
HashSet<IExecutionDMContext> ret = new HashSet<IExecutionDMContext>();
|
HashSet<IExecutionDMContext> ret = new HashSet<>();
|
||||||
String sessionId = null;
|
String sessionId = null;
|
||||||
|
|
||||||
for (Object obj : request.getElements()) {
|
for (Object obj : request.getElements()) {
|
||||||
if (!(obj instanceof IDMVMContext))
|
if (!(obj instanceof IDMVMContext)) {
|
||||||
return EMPTY_ARRAY;
|
return EMPTY_ARRAY;
|
||||||
|
}
|
||||||
|
|
||||||
IDMContext dmContext = ((IDMVMContext)obj).getDMContext();
|
IDMContext dmContext = ((IDMVMContext)obj).getDMContext();
|
||||||
IExecutionDMContext exeContext = DMContexts.getAncestorOfType(dmContext, IExecutionDMContext.class);
|
IExecutionDMContext exeContext = DMContexts.getAncestorOfType(dmContext, IExecutionDMContext.class);
|
||||||
|
|
||||||
if (exeContext == null)
|
if (exeContext == null) {
|
||||||
return EMPTY_ARRAY;
|
return EMPTY_ARRAY;
|
||||||
|
}
|
||||||
|
|
||||||
// make sure all elements are from the same DSF session.
|
// make sure all elements are from the same DSF session.
|
||||||
if (sessionId == null) {
|
if (sessionId == null) {
|
||||||
sessionId = dmContext.getSessionId();
|
sessionId = dmContext.getSessionId();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!sessionId.equals(dmContext.getSessionId()))
|
if (!sessionId.equals(dmContext.getSessionId())) {
|
||||||
return EMPTY_ARRAY;
|
return EMPTY_ARRAY;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ret.add(exeContext);
|
ret.add(exeContext);
|
||||||
}
|
}
|
||||||
return ret.toArray(new IExecutionDMContext[0]);
|
return ret.toArray(new IExecutionDMContext[ret.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -101,7 +104,6 @@ public abstract class DsfDebugViewLayoutCommand implements IDebugCommandHandler{
|
||||||
request.done();
|
request.done();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
request.setEnabled(false);
|
request.setEnabled(false);
|
||||||
request.done();
|
request.done();
|
||||||
|
@ -132,9 +134,10 @@ public abstract class DsfDebugViewLayoutCommand implements IDebugCommandHandler{
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
request.done();
|
request.done();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue