Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2019-08-10 10:36:47 -0400
committerAlexander Kurtakov2019-08-12 07:11:40 -0400
commit1e42e5f0e1e6591b5b609db0b864affc746ed5bf (patch)
treeb640c6d31ef982f1428dcb1077d4ea8fba7fbce4
parent51da3eb3a619c85b31c74d0a1bedacfa94f5db58 (diff)
downloadorg.eclipse.cdt-1e42e5f0e1e6591b5b609db0b864affc746ed5bf.tar.gz
org.eclipse.cdt-1e42e5f0e1e6591b5b609db0b864affc746ed5bf.tar.xz
org.eclipse.cdt-1e42e5f0e1e6591b5b609db0b864affc746ed5bf.zip
Convert new Runnable to lambda.
Change-Id: I8b827013a29802a3f3ae6400ddce8d8753eb6399 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--codan/org.eclipse.cdt.codan.core.tests/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/QuickFixTestCase.java32
-rw-r--r--codan/org.eclipse.cdt.codan.ui.cfgview/src/org/eclipse/cdt/codan/ui/cfgview/views/ControlFlowGraphView.java25
-rw-r--r--codan/org.eclipse.cdt.codan.ui.cxx/META-INF/MANIFEST.MF2
-rw-r--r--codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/internal/ui/cxx/Startup.java19
-rw-r--r--codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FieldEditorOverlayPage.java11
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java105
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java23
-rw-r--r--core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/CygwinPEBinaryObject.java22
-rw-r--r--core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/GNUElfBinaryObject.java24
-rw-r--r--core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/som/parser/SOMBinaryObject.java22
-rw-r--r--core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/xcoff/parser/XCOFFBinaryObject.java22
-rw-r--r--debug/org.eclipse.cdt.debug.application/src/org/eclipse/cdt/debug/application/Application.java9
-rw-r--r--debug/org.eclipse.cdt.debug.application/src/org/eclipse/cdt/debug/application/ApplicationWorkbenchWindowAdvisor.java139
-rw-r--r--debug/org.eclipse.cdt.debug.application/src/org/eclipse/cdt/internal/debug/application/DebugAttachedExecutableHandler.java8
-rw-r--r--debug/org.eclipse.cdt.debug.application/src/org/eclipse/cdt/internal/debug/application/DebugCoreFileHandler.java8
-rw-r--r--debug/org.eclipse.cdt.debug.application/src/org/eclipse/cdt/internal/debug/application/DebugNewExecutableHandler.java8
-rw-r--r--debug/org.eclipse.cdt.debug.application/src/org/eclipse/cdt/internal/debug/application/DebugRemoteExecutableHandler.java8
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugImageDescriptorRegistry.java12
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CValueDetailProvider.java9
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CWatchExpressionDelegate.java21
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/ErrorStatusHandler.java9
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/InfoStatusHandler.java9
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/QuestionStatusHandler.java9
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AbstractListenerActionDelegate.java11
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AbstractViewActionDelegate.java26
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CastToArrayActionHandler.java34
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CastToTypeActionHandler.java16
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/LoadModuleSymbolsActionDelegate.java13
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/MoveToLineActionDelegate.java25
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/MoveToLineAdapter.java13
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/PinDebugContextActionDelegate.java7
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RestoreDefaultTypeActionHandler.java16
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ResumeAtLineActionDelegate.java25
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ResumeAtLineAdapter.java13
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RunToLineAdapter.java18
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ShowFullPathsAction.java17
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/SignalActionDelegate.java14
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/CBreakpointUpdater.java44
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/DialogField.java7
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/ListDialogField.java9
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/dsf/AbstractDisassemblyBackend.java7
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/pinclone/DebugContextPinProvider.java9
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/CDebugPreferencePage.java24
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/propertypages/ModulePropertyPage.java13
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/propertypages/SignalPropertyPage.java31
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/AbstractDebugEventHandler.java13
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/AddMemoryBlocks.java33
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/META-INF/MANIFEST.MF2
-rwxr-xr-xdsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizer.java60
-rwxr-xr-xdsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCanvas.java9
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/GdbPinProvider.java14
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/GdbStatusHandler.java37
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/DsfTerminateCommand.java29
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/GdbDisconnectCommand.java29
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbSaveTraceDataCommand.java7
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/console/GdbFullCliConsolePage.java19
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/console/IGDBDebuggerConsole.java15
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/console/actions/ConsoleSaveAction.java7
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/osview/SessionOSData.java10
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/sync/GdbDebugContextSyncManager.java28
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/tracepoints/TraceControlModel.java29
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/GdbVariableVMNode.java74
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/launch/GdbStackFramesVMNode.java97
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBBackend.java29
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBHardwareAndOS.java127
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses.java50
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java31
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBTraceControl_7_2.java7
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java33
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/EvaluationContextManager.java30
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/ExpressionInformationControlCreator.java21
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/AbstractDsfRegisterGroupActions.java13
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsf.java291
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java214
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/presentation/CSourcePresentationCreator.java16
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/provisional/DisassemblyRulerColumn.java35
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/sourcelookup/DsfSourceDisplayAdapter.java30
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/AbstractLaunchVMProvider.java50
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/variable/VariableVMNode.java40
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/concurrent/DisplayDsfExecutor.java44
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/concurrent/SimpleDisplayExecutor.java7
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/AbstractVMAdapter.java24
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/datamodel/AbstractDMVMAdapter.java20
-rw-r--r--dsf/org.eclipse.cdt.dsf/META-INF/MANIFEST.MF2
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/AbstractCache.java7
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfLaunch.java14
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfMemoryBlock.java16
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfMemoryBlockRetrieval.java13
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/BreakpointsMediator.java7
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPropertyTab.java30
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerTab.java26
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/LaunchShortcut.java22
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/NewContainerTargetWizardPage.java26
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.floatingpoint/META-INF/MANIFEST.MF2
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.floatingpoint/src/org/eclipse/cdt/debug/ui/memory/floatingpoint/FPRendering.java366
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.floatingpoint/src/org/eclipse/cdt/debug/ui/memory/floatingpoint/FPRenderingPreferenceAction.java9
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.floatingpoint/src/org/eclipse/cdt/debug/ui/memory/floatingpoint/Rendering.java318
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.memorybrowser/META-INF/MANIFEST.MF2
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.memorybrowser/src/org/eclipse/cdt/debug/ui/memory/memorybrowser/MemoryBrowser.java185
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.search/src/org/eclipse/cdt/debug/ui/memory/search/FindReplaceDialog.java122
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.search/src/org/eclipse/cdt/debug/ui/memory/search/MemorySearchResultsPage.java7
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.traditional/META-INF/MANIFEST.MF2
-rwxr-xr-xmemory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/Rendering.java110
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/RenderingAddressInfo.java29
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/TraditionalRendering.java457
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/TraditionalRenderingPreferenceAction.java10
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.transport/META-INF/MANIFEST.MF2
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/PlainTextExporter.java7
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/PlainTextImporter.java7
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/RAWBinaryExporter.java7
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/RAWBinaryImporter.java7
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/SRecordImporter.java7
-rw-r--r--toolchains/arduino/org.eclipse.cdt.arduino.ui/src/org/eclipse/cdt/arduino/ui/internal/FormTextHoverManager.java14
113 files changed, 1720 insertions, 2685 deletions
diff --git a/codan/org.eclipse.cdt.codan.core.tests/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/QuickFixTestCase.java b/codan/org.eclipse.cdt.codan.core.tests/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/QuickFixTestCase.java
index 89241ccdcc..4ce1310b5d 100644
--- a/codan/org.eclipse.cdt.codan.core.tests/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/QuickFixTestCase.java
+++ b/codan/org.eclipse.cdt.codan.core.tests/src/org/eclipse/cdt/codan/internal/checkers/ui/quickfix/QuickFixTestCase.java
@@ -88,14 +88,11 @@ public abstract class QuickFixTestCase extends CheckerTestCase {
@Override
public void tearDown() throws Exception {
- Display.getDefault().syncExec(new Runnable() {
- @Override
- public void run() {
- IWorkbenchPage[] pages = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPages();
- for (IWorkbenchPage page : pages) {
- page.closeAllEditors(false);
- dispatch(0);
- }
+ Display.getDefault().syncExec(() -> {
+ IWorkbenchPage[] pages = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPages();
+ for (IWorkbenchPage page : pages) {
+ page.closeAllEditors(false);
+ dispatch(0);
}
});
@@ -141,19 +138,16 @@ public abstract class QuickFixTestCase extends CheckerTestCase {
}
public void doRunQuickFix() {
- Display.getDefault().syncExec(new Runnable() {
- @Override
- public void run() {
- for (int i = 0; i < markers.length; i++) {
- IMarker marker = markers[i];
- isApplicableMap.put(marker, quickFix.isApplicable(marker));
- if (quickFix.isApplicable(marker)) {
- quickFix.run(marker);
- dispatch(0);
- }
+ Display.getDefault().syncExec(() -> {
+ for (int i = 0; i < markers.length; i++) {
+ IMarker marker = markers[i];
+ isApplicableMap.put(marker, quickFix.isApplicable(marker));
+ if (quickFix.isApplicable(marker)) {
+ quickFix.run(marker);
+ dispatch(0);
}
- PlatformUI.getWorkbench().saveAllEditors(false);
}
+ PlatformUI.getWorkbench().saveAllEditors(false);
});
}
diff --git a/codan/org.eclipse.cdt.codan.ui.cfgview/src/org/eclipse/cdt/codan/ui/cfgview/views/ControlFlowGraphView.java b/codan/org.eclipse.cdt.codan.ui.cfgview/src/org/eclipse/cdt/codan/ui/cfgview/views/ControlFlowGraphView.java
index 6bdb7ec120..108e4f0584 100644
--- a/codan/org.eclipse.cdt.codan.ui.cfgview/src/org/eclipse/cdt/codan/ui/cfgview/views/ControlFlowGraphView.java
+++ b/codan/org.eclipse.cdt.codan.ui.cfgview/src/org/eclipse/cdt/codan/ui/cfgview/views/ControlFlowGraphView.java
@@ -50,17 +50,14 @@ import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.SWT;
@@ -256,12 +253,7 @@ public class ControlFlowGraphView extends ViewPart {
private void hookContextMenu() {
MenuManager menuMgr = new MenuManager("#PopupMenu");
menuMgr.setRemoveAllWhenShown(true);
- menuMgr.addMenuListener(new IMenuListener() {
- @Override
- public void menuAboutToShow(IMenuManager manager) {
- ControlFlowGraphView.this.fillContextMenu(manager);
- }
- });
+ menuMgr.addMenuListener(manager -> ControlFlowGraphView.this.fillContextMenu(manager));
Menu menu = menuMgr.createContextMenu(viewer.getControl());
viewer.getControl().setMenu(menu);
getSite().registerContextMenu(menuMgr, viewer);
@@ -334,13 +326,7 @@ public class ControlFlowGraphView extends ViewPart {
}
};
ast.accept(visitor);
- viewer.getControl().getDisplay().asyncExec(new Runnable() {
- @Override
- public void run() {
- // TODO Auto-generated method stub
- viewer.setInput(functions);
- }
- });
+ viewer.getControl().getDisplay().asyncExec(() -> viewer.setInput(functions));
}
/**
@@ -406,11 +392,6 @@ public class ControlFlowGraphView extends ViewPart {
}
private void hookSingleClickAction() {
- viewer.addSelectionChangedListener(new ISelectionChangedListener() {
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- new ASTHighlighterAction(null).run();
- }
- });
+ viewer.addSelectionChangedListener(event -> new ASTHighlighterAction(null).run());
}
}
diff --git a/codan/org.eclipse.cdt.codan.ui.cxx/META-INF/MANIFEST.MF b/codan/org.eclipse.cdt.codan.ui.cxx/META-INF/MANIFEST.MF
index e27c2c661c..213ec4dc69 100644
--- a/codan/org.eclipse.cdt.codan.ui.cxx/META-INF/MANIFEST.MF
+++ b/codan/org.eclipse.cdt.codan.ui.cxx/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.eclipse.cdt.codan.ui.cxx;singleton:=true
-Bundle-Version: 3.5.0.qualifier
+Bundle-Version: 3.5.100.qualifier
Bundle-Activator: org.eclipse.cdt.codan.internal.ui.cxx.Activator
Bundle-Vendor: %Bundle-Vendor
Require-Bundle: org.eclipse.ui,
diff --git a/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/internal/ui/cxx/Startup.java b/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/internal/ui/cxx/Startup.java
index 39e8e90986..ecfa420cbd 100644
--- a/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/internal/ui/cxx/Startup.java
+++ b/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/internal/ui/cxx/Startup.java
@@ -34,18 +34,15 @@ public class Startup implements IStartup {
*/
private void registerListeners() {
final IWorkbench workbench = PlatformUI.getWorkbench();
- workbench.getDisplay().asyncExec(new Runnable() {
- @Override
- public void run() {
- // Install a part listener on currenly open workbench windows.
- for (IWorkbenchWindow window : workbench.getWorkbenchWindows()) {
- CodanPartListener.installOnWindow(window);
- }
-
- // Install a window listener which will be notified of
- // new windows opening, and install a part listener on them.
- workbench.addWindowListener(new CodanWindowListener());
+ workbench.getDisplay().asyncExec(() -> {
+ // Install a part listener on currenly open workbench windows.
+ for (IWorkbenchWindow window : workbench.getWorkbenchWindows()) {
+ CodanPartListener.installOnWindow(window);
}
+
+ // Install a window listener which will be notified of
+ // new windows opening, and install a part listener on them.
+ workbench.addWindowListener(new CodanWindowListener());
});
}
}
diff --git a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FieldEditorOverlayPage.java b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FieldEditorOverlayPage.java
index 393c2c7819..f867ab9f46 100644
--- a/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FieldEditorOverlayPage.java
+++ b/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/FieldEditorOverlayPage.java
@@ -360,13 +360,10 @@ public abstract class FieldEditorOverlayPage extends FieldEditorPreferencePage i
PreferenceManager manager = new PreferenceManager();
manager.addToRoot(targetNode);
final PreferenceDialog dialog = new PreferenceDialog(getControl().getShell(), manager);
- BusyIndicator.showWhile(getControl().getDisplay(), new Runnable() {
- @Override
- public void run() {
- dialog.create();
- dialog.setMessage(targetNode.getLabelText());
- dialog.open();
- }
+ BusyIndicator.showWhile(getControl().getDisplay(), () -> {
+ dialog.create();
+ dialog.setMessage(targetNode.getLabelText());
+ dialog.open();
});
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java
index 30a62ad9f3..0a13c206af 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java
@@ -206,12 +206,7 @@ public class PDOMManager implements IWritableIndexManager, IListener {
addIndexerSetupParticipant(new WaitForRefreshJobs());
fProjectDescriptionListener = new CProjectDescriptionListener(this);
fJobChangeListener = new JobChangeListener(this);
- fPreferenceChangeListener = new IPreferenceChangeListener() {
- @Override
- public void preferenceChange(PreferenceChangeEvent event) {
- onPreferenceChange(event);
- }
- };
+ fPreferenceChangeListener = event -> onPreferenceChange(event);
fSetupJob = new PDOMSetupJob(this);
fIndexerJob = new PDOMIndexerJob(this);
fNotificationJob = createNotifyJob();
@@ -541,9 +536,8 @@ public class PDOMManager implements IWritableIndexManager, IListener {
registerIndexer(cproject, indexer);
createPolicy(cproject).clearTUs();
if (oldIndexer instanceof AbstractPDOMIndexer) {
- if (IndexerPreferences.preferDefaultLanguage(
- ((AbstractPDOMIndexer) oldIndexer).getProperties()) != IndexerPreferences
- .preferDefaultLanguage(props)) {
+ if (IndexerPreferences.preferDefaultLanguage(((AbstractPDOMIndexer) oldIndexer)
+ .getProperties()) != IndexerPreferences.preferDefaultLanguage(props)) {
enqueue(new NotifyCModelManagerTask(cproject.getProject()));
}
}
@@ -1089,25 +1083,22 @@ public class PDOMManager implements IWritableIndexManager, IListener {
if (fStateListeners.isEmpty()) {
return;
}
- Runnable notify = new Runnable() {
- @Override
- public void run() {
- fIndexerStateEvent.setState(state);
- Object[] listeners = fStateListeners.getListeners();
- for (Object listener2 : listeners) {
- final IIndexerStateListener listener = (IIndexerStateListener) listener2;
- SafeRunner.run(new ISafeRunnable() {
- @Override
- public void handleException(Throwable exception) {
- CCorePlugin.log(exception);
- }
+ Runnable notify = () -> {
+ fIndexerStateEvent.setState(state);
+ Object[] listeners = fStateListeners.getListeners();
+ for (Object listener2 : listeners) {
+ final IIndexerStateListener listener = (IIndexerStateListener) listener2;
+ SafeRunner.run(new ISafeRunnable() {
+ @Override
+ public void handleException(Throwable exception) {
+ CCorePlugin.log(exception);
+ }
- @Override
- public void run() throws Exception {
- listener.indexChanged(fIndexerStateEvent);
- }
- });
- }
+ @Override
+ public void run() throws Exception {
+ listener.indexChanged(fIndexerStateEvent);
+ }
+ });
}
};
scheduleNotification(notify);
@@ -1127,25 +1118,22 @@ public class PDOMManager implements IWritableIndexManager, IListener {
if (project != null) {
final ICProject finalProject = project;
- Runnable notify = new Runnable() {
- @Override
- public void run() {
- fIndexChangeEvent.setAffectedProject(finalProject, e);
- Object[] listeners = fChangeListeners.getListeners();
- for (Object listener2 : listeners) {
- final IIndexChangeListener listener = (IIndexChangeListener) listener2;
- SafeRunner.run(new ISafeRunnable() {
- @Override
- public void handleException(Throwable exception) {
- CCorePlugin.log(exception);
- }
+ Runnable notify = () -> {
+ fIndexChangeEvent.setAffectedProject(finalProject, e);
+ Object[] listeners = fChangeListeners.getListeners();
+ for (Object listener2 : listeners) {
+ final IIndexChangeListener listener = (IIndexChangeListener) listener2;
+ SafeRunner.run(new ISafeRunnable() {
+ @Override
+ public void handleException(Throwable exception) {
+ CCorePlugin.log(exception);
+ }
- @Override
- public void run() throws Exception {
- listener.indexChanged(fIndexChangeEvent);
- }
- });
- }
+ @Override
+ public void run() throws Exception {
+ listener.indexChanged(fIndexChangeEvent);
+ }
+ });
}
};
scheduleNotification(notify);
@@ -1528,22 +1516,19 @@ public class PDOMManager implements IWritableIndexManager, IListener {
fPostponedProjects.remove(cproject);
final IndexerSetupParticipant[] participants = fSetupParticipants
.toArray(new IndexerSetupParticipant[fSetupParticipants.size()]);
- Runnable notify = new Runnable() {
- @Override
- public void run() {
- for (final IndexerSetupParticipant p : participants) {
- SafeRunner.run(new ISafeRunnable() {
- @Override
- public void handleException(Throwable exception) {
- CCorePlugin.log(exception);
- }
+ Runnable notify = () -> {
+ for (final IndexerSetupParticipant p : participants) {
+ SafeRunner.run(new ISafeRunnable() {
+ @Override
+ public void handleException(Throwable exception) {
+ CCorePlugin.log(exception);
+ }
- @Override
- public void run() throws Exception {
- p.onIndexerSetup(cproject);
- }
- });
- }
+ @Override
+ public void run() throws Exception {
+ p.onIndexerSetup(cproject);
+ }
+ });
}
};
scheduleNotification(notify);
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java
index af013b73cf..05c2f61d5b 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java
@@ -1008,20 +1008,17 @@ public class CodeFormatterVisitor extends ASTVisitor implements ICPPASTVisitor,
final ListOptions options = createListOptionsForLambdaCapturesParameters(node);
ICPPASTCapture[] captures = node.getCaptures();
formatList(Arrays.asList(captures), options, true, captures.length > 0 && captures[0].isPackExpansion(), null,
- new Runnable() {
- @Override
- public void run() {
- if (options.captureDefault == CaptureDefault.BY_COPY) {
- scribe.printNextToken(Token.tASSIGN, options.fSpaceAfterOpeningParen);
- } else if (options.captureDefault == CaptureDefault.BY_REFERENCE) {
- scribe.printNextToken(Token.tAMPER, options.fSpaceAfterOpeningParen);
- }
+ () -> {
+ if (options.captureDefault == CaptureDefault.BY_COPY) {
+ scribe.printNextToken(Token.tASSIGN, options.fSpaceAfterOpeningParen);
+ } else if (options.captureDefault == CaptureDefault.BY_REFERENCE) {
+ scribe.printNextToken(Token.tAMPER, options.fSpaceAfterOpeningParen);
+ }
- if (options.captureDefault != CaptureDefault.UNSPECIFIED && node.getCaptures().length > 0) {
- scribe.printNextToken(Token.tCOMMA, options.fSpaceBeforeSeparator);
- if (options.fSpaceAfterSeparator)
- scribe.space();
- }
+ if (options.captureDefault != CaptureDefault.UNSPECIFIED && node.getCaptures().length > 0) {
+ scribe.printNextToken(Token.tCOMMA, options.fSpaceBeforeSeparator);
+ if (options.fSpaceAfterSeparator)
+ scribe.space();
}
});
diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/CygwinPEBinaryObject.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/CygwinPEBinaryObject.java
index 33744c957a..d74bed3ffc 100644
--- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/CygwinPEBinaryObject.java
+++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/parser/CygwinPEBinaryObject.java
@@ -70,22 +70,18 @@ public class CygwinPEBinaryObject extends PEBinaryObject {
autoDisposeAddr2line = getAddr2line();
if (autoDisposeAddr2line != null) {
starttime = System.currentTimeMillis();
- Runnable worker = new Runnable() {
+ Runnable worker = () -> {
- @Override
- public void run() {
-
- long diff = System.currentTimeMillis() - starttime;
- while (diff < 10000) {
- try {
- Thread.sleep(10000);
- } catch (InterruptedException e) {
- break;
- }
- diff = System.currentTimeMillis() - starttime;
+ long diff = System.currentTimeMillis() - starttime;
+ while (diff < 10000) {
+ try {
+ Thread.sleep(10000);
+ } catch (InterruptedException e) {
+ break;
}
- stopAddr2Line();
+ diff = System.currentTimeMillis() - starttime;
}
+ stopAddr2Line();
};
new Thread(worker, "Addr2line Reaper").start(); //$NON-NLS-1$
}
diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/GNUElfBinaryObject.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/GNUElfBinaryObject.java
index 2c800320e0..d0c40e2022 100644
--- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/GNUElfBinaryObject.java
+++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/GNUElfBinaryObject.java
@@ -67,22 +67,18 @@ public class GNUElfBinaryObject extends ElfBinaryObject {
autoDisposeAddr2line = getAddr2line();
if (autoDisposeAddr2line != null) {
starttime = System.currentTimeMillis();
- Runnable worker = new Runnable() {
-
- @Override
- public void run() {
-
- long diff = System.currentTimeMillis() - starttime;
- while (diff < 10000) {
- try {
- Thread.sleep(10000);
- } catch (InterruptedException e) {
- break;
- }
- diff = System.currentTimeMillis() - starttime;
+ Runnable worker = () -> {
+
+ long diff = System.currentTimeMillis() - starttime;
+ while (diff < 10000) {
+ try {
+ Thread.sleep(10000);
+ } catch (InterruptedException e) {
+ break;
}
- stopAddr2Line();
+ diff = System.currentTimeMillis() - starttime;
}
+ stopAddr2Line();
};
new Thread(worker, "Addr2line Reaper").start(); //$NON-NLS-1$
}
diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/som/parser/SOMBinaryObject.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/som/parser/SOMBinaryObject.java
index 7f3de84605..f83cfe673d 100644
--- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/som/parser/SOMBinaryObject.java
+++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/som/parser/SOMBinaryObject.java
@@ -235,21 +235,17 @@ public class SOMBinaryObject extends BinaryObjectAdapter {
addr2line = getAddr2line();
if (addr2line != null) {
starttime = System.currentTimeMillis();
- Runnable worker = new Runnable() {
-
- @Override
- public void run() {
- long diff = System.currentTimeMillis() - starttime;
- while (diff < 10000) {
- try {
- Thread.sleep(10000);
- } catch (InterruptedException e) {
- break;
- }
- diff = System.currentTimeMillis() - starttime;
+ Runnable worker = () -> {
+ long diff = System.currentTimeMillis() - starttime;
+ while (diff < 10000) {
+ try {
+ Thread.sleep(10000);
+ } catch (InterruptedException e) {
+ break;
}
- stopAddr2Line();
+ diff = System.currentTimeMillis() - starttime;
}
+ stopAddr2Line();
};
new Thread(worker, "Addr2line Reaper").start(); //$NON-NLS-1$
}
diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/xcoff/parser/XCOFFBinaryObject.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/xcoff/parser/XCOFFBinaryObject.java
index 750c91f1bd..28022da9b0 100644
--- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/xcoff/parser/XCOFFBinaryObject.java
+++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/xcoff/parser/XCOFFBinaryObject.java
@@ -237,21 +237,17 @@ public class XCOFFBinaryObject extends BinaryObjectAdapter {
addr2line = getAddr2line();
if (addr2line != null) {
starttime = System.currentTimeMillis();
- Runnable worker = new Runnable() {
-
- @Override
- public void run() {
- long diff = System.currentTimeMillis() - starttime;
- while (diff < 10000) {
- try {
- Thread.sleep(10000);
- } catch (InterruptedException e) {
- break;
- }
- diff = System.currentTimeMillis() - starttime;
+ Runnable worker = () -> {
+ long diff = System.currentTimeMillis() - starttime;
+ while (diff < 10000) {
+ try {
+ Thread.sleep(10000);
+ } catch (InterruptedException e) {
+ break;
}
- stopAddr2Line();
+ diff = System.currentTimeMillis() - starttime;
}
+ stopAddr2Line();
};
new Thread(worker, "Addr2line Reaper").start(); //$NON-NLS-1$
}
diff --git a/debug/org.eclipse.cdt.debug.application/src/org/eclipse/cdt/debug/application/Application.java b/debug/org.eclipse.cdt.debug.application/src/org/eclipse/cdt/debug/application/Application.java
index 76e2d1a924..fba5d4da41 100644
--- a/debug/org.eclipse.cdt.debug.application/src/org/eclipse/cdt/debug/application/Application.java
+++ b/debug/org.eclipse.cdt.debug.application/src/org/eclipse/cdt/debug/application/Application.java
@@ -109,12 +109,9 @@ public class Application implements IApplication {
final IWorkbench workbench = PlatformUI.getWorkbench();
final Display display = workbench.getDisplay();
fInstanceLoc.release();
- display.syncExec(new Runnable() {
- @Override
- public void run() {
- if (!display.isDisposed())
- workbench.close();
- }
+ display.syncExec(() -> {
+ if (!display.isDisposed())
+ workbench.close();
});
}
}
diff --git a/debug/org.eclipse.cdt.debug.application/src/org/eclipse/cdt/debug/application/ApplicationWorkbenchWindowAdvisor.java b/debug/org.eclipse.cdt.debug.application/src/org/eclipse/cdt/debug/application/ApplicationWorkbenchWindowAdvisor.java
index 21a5cead23..f18fc6d800 100644
--- a/debug/org.eclipse.cdt.debug.application/src/org/eclipse/cdt/debug/application/ApplicationWorkbenchWindowAdvisor.java
+++ b/debug/org.eclipse.cdt.debug.application/src/org/eclipse/cdt/debug/application/ApplicationWorkbenchWindowAdvisor.java
@@ -265,22 +265,18 @@ public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
final String executablePath = executable;
final String coreFilePath = corefile;
- Display.getDefault().syncExec(new Runnable() {
-
- @Override
- public void run() {
-
- CoreFileDialog dialog = new CoreFileDialog(getWindowConfigurer().getWindow().getShell(),
- 0, executablePath, coreFilePath);
- dialog.setBlockOnOpen(true);
- if (dialog.open() == IDialogConstants.OK_ID) {
- CoreFileInfo info2 = dialog.getCoreFileInfo();
- info.setHostPath(info2.getHostPath());
- info.setCoreFilePath(info2.getCoreFilePath());
- } else {
- ErrorDialog.openError(null, Messages.DebuggerInitializingProblem, null, errorStatus,
- IStatus.ERROR | IStatus.WARNING);
- }
+ Display.getDefault().syncExec(() -> {
+
+ CoreFileDialog dialog = new CoreFileDialog(getWindowConfigurer().getWindow().getShell(), 0,
+ executablePath, coreFilePath);
+ dialog.setBlockOnOpen(true);
+ if (dialog.open() == IDialogConstants.OK_ID) {
+ CoreFileInfo info2 = dialog.getCoreFileInfo();
+ info.setHostPath(info2.getHostPath());
+ info.setCoreFilePath(info2.getCoreFilePath());
+ } else {
+ ErrorDialog.openError(null, Messages.DebuggerInitializingProblem, null, errorStatus,
+ IStatus.ERROR | IStatus.WARNING);
}
});
// Check and see if we failed above and if so, quit
@@ -318,22 +314,18 @@ public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
final String buildLogPath = buildLog;
final boolean attach = attachExecutable;
- Display.getDefault().syncExec(new Runnable() {
-
- @Override
- public void run() {
-
- RemoteExecutableDialog dialog = new RemoteExecutableDialog(
- getWindowConfigurer().getWindow().getShell(), executablePath, buildLogPath,
- addressStr, portStr, attach);
- dialog.setBlockOnOpen(true);
- if (dialog.open() == IDialogConstants.OK_ID) {
- info[0] = dialog.getExecutableInfo();
- } else {
- info[0] = null;
- ErrorDialog.openError(null, Messages.DebuggerInitializingProblem, null, errorStatus,
- IStatus.ERROR | IStatus.WARNING);
- }
+ Display.getDefault().syncExec(() -> {
+
+ RemoteExecutableDialog dialog = new RemoteExecutableDialog(
+ getWindowConfigurer().getWindow().getShell(), executablePath, buildLogPath,
+ addressStr, portStr, attach);
+ dialog.setBlockOnOpen(true);
+ if (dialog.open() == IDialogConstants.OK_ID) {
+ info[0] = dialog.getExecutableInfo();
+ } else {
+ info[0] = null;
+ ErrorDialog.openError(null, Messages.DebuggerInitializingProblem, null, errorStatus,
+ IStatus.ERROR | IStatus.WARNING);
}
});
// Check and see if we failed above and if so, quit
@@ -364,23 +356,19 @@ public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
final String executableArgs = arguments;
final String buildLogPath = buildLog;
- Display.getDefault().syncExec(new Runnable() {
-
- @Override
- public void run() {
-
- NewExecutableDialog dialog = new NewExecutableDialog(
- getWindowConfigurer().getWindow().getShell(), 0, executablePath, buildLogPath,
- executableArgs);
- dialog.setBlockOnOpen(true);
- if (dialog.open() == IDialogConstants.OK_ID) {
- NewExecutableInfo info2 = dialog.getExecutableInfo();
- info.setHostPath(info2.getHostPath());
- info.setArguments(info2.getArguments());
- } else {
- ErrorDialog.openError(null, Messages.DebuggerInitializingProblem, null, errorStatus,
- IStatus.ERROR | IStatus.WARNING);
- }
+ Display.getDefault().syncExec(() -> {
+
+ NewExecutableDialog dialog = new NewExecutableDialog(
+ getWindowConfigurer().getWindow().getShell(), 0, executablePath, buildLogPath,
+ executableArgs);
+ dialog.setBlockOnOpen(true);
+ if (dialog.open() == IDialogConstants.OK_ID) {
+ NewExecutableInfo info2 = dialog.getExecutableInfo();
+ info.setHostPath(info2.getHostPath());
+ info.setArguments(info2.getArguments());
+ } else {
+ ErrorDialog.openError(null, Messages.DebuggerInitializingProblem, null, errorStatus,
+ IStatus.ERROR | IStatus.WARNING);
}
});
// Check and see if we failed above and if so, quit
@@ -429,24 +417,20 @@ public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
final String buildLogPath = oldBuildLog;
// Bring up New Executable dialog with values from
// the last launch.
- Display.getDefault().syncExec(new Runnable() {
-
- @Override
- public void run() {
-
- NewExecutableDialog dialog = new NewExecutableDialog(
- getWindowConfigurer().getWindow().getShell(), 0, executablePath, buildLogPath,
- executableArgs);
- dialog.setBlockOnOpen(true);
- if (dialog.open() == IDialogConstants.OK_ID) {
- NewExecutableInfo info2 = dialog.getExecutableInfo();
- info.setHostPath(info2.getHostPath());
- info.setArguments(info2.getArguments());
- info.setBuildLog(info2.getBuildLog());
- } else {
- ErrorDialog.openError(null, Messages.DebuggerInitializingProblem, null, errorStatus,
- IStatus.ERROR | IStatus.WARNING);
- }
+ Display.getDefault().syncExec(() -> {
+
+ NewExecutableDialog dialog = new NewExecutableDialog(
+ getWindowConfigurer().getWindow().getShell(), 0, executablePath, buildLogPath,
+ executableArgs);
+ dialog.setBlockOnOpen(true);
+ if (dialog.open() == IDialogConstants.OK_ID) {
+ NewExecutableInfo info2 = dialog.getExecutableInfo();
+ info.setHostPath(info2.getHostPath());
+ info.setArguments(info2.getArguments());
+ info.setBuildLog(info2.getBuildLog());
+ } else {
+ ErrorDialog.openError(null, Messages.DebuggerInitializingProblem, null, errorStatus,
+ IStatus.ERROR | IStatus.WARNING);
}
});
// Check and see if we failed above and if so, quit
@@ -488,13 +472,7 @@ public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
}
});
monitor.subTask(Messages.LaunchingConfig);
- Display.getDefault().syncExec(new Runnable() {
-
- @Override
- public void run() {
- DebugUITools.launch(config, ILaunchManager.DEBUG_MODE);
- }
- });
+ Display.getDefault().syncExec(() -> DebugUITools.launch(config, ILaunchManager.DEBUG_MODE));
if (LaunchJobs.getLaunchJob() != null) {
try {
LaunchJobs.getLaunchJob().join();
@@ -533,14 +511,11 @@ public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
final MultiStatus status = new MultiStatus(Activator.PLUGIN_ID, 1, Messages.ProblemSavingWorkbench, null);
try {
final ProgressMonitorDialog p = new ProgressMonitorDialog(null);
- IRunnableWithProgress runnable = new IRunnableWithProgress() {
- @Override
- public void run(IProgressMonitor monitor) {
- try {
- status.merge(ResourcesPlugin.getWorkspace().save(true, monitor));
- } catch (CoreException e) {
- status.merge(e.getStatus());
- }
+ IRunnableWithProgress runnable = monitor -> {
+ try {
+ status.merge(ResourcesPlugin.getWorkspace().save(true, monitor));
+ } catch (CoreException e) {
+ status.merge(e.getStatus());
}
};
p.run(true, false, runnable);
diff --git a/debug/org.eclipse.cdt.debug.application/src/org/eclipse/cdt/internal/debug/application/DebugAttachedExecutableHandler.java b/debug/org.eclipse.cdt.debug.application/src/org/eclipse/cdt/internal/debug/application/DebugAttachedExecutableHandler.java
index 9bc9d5eafa..b51b6063df 100644
--- a/debug/org.eclipse.cdt.debug.application/src/org/eclipse/cdt/internal/debug/application/DebugAttachedExecutableHandler.java
+++ b/debug/org.eclipse.cdt.debug.application/src/org/eclipse/cdt/internal/debug/application/DebugAttachedExecutableHandler.java
@@ -34,13 +34,7 @@ public class DebugAttachedExecutableHandler extends AbstractHandler {
final ILaunchConfiguration config = DebugAttachedExecutable.createLaunchConfig(new NullProgressMonitor(),
null);
if (config != null) {
- Display.getDefault().syncExec(new Runnable() {
-
- @Override
- public void run() {
- DebugUITools.launch(config, ILaunchManager.DEBUG_MODE);
- }
- });
+ Display.getDefault().syncExec(() -> DebugUITools.launch(config, ILaunchManager.DEBUG_MODE));
}
} catch (InterruptedException e) {
e.printStackTrace();
diff --git a/debug/org.eclipse.cdt.debug.application/src/org/eclipse/cdt/internal/debug/application/DebugCoreFileHandler.java b/debug/org.eclipse.cdt.debug.application/src/org/eclipse/cdt/internal/debug/application/DebugCoreFileHandler.java
index b383d0e859..440fc6e061 100644
--- a/debug/org.eclipse.cdt.debug.application/src/org/eclipse/cdt/internal/debug/application/DebugCoreFileHandler.java
+++ b/debug/org.eclipse.cdt.debug.application/src/org/eclipse/cdt/internal/debug/application/DebugCoreFileHandler.java
@@ -42,13 +42,7 @@ public class DebugCoreFileHandler extends AbstractHandler {
final ILaunchConfiguration config = DebugCoreFile.createLaunchConfig(new NullProgressMonitor(), null,
info.getHostPath(), info.getCoreFilePath());
if (config != null) {
- Display.getDefault().syncExec(new Runnable() {
-
- @Override
- public void run() {
- DebugUITools.launch(config, ILaunchManager.DEBUG_MODE);
- }
- });
+ Display.getDefault().syncExec(() -> DebugUITools.launch(config, ILaunchManager.DEBUG_MODE));
}
} catch (InterruptedException e) {
e.printStackTrace();
diff --git a/debug/org.eclipse.cdt.debug.application/src/org/eclipse/cdt/internal/debug/application/DebugNewExecutableHandler.java b/debug/org.eclipse.cdt.debug.application/src/org/eclipse/cdt/internal/debug/application/DebugNewExecutableHandler.java
index 919989364b..c05dbdf6d5 100644
--- a/debug/org.eclipse.cdt.debug.application/src/org/eclipse/cdt/internal/debug/application/DebugNewExecutableHandler.java
+++ b/debug/org.eclipse.cdt.debug.application/src/org/eclipse/cdt/internal/debug/application/DebugNewExecutableHandler.java
@@ -68,13 +68,7 @@ public class DebugNewExecutableHandler extends AbstractHandler {
public void done(IJobChangeEvent event) {
}
});
- Display.getDefault().syncExec(new Runnable() {
-
- @Override
- public void run() {
- DebugUITools.launch(config, ILaunchManager.DEBUG_MODE);
- }
- });
+ Display.getDefault().syncExec(() -> DebugUITools.launch(config, ILaunchManager.DEBUG_MODE));
if (LaunchJobs.getLaunchJob() != null) {
try {
LaunchJobs.getLaunchJob().join();
diff --git a/debug/org.eclipse.cdt.debug.application/src/org/eclipse/cdt/internal/debug/application/DebugRemoteExecutableHandler.java b/debug/org.eclipse.cdt.debug.application/src/org/eclipse/cdt/internal/debug/application/DebugRemoteExecutableHandler.java
index 3b403fc4c4..b32a92cc65 100644
--- a/debug/org.eclipse.cdt.debug.application/src/org/eclipse/cdt/internal/debug/application/DebugRemoteExecutableHandler.java
+++ b/debug/org.eclipse.cdt.debug.application/src/org/eclipse/cdt/internal/debug/application/DebugRemoteExecutableHandler.java
@@ -47,13 +47,7 @@ public class DebugRemoteExecutableHandler extends AbstractHandler {
final ILaunchConfiguration config = DebugRemoteExecutable.createLaunchConfig(new NullProgressMonitor(),
buildLog, executable, address, port, attach);
if (config != null) {
- Display.getDefault().syncExec(new Runnable() {
-
- @Override
- public void run() {
- DebugUITools.launch(config, ILaunchManager.DEBUG_MODE);
- }
- });
+ Display.getDefault().syncExec(() -> DebugUITools.launch(config, ILaunchManager.DEBUG_MODE));
}
} catch (InterruptedException e) {
e.printStackTrace();
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugImageDescriptorRegistry.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugImageDescriptorRegistry.java
index 793554198f..db007a4b0c 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugImageDescriptorRegistry.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugImageDescriptorRegistry.java
@@ -80,17 +80,7 @@ public class CDebugImageDescriptorRegistry {
}
private void hookDisplay() {
- fDisplay.asyncExec(new Runnable() {
- @Override
- public void run() {
- getDisplay().disposeExec(new Runnable() {
- @Override
- public void run() {
- dispose();
- }
- });
- }
- });
+ fDisplay.asyncExec(() -> getDisplay().disposeExec(() -> dispose()));
}
protected Display getDisplay() {
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CValueDetailProvider.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CValueDetailProvider.java
index 4a62ec8a96..39597f553a 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CValueDetailProvider.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CValueDetailProvider.java
@@ -38,13 +38,8 @@ public class CValueDetailProvider {
if (value instanceof ICValue) {
final ICStackFrame frame = CDebugUIUtils.getCurrentStackFrame();
if (frame != null) {
- DebugPlugin.getDefault().asyncExec(new Runnable() {
-
- @Override
- public void run() {
- listener.detailComputed(value, ((ICValue) value).evaluateAsExpression(frame));
- }
- });
+ DebugPlugin.getDefault()
+ .asyncExec(() -> listener.detailComputed(value, ((ICValue) value).evaluateAsExpression(frame)));
} else { // no valid stack frame, clear detail pane
listener.detailComputed(value, ""); //$NON-NLS-1$
}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CWatchExpressionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CWatchExpressionDelegate.java
index febe28e85f..b25bb828e5 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CWatchExpressionDelegate.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CWatchExpressionDelegate.java
@@ -35,19 +35,16 @@ public class CWatchExpressionDelegate implements IWatchExpressionDelegate {
return;
}
final ICStackFrame frame = (ICStackFrame) context;
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- IValue value = null;
- DebugException de = null;
- try {
- value = frame.evaluateExpression(expression);
- } catch (DebugException e) {
- de = e;
- }
- IWatchExpressionResult result = evaluationComplete(expression, value, de);
- listener.watchEvaluationFinished(result);
+ Runnable runnable = () -> {
+ IValue value = null;
+ DebugException de = null;
+ try {
+ value = frame.evaluateExpression(expression);
+ } catch (DebugException e) {
+ de = e;
}
+ IWatchExpressionResult result = evaluationComplete(expression, value, de);
+ listener.watchEvaluationFinished(result);
};
DebugPlugin.getDefault().asyncExec(runnable);
}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/ErrorStatusHandler.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/ErrorStatusHandler.java
index d77fa7860d..5aa1280628 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/ErrorStatusHandler.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/ErrorStatusHandler.java
@@ -42,13 +42,8 @@ public class ErrorStatusHandler implements IStatusHandler {
title = CDebugUIMessages.getString("ErrorStatusHandler.1"); //$NON-NLS-1$
}
final String title_f = title;
- CDebugUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
-
- @Override
- public void run() {
- ErrorDialog.openError(CDebugUIPlugin.getActiveWorkbenchShell(), title_f, null, status);
- }
- });
+ CDebugUIPlugin.getStandardDisplay().asyncExec(
+ () -> ErrorDialog.openError(CDebugUIPlugin.getActiveWorkbenchShell(), title_f, null, status));
}
return null;
}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/InfoStatusHandler.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/InfoStatusHandler.java
index 1e9887b9d7..c9d75787a8 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/InfoStatusHandler.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/InfoStatusHandler.java
@@ -33,13 +33,8 @@ public class InfoStatusHandler implements IStatusHandler {
if (status != null && source != null && source instanceof IDebugTarget) {
final String title = ((IDebugTarget) source).getName();
final String message = status.getMessage();
- CDebugUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
-
- @Override
- public void run() {
- MessageDialog.openInformation(CDebugUIPlugin.getActiveWorkbenchShell(), title, message);
- }
- });
+ CDebugUIPlugin.getStandardDisplay().asyncExec(
+ () -> MessageDialog.openInformation(CDebugUIPlugin.getActiveWorkbenchShell(), title, message));
}
return null;
}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/QuestionStatusHandler.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/QuestionStatusHandler.java
index 19d5466ea6..4d6e819f3b 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/QuestionStatusHandler.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/QuestionStatusHandler.java
@@ -34,13 +34,8 @@ public class QuestionStatusHandler implements IStatusHandler {
if (status != null && source != null && source instanceof IDebugTarget) {
final String title = ((IDebugTarget) source).getName();
final String message = status.getMessage();
- CDebugUIPlugin.getStandardDisplay().syncExec(new Runnable() {
-
- @Override
- public void run() {
- result[0] = MessageDialog.openQuestion(CDebugUIPlugin.getActiveWorkbenchShell(), title, message);
- }
- });
+ CDebugUIPlugin.getStandardDisplay().syncExec(() -> result[0] = MessageDialog
+ .openQuestion(CDebugUIPlugin.getActiveWorkbenchShell(), title, message));
}
return Boolean.valueOf(result[0]);
}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AbstractListenerActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AbstractListenerActionDelegate.java
index 9690320c74..674da14452 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AbstractListenerActionDelegate.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AbstractListenerActionDelegate.java
@@ -49,13 +49,10 @@ public abstract class AbstractListenerActionDelegate extends AbstractDebugAction
if (shell == null || shell.isDisposed()) {
return;
}
- Runnable r = new Runnable() {
- @Override
- public void run() {
- for (int i = 0; i < events.length; i++) {
- if (events[i].getSource() != null) {
- doHandleDebugEvent(events[i]);
- }
+ Runnable r = () -> {
+ for (int i = 0; i < events.length; i++) {
+ if (events[i].getSource() != null) {
+ doHandleDebugEvent(events[i]);
}
}
};
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AbstractViewActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AbstractViewActionDelegate.java
index da755d2eb3..ebeae2bdce 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AbstractViewActionDelegate.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AbstractViewActionDelegate.java
@@ -96,15 +96,11 @@ public abstract class AbstractViewActionDelegate extends ActionDelegate
public void run(IAction action) {
final MultiStatus ms = new MultiStatus(CDebugUIPlugin.getUniqueIdentifier(), DebugException.REQUEST_FAILED, "", //$NON-NLS-1$
null);
- BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
-
- @Override
- public void run() {
- try {
- doAction();
- } catch (DebugException e) {
- ms.merge(e.getStatus());
- }
+ BusyIndicator.showWhile(Display.getCurrent(), () -> {
+ try {
+ doAction();
+ } catch (DebugException e) {
+ ms.merge(e.getStatus());
}
});
if (!ms.isOK()) {
@@ -162,14 +158,10 @@ public abstract class AbstractViewActionDelegate extends ActionDelegate
if (shell == null || shell.isDisposed()) {
return;
}
- Runnable r = new Runnable() {
-
- @Override
- public void run() {
- for (int i = 0; i < events.length; i++) {
- if (events[i].getSource() != null) {
- doHandleDebugEvent(events[i]);
- }
+ Runnable r = () -> {
+ for (int i = 0; i < events.length; i++) {
+ if (events[i].getSource() != null) {
+ doHandleDebugEvent(events[i]);
}
}
};
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CastToArrayActionHandler.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CastToArrayActionHandler.java
index 22808ca2eb..f46a176ea8 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CastToArrayActionHandler.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CastToArrayActionHandler.java
@@ -38,8 +38,6 @@ import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
@@ -153,23 +151,11 @@ public class CastToArrayActionHandler extends AbstractHandler {
ActionMessages.getString("CastToArrayActionDelegate.1")); //$NON-NLS-1$
((GridData) label.getLayoutData()).horizontalSpan = 3;
fFirstIndexText = ControlFactory.createTextField(composite);
- fFirstIndexText.addModifyListener(new ModifyListener() {
-
- @Override
- public void modifyText(ModifyEvent e) {
- validateInput();
- }
- });
+ fFirstIndexText.addModifyListener(e -> validateInput());
label = ControlFactory.createLabel(composite, ActionMessages.getString("CastToArrayActionDelegate.2")); //$NON-NLS-1$
((GridData) label.getLayoutData()).horizontalSpan = 3;
fLengthText = ControlFactory.createTextField(composite);
- fLengthText.addModifyListener(new ModifyListener() {
-
- @Override
- public void modifyText(ModifyEvent e) {
- validateInput();
- }
- });
+ fLengthText.addModifyListener(e -> validateInput());
}
protected void validateInput() {
@@ -250,16 +236,12 @@ public class CastToArrayActionHandler extends AbstractHandler {
if (getCastToArray() == null || getCastToArray().length == 0)
return null;
- BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
-
- @Override
- public void run() {
- try {
- doAction(getCastToArray());
- setStatus(null);
- } catch (DebugException e) {
- setStatus(e.getStatus());
- }
+ BusyIndicator.showWhile(Display.getCurrent(), () -> {
+ try {
+ doAction(getCastToArray());
+ setStatus(null);
+ } catch (DebugException e) {
+ setStatus(e.getStatus());
}
});
if (getStatus() != null && !getStatus().isOK()) {
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CastToTypeActionHandler.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CastToTypeActionHandler.java
index 5e2a531e08..a1ba222674 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CastToTypeActionHandler.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/CastToTypeActionHandler.java
@@ -99,16 +99,12 @@ public class CastToTypeActionHandler extends AbstractHandler {
if (getCastToType() == null || getCastToType().length == 0)
return null;
- BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
-
- @Override
- public void run() {
- try {
- doAction(getCastToType());
- setStatus(null);
- } catch (DebugException e) {
- setStatus(e.getStatus());
- }
+ BusyIndicator.showWhile(Display.getCurrent(), () -> {
+ try {
+ doAction(getCastToType());
+ setStatus(null);
+ } catch (DebugException e) {
+ setStatus(e.getStatus());
}
});
if (getStatus() != null && !getStatus().isOK()) {
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/LoadModuleSymbolsActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/LoadModuleSymbolsActionDelegate.java
index 7e261e574e..bf23abc397 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/LoadModuleSymbolsActionDelegate.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/LoadModuleSymbolsActionDelegate.java
@@ -59,14 +59,11 @@ public class LoadModuleSymbolsActionDelegate extends ActionDelegate implements I
final ICModule module = getModule();
if (module != null) {
- DebugPlugin.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- try {
- doAction(module);
- } catch (DebugException e) {
- failed(e);
- }
+ DebugPlugin.getDefault().asyncExec(() -> {
+ try {
+ doAction(module);
+ } catch (DebugException e) {
+ failed(e);
}
});
}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/MoveToLineActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/MoveToLineActionDelegate.java
index ee1f41b656..35dfeeb8c2 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/MoveToLineActionDelegate.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/MoveToLineActionDelegate.java
@@ -119,23 +119,20 @@ public class MoveToLineActionDelegate implements IEditorActionDelegate, IActionD
if (fAction == null) {
return;
}
- Runnable r = new Runnable() {
- @Override
- public void run() {
- boolean enabled = false;
- if (fPartTarget != null && fTargetElement != null) {
- IWorkbenchPartSite site = fActivePart.getSite();
- if (site != null) {
- ISelectionProvider selectionProvider = site.getSelectionProvider();
- if (selectionProvider != null) {
- ISelection selection = selectionProvider.getSelection();
- enabled = fTargetElement.isSuspended()
- && fPartTarget.canMoveToLine(fActivePart, selection, fTargetElement);
- }
+ Runnable r = () -> {
+ boolean enabled = false;
+ if (fPartTarget != null && fTargetElement != null) {
+ IWorkbenchPartSite site = fActivePart.getSite();
+ if (site != null) {
+ ISelectionProvider selectionProvider = site.getSelectionProvider();
+ if (selectionProvider != null) {
+ ISelection selection = selectionProvider.getSelection();
+ enabled = fTargetElement.isSuspended()
+ && fPartTarget.canMoveToLine(fActivePart, selection, fTargetElement);
}
}
- fAction.setEnabled(enabled);
}
+ fAction.setEnabled(enabled);
};
CDebugUIPlugin.getStandardDisplay().asyncExec(r);
}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/MoveToLineAdapter.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/MoveToLineAdapter.java
index bf91273f9a..7d98c30092 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/MoveToLineAdapter.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/MoveToLineAdapter.java
@@ -67,14 +67,11 @@ public class MoveToLineAdapter implements IMoveToLineTarget {
final IPath path = new Path(fileName);
final IMoveToLine moveToLine = ((IAdaptable) target).getAdapter(IMoveToLine.class);
if (moveToLine != null && moveToLine.canMoveToLine(path.toPortableString(), lineNumber)) {
- Runnable r = new Runnable() {
- @Override
- public void run() {
- try {
- moveToLine.moveToLine(path.toPortableString(), lineNumber);
- } catch (DebugException e) {
- failed(e);
- }
+ Runnable r = () -> {
+ try {
+ moveToLine.moveToLine(path.toPortableString(), lineNumber);
+ } catch (DebugException e) {
+ failed(e);
}
};
runInBackground(r);
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/PinDebugContextActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/PinDebugContextActionDelegate.java
index 8aa03763f3..632cbe2c94 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/PinDebugContextActionDelegate.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/PinDebugContextActionDelegate.java
@@ -312,12 +312,7 @@ public class PinDebugContextActionDelegate implements IViewActionDelegate, IActi
if (fAction != null && !fAction.isChecked()) {
final boolean pinnable = PinCloneUtils.isPinnable(fPart, event.getContext());
if (pinnable != fAction.isEnabled()) {
- PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
- @Override
- public void run() {
- fAction.setEnabled(pinnable);
- }
- });
+ PlatformUI.getWorkbench().getDisplay().syncExec(() -> fAction.setEnabled(pinnable));
}
}
}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RestoreDefaultTypeActionHandler.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RestoreDefaultTypeActionHandler.java
index 782d0566a7..8821958d08 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RestoreDefaultTypeActionHandler.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RestoreDefaultTypeActionHandler.java
@@ -55,16 +55,12 @@ public class RestoreDefaultTypeActionHandler extends AbstractHandler {
if (getCastToType() == null || getCastToType().length == 0)
return null;
- BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
-
- @Override
- public void run() {
- try {
- doAction(getCastToType());
- setStatus(null);
- } catch (DebugException e) {
- setStatus(e.getStatus());
- }
+ BusyIndicator.showWhile(Display.getCurrent(), () -> {
+ try {
+ doAction(getCastToType());
+ setStatus(null);
+ } catch (DebugException e) {
+ setStatus(e.getStatus());
}
});
if (getStatus() != null && !getStatus().isOK()) {
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ResumeAtLineActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ResumeAtLineActionDelegate.java
index 53412ea9c2..bc0c405ebe 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ResumeAtLineActionDelegate.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ResumeAtLineActionDelegate.java
@@ -119,23 +119,20 @@ public class ResumeAtLineActionDelegate implements IEditorActionDelegate, IActio
if (fAction == null) {
return;
}
- Runnable r = new Runnable() {
- @Override
- public void run() {
- boolean enabled = false;
- if (fPartTarget != null && fTargetElement != null) {
- IWorkbenchPartSite site = fActivePart.getSite();
- if (site != null) {
- ISelectionProvider selectionProvider = site.getSelectionProvider();
- if (selectionProvider != null) {
- ISelection selection = selectionProvider.getSelection();
- enabled = fTargetElement.isSuspended()
- && fPartTarget.canResumeAtLine(fActivePart, selection, fTargetElement);
- }
+ Runnable r = () -> {
+ boolean enabled = false;
+ if (fPartTarget != null && fTargetElement != null) {
+ IWorkbenchPartSite site = fActivePart.getSite();
+ if (site != null) {
+ ISelectionProvider selectionProvider = site.getSelectionProvider();
+ if (selectionProvider != null) {
+ ISelection selection = selectionProvider.getSelection();
+ enabled = fTargetElement.isSuspended()
+ && fPartTarget.canResumeAtLine(fActivePart, selection, fTargetElement);
}
}
- fAction.setEnabled(enabled);
}
+ fAction.setEnabled(enabled);
};
CDebugUIPlugin.getStandardDisplay().asyncExec(r);
}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ResumeAtLineAdapter.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ResumeAtLineAdapter.java
index 2d3623a72b..0c5eb800a2 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ResumeAtLineAdapter.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ResumeAtLineAdapter.java
@@ -67,14 +67,11 @@ public class ResumeAtLineAdapter implements IResumeAtLineTarget {
if (target instanceof IAdaptable) {
final IResumeAtLine resumeAtLine = ((IAdaptable) target).getAdapter(IResumeAtLine.class);
if (resumeAtLine != null && resumeAtLine.canResumeAtLine(path.toPortableString(), lineNumber)) {
- Runnable r = new Runnable() {
- @Override
- public void run() {
- try {
- resumeAtLine.resumeAtLine(path.toPortableString(), lineNumber);
- } catch (DebugException e) {
- failed(e);
- }
+ Runnable r = () -> {
+ try {
+ resumeAtLine.resumeAtLine(path.toPortableString(), lineNumber);
+ } catch (DebugException e) {
+ failed(e);
}
};
runInBackground(r);
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RunToLineAdapter.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RunToLineAdapter.java
index b7d5e1208d..a9f2484212 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RunToLineAdapter.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/RunToLineAdapter.java
@@ -70,17 +70,13 @@ public class RunToLineAdapter implements IRunToLineTarget {
if (target instanceof IAdaptable) {
final IRunToLine runToLine = ((IAdaptable) target).getAdapter(IRunToLine.class);
if (runToLine != null && runToLine.canRunToLine(path.toPortableString(), lineNumber)) {
- Runnable r = new Runnable() {
-
- @Override
- public void run() {
- try {
- runToLine.runToLine(path.toPortableString(), lineNumber,
- DebugUITools.getPreferenceStore().getBoolean(
- IDebugUIConstants.PREF_SKIP_BREAKPOINTS_DURING_RUN_TO_LINE));
- } catch (DebugException e) {
- failed(e);
- }
+ Runnable r = () -> {
+ try {
+ runToLine.runToLine(path.toPortableString(), lineNumber,
+ DebugUITools.getPreferenceStore().getBoolean(
+ IDebugUIConstants.PREF_SKIP_BREAKPOINTS_DURING_RUN_TO_LINE));
+ } catch (DebugException e) {
+ failed(e);
}
};
runInBackground(r);
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ShowFullPathsAction.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ShowFullPathsAction.java
index 77069c5c06..83361c0129 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ShowFullPathsAction.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ShowFullPathsAction.java
@@ -68,17 +68,14 @@ public class ShowFullPathsAction extends ViewFilterAction {
IDebugModelPresentation pres = view.getPresentation(CDIDebugModel.getPluginIdentifier());
if (pres != null) {
pres.setAttribute(CDebugModelPresentation.DISPLAY_FULL_PATHS, Boolean.valueOf(getValue()));
- BusyIndicator.showWhile(viewer.getControl().getDisplay(), new Runnable() {
- @Override
- public void run() {
- String key = getView().getSite().getId() + "." + getPreferenceKey(); //$NON-NLS-1$
- getPreferenceStore().setValue(key, getValue());
- CDebugUIPlugin.getDefault().savePluginPreferences();
+ BusyIndicator.showWhile(viewer.getControl().getDisplay(), () -> {
+ String key = getView().getSite().getId() + "." + getPreferenceKey(); //$NON-NLS-1$
+ getPreferenceStore().setValue(key, getValue());
+ CDebugUIPlugin.getDefault().savePluginPreferences();
- // Refresh the viewer after we've set the preference because
- // DSF-based debuggers trigger off this preference.
- viewer.refresh();
- }
+ // Refresh the viewer after we've set the preference because
+ // DSF-based debuggers trigger off this preference.
+ viewer.refresh();
});
}
}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/SignalActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/SignalActionDelegate.java
index 40b67bc598..328a339d10 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/SignalActionDelegate.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/SignalActionDelegate.java
@@ -43,15 +43,11 @@ public class SignalActionDelegate extends ActionDelegate implements IObjectActio
if (getSignal() != null) {
final MultiStatus ms = new MultiStatus(CDebugUIPlugin.getUniqueIdentifier(), DebugException.REQUEST_FAILED,
ActionMessages.getString("SignalActionDelegate.0"), null); //$NON-NLS-1$
- BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
-
- @Override
- public void run() {
- try {
- doAction(getSignal());
- } catch (DebugException e) {
- ms.merge(e.getStatus());
- }
+ BusyIndicator.showWhile(Display.getCurrent(), () -> {
+ try {
+ doAction(getSignal());
+ } catch (DebugException e) {
+ ms.merge(e.getStatus());
}
});
if (!ms.isOK()) {
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/CBreakpointUpdater.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/CBreakpointUpdater.java
index 4c00afabbb..80808f83d4 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/CBreakpointUpdater.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/breakpoints/CBreakpointUpdater.java
@@ -50,38 +50,30 @@ public class CBreakpointUpdater implements ICBreakpointListener {
@Override
public void breakpointChanged(IDebugTarget target, final IBreakpoint breakpoint,
@SuppressWarnings("rawtypes") final Map attributes) {
- asyncExec(new Runnable() {
-
- @Override
- public void run() {
- try {
- Boolean enabled = (Boolean) attributes.get(IBreakpoint.ENABLED);
- breakpoint.setEnabled((enabled != null) ? enabled.booleanValue() : false);
- Integer ignoreCount = (Integer) attributes.get(ICBreakpoint.IGNORE_COUNT);
- ((ICBreakpoint) breakpoint).setIgnoreCount((ignoreCount != null) ? ignoreCount.intValue() : 0);
- String condition = (String) attributes.get(ICBreakpoint.CONDITION);
- ((ICBreakpoint) breakpoint).setCondition((condition != null) ? condition : ""); //$NON-NLS-1$
- } catch (CoreException e) {
- CDebugUIPlugin.log(e.getStatus());
- }
+ asyncExec(() -> {
+ try {
+ Boolean enabled = (Boolean) attributes.get(IBreakpoint.ENABLED);
+ breakpoint.setEnabled((enabled != null) ? enabled.booleanValue() : false);
+ Integer ignoreCount = (Integer) attributes.get(ICBreakpoint.IGNORE_COUNT);
+ ((ICBreakpoint) breakpoint).setIgnoreCount((ignoreCount != null) ? ignoreCount.intValue() : 0);
+ String condition = (String) attributes.get(ICBreakpoint.CONDITION);
+ ((ICBreakpoint) breakpoint).setCondition((condition != null) ? condition : ""); //$NON-NLS-1$
+ } catch (CoreException e) {
+ CDebugUIPlugin.log(e.getStatus());
}
});
}
@Override
public void breakpointsRemoved(IDebugTarget target, final IBreakpoint[] breakpoints) {
- asyncExec(new Runnable() {
-
- @Override
- public void run() {
- for (int i = 0; i < breakpoints.length; ++i) {
- try {
- if (((ICBreakpoint) breakpoints[i]).decrementInstallCount() == 0)
- DebugPlugin.getDefault().getBreakpointManager().fireBreakpointChanged(breakpoints[i]);
- } catch (CoreException e) {
- // ensureMarker throws this exception
- // if breakpoint has already been deleted
- }
+ asyncExec(() -> {
+ for (int i = 0; i < breakpoints.length; ++i) {
+ try {
+ if (((ICBreakpoint) breakpoints[i]).decrementInstallCount() == 0)
+ DebugPlugin.getDefault().getBreakpointManager().fireBreakpointChanged(breakpoints[i]);
+ } catch (CoreException e) {
+ // ensureMarker throws this exception
+ // if breakpoint has already been deleted
}
}
});
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/DialogField.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/DialogField.java
index 64e850d533..002bd68e16 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/DialogField.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/DialogField.java
@@ -87,12 +87,7 @@ public class DialogField {
*/
public void postSetFocusOnDialogField(Display display) {
if (display != null) {
- display.asyncExec(new Runnable() {
- @Override
- public void run() {
- setFocus();
- }
- });
+ display.asyncExec(() -> setFocus());
}
}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/ListDialogField.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/ListDialogField.java
index 5c51ebb132..7c82b89a51 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/ListDialogField.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/ListDialogField.java
@@ -617,12 +617,9 @@ public class ListDialogField extends DialogField {
public void postSetSelection(final ISelection selection) {
if (isOkToUse(fTableControl)) {
Display d = fTableControl.getDisplay();
- d.asyncExec(new Runnable() {
- @Override
- public void run() {
- if (isOkToUse(fTableControl)) {
- selectElements(selection);
- }
+ d.asyncExec(() -> {
+ if (isOkToUse(fTableControl)) {
+ selectElements(selection);
}
});
}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/dsf/AbstractDisassemblyBackend.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/dsf/AbstractDisassemblyBackend.java
index 859430ca30..da65561d12 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/dsf/AbstractDisassemblyBackend.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/dsf/AbstractDisassemblyBackend.java
@@ -65,12 +65,7 @@ public abstract class AbstractDisassemblyBackend implements IDisassemblyBackend
* @param status
*/
protected void handleError(final IStatus status) {
- fCallback.asyncExec(new Runnable() {
- @Override
- public void run() {
- ErrorDialog.openError(fCallback.getSite().getShell(), "Error", null, status); //$NON-NLS-1$
- }
- });
+ fCallback.asyncExec(() -> ErrorDialog.openError(fCallback.getSite().getShell(), "Error", null, status)); //$NON-NLS-1$
}
/**
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/pinclone/DebugContextPinProvider.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/pinclone/DebugContextPinProvider.java
index 59a2134954..7c9a7f10ad 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/pinclone/DebugContextPinProvider.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/pinclone/DebugContextPinProvider.java
@@ -142,12 +142,9 @@ public class DebugContextPinProvider extends AbstractDebugContextProvider implem
* @param event debug event
*/
public void delegateEvent(final DebugContextEvent event) {
- Display.getDefault().syncExec(new Runnable() {
- @Override
- public void run() {
- fActiveContext = event.getContext();
- fire(event);
- }
+ Display.getDefault().syncExec(() -> {
+ fActiveContext = event.getContext();
+ fire(event);
});
}
}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/CDebugPreferencePage.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/CDebugPreferencePage.java
index 99efee59fb..957c200692 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/CDebugPreferencePage.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/preferences/CDebugPreferencePage.java
@@ -328,20 +328,16 @@ public class CDebugPreferencePage extends PreferencePage implements IWorkbenchPr
* affects these views.
*/
private void refreshViews() {
- BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
-
- @Override
- public void run() {
- // Refresh interested views
- IWorkbenchWindow[] windows = CDebugUIPlugin.getDefault().getWorkbench().getWorkbenchWindows();
- IWorkbenchPage page = null;
- for (int i = 0; i < windows.length; i++) {
- page = windows[i].getActivePage();
- if (page != null) {
- refreshViews(page, IDebugUIConstants.ID_EXPRESSION_VIEW);
- refreshViews(page, IDebugUIConstants.ID_VARIABLE_VIEW);
- refreshViews(page, IDebugUIConstants.ID_REGISTER_VIEW);
- }
+ BusyIndicator.showWhile(getShell().getDisplay(), () -> {
+ // Refresh interested views
+ IWorkbenchWindow[] windows = CDebugUIPlugin.getDefault().getWorkbench().getWorkbenchWindows();
+ IWorkbenchPage page = null;
+ for (int i = 0; i < windows.length; i++) {
+ page = windows[i].getActivePage();
+ if (page != null) {
+ refreshViews(page, IDebugUIConstants.ID_EXPRESSION_VIEW);
+ refreshViews(page, IDebugUIConstants.ID_VARIABLE_VIEW);
+ refreshViews(page, IDebugUIConstants.ID_REGISTER_VIEW);
}
}
});
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/propertypages/ModulePropertyPage.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/propertypages/ModulePropertyPage.java
index a8d337fa4b..3c3cedeabb 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/propertypages/ModulePropertyPage.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/propertypages/ModulePropertyPage.java
@@ -89,14 +89,11 @@ public class ModulePropertyPage extends PropertyPage {
final ICModule module = getModule();
if (module != null) {
- DebugPlugin.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- try {
- module.setSymbolsFileName(path);
- } catch (DebugException e) {
- failed(PropertyPageMessages.getString("ModulePropertyPage.15"), e); //$NON-NLS-1$
- }
+ DebugPlugin.getDefault().asyncExec(() -> {
+ try {
+ module.setSymbolsFileName(path);
+ } catch (DebugException e) {
+ failed(PropertyPageMessages.getString("ModulePropertyPage.15"), e); //$NON-NLS-1$
}
});
}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/propertypages/SignalPropertyPage.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/propertypages/SignalPropertyPage.java
index 3399623be0..7835a949a6 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/propertypages/SignalPropertyPage.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/propertypages/SignalPropertyPage.java
@@ -114,24 +114,21 @@ public class SignalPropertyPage extends PropertyPage {
public boolean performOk() {
boolean result = super.performOk();
if (result) {
- DebugPlugin.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- if (!getSignal().canModify())
- return;
- if (getPassButton() != null) {
- try {
- getSignal().setPassEnabled(getPassButton().isSelected());
- } catch (DebugException e) {
- failed(PropertyPageMessages.getString("SignalPropertyPage.5"), e); //$NON-NLS-1$
- }
+ DebugPlugin.getDefault().asyncExec(() -> {
+ if (!getSignal().canModify())
+ return;
+ if (getPassButton() != null) {
+ try {
+ getSignal().setPassEnabled(getPassButton().isSelected());
+ } catch (DebugException e1) {
+ failed(PropertyPageMessages.getString("SignalPropertyPage.5"), e1); //$NON-NLS-1$
}
- if (getStopButton() != null) {
- try {
- getSignal().setStopEnabled(getStopButton().isSelected());
- } catch (DebugException e) {
- failed(PropertyPageMessages.getString("SignalPropertyPage.5"), e); //$NON-NLS-1$
- }
+ }
+ if (getStopButton() != null) {
+ try {
+ getSignal().setStopEnabled(getStopButton().isSelected());
+ } catch (DebugException e2) {
+ failed(PropertyPageMessages.getString("SignalPropertyPage.5"), e2); //$NON-NLS-1$
}
}
});
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/AbstractDebugEventHandler.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/AbstractDebugEventHandler.java
index 96c0ac019a..4f25e49ce2 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/AbstractDebugEventHandler.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/AbstractDebugEventHandler.java
@@ -67,15 +67,12 @@ public abstract class AbstractDebugEventHandler implements IDebugEventSetListene
if (!isAvailable()) {
return;
}
- Runnable r = new Runnable() {
- @Override
- public void run() {
- if (isAvailable()) {
- if (isViewVisible()) {
- doHandleDebugEvents(events);
- }
- updateForDebugEvents(events);
+ Runnable r = () -> {
+ if (isAvailable()) {
+ if (isViewVisible()) {
+ doHandleDebugEvents(events);
}
+ updateForDebugEvents(events);
}
};
getView().asyncExec(r);
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/AddMemoryBlocks.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/AddMemoryBlocks.java
index 9c4c56b998..7a9ac604b8 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/AddMemoryBlocks.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/memory/AddMemoryBlocks.java
@@ -123,26 +123,23 @@ public class AddMemoryBlocks implements IAddMemoryBlocksTarget {
msRetrieval.getMemorySpaces(context, new GetMemorySpacesRequest() {
@Override
public void done() {
- runOnUIThread(new Runnable() {
- @Override
- public void run() {
- if (isSuccess()) {
- String[] memorySpaces = getMemorySpaces();
-
- // We shouldn't be using the custom dialog
- // if there are none or only one memory
- // spaces involved.
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=309032#c50
- if (memorySpaces.length >= 2) {
- doAddMemoryBlocks(renderingSite, context, msRetrieval, memorySpaces);
- return;
- }
+ runOnUIThread(() -> {
+ if (isSuccess()) {
+ String[] memorySpaces = getMemorySpaces();
+
+ // We shouldn't be using the custom dialog
+ // if there are none or only one memory
+ // spaces involved.
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=309032#c50
+ if (memorySpaces.length >= 2) {
+ doAddMemoryBlocks(renderingSite, context, msRetrieval, memorySpaces);
+ return;
}
-
- // If we get here, then the custom dialog isn't
- // necessary. Use the standard (platform) one
- invokePlatformAction(renderingSite);
}
+
+ // If we get here, then the custom dialog isn't
+ // necessary. Use the standard (platform) one
+ invokePlatformAction(renderingSite);
});
}
});
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/META-INF/MANIFEST.MF b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/META-INF/MANIFEST.MF
index e0ca4e3fbd..65affe78d0 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/META-INF/MANIFEST.MF
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui;singleton:=true
-Bundle-Version: 1.1.1.qualifier
+Bundle-Version: 1.1.100.qualifier
Bundle-Activator: org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.ui.MulticoreVisualizerUIPlugin
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizer.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizer.java
index 36b309643d..590ada80ba 100755
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizer.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizer.java
@@ -100,8 +100,6 @@ import org.eclipse.debug.internal.ui.commands.actions.StepReturnCommandAction;
import org.eclipse.debug.internal.ui.commands.actions.SuspendCommandAction;
import org.eclipse.debug.internal.ui.commands.actions.TerminateCommandAction;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelChangedListener;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
-import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxy;
import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer;
import org.eclipse.debug.internal.ui.views.launch.LaunchView;
import org.eclipse.debug.ui.DebugUITools;
@@ -833,32 +831,10 @@ public class MulticoreVisualizer extends GraphicCanvasVisualizer implements IPin
if (m_debugViewer == null) {
m_debugViewer = DebugViewUtils.getDebugViewer();
if (m_debugViewer != null) {
- m_modelChangedListener = new IModelChangedListener() {
- @Override
- public void modelChanged(IModelDelta delta, IModelProxy proxy) {
- // Execute a refresh after any pending UI updates.
- GUIUtils.exec(new Runnable() {
- @Override
- public void run() {
- // check if we need to update the debug context
- updateDebugContext();
- }
- });
- }
- };
- m_debugViewSelectionChangedListener = new ISelectionChangedListener() {
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- // Execute a refresh after any pending UI updates.
- GUIUtils.exec(new Runnable() {
- @Override
- public void run() {
- // Update canvas selection to match to dbg view selection
- updateCanvasSelectionFromDebugView();
- }
- });
- }
- };
+ // Execute a refresh after any pending UI updates.
+ m_modelChangedListener = (delta, proxy) -> GUIUtils.exec(() -> updateDebugContext());
+ m_debugViewSelectionChangedListener = event -> GUIUtils
+ .exec(() -> updateCanvasSelectionFromDebugView());
m_debugViewer.addModelChangedListener(m_modelChangedListener);
m_debugViewer.addSelectionChangedListener(m_debugViewSelectionChangedListener);
}
@@ -1128,27 +1104,18 @@ public class MulticoreVisualizer extends GraphicCanvasVisualizer implements IPin
/** Sets canvas model. (Also updates canvas selection.) */
protected void setCanvasModel(VisualizerModel model) {
final VisualizerModel model_f = model;
- GUIUtils.exec(new Runnable() {
- @Override
- public void run() {
- if (m_canvas != null) {
- m_canvas.setModel(model_f);
- // Update the canvas's selection from the current workbench selection.
- updateCanvasSelectionInternal();
- }
+ GUIUtils.exec(() -> {
+ if (m_canvas != null) {
+ m_canvas.setModel(model_f);
+ // Update the canvas's selection from the current workbench selection.
+ updateCanvasSelectionInternal();
}
});
}
/** Updates canvas selection from current workbench selection. */
protected void updateCanvasSelection() {
- GUIUtils.exec(new Runnable() {
- @Override
- public void run() {
- // Update the canvas's selection from the current workbench selection.
- updateCanvasSelectionInternal();
- }
- });
+ GUIUtils.exec(() -> updateCanvasSelectionInternal());
}
/** Updates canvas selection from current workbench selection.
@@ -1481,12 +1448,7 @@ public class MulticoreVisualizer extends GraphicCanvasVisualizer implements IPin
if (session != null) {
DsfExecutor executor = session.getExecutor();
if (executor != null) {
- executor.execute(new Runnable() {
- @Override
- public void run() {
- updateLoads(fDataModel);
- }
- });
+ executor.execute(() -> updateLoads(fDataModel));
}
}
}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCanvas.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCanvas.java
index 1aa787b6b4..6522395653 100755
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCanvas.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui/src/org/eclipse/cdt/dsf/gdb/multicorevisualizer/internal/ui/view/MulticoreVisualizerCanvas.java
@@ -335,12 +335,9 @@ public class MulticoreVisualizerCanvas extends GraphicCanvas implements ISelecti
* multiple update requests on same tick are batched.
*/
public void requestUpdate() {
- GUIUtils.exec(new Runnable() {
- @Override
- public void run() {
- if (m_updateTimer != null) {
- m_updateTimer.start();
- }
+ GUIUtils.exec(() -> {
+ if (m_updateTimer != null) {
+ m_updateTimer.start();
}
});
}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/GdbPinProvider.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/GdbPinProvider.java
index 8b90b03260..e979d05e96 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/GdbPinProvider.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/GdbPinProvider.java
@@ -95,12 +95,7 @@ public class GdbPinProvider implements IPinProvider {
public GdbPinProvider(DsfSession session) {
fSession = session;
- session.getExecutor().execute(new Runnable() {
- @Override
- public void run() {
- fSession.addServiceEventListener(GdbPinProvider.this, null);
- }
- });
+ session.getExecutor().execute(() -> fSession.addServiceEventListener(GdbPinProvider.this, null));
}
/**
@@ -108,12 +103,7 @@ public class GdbPinProvider implements IPinProvider {
*/
public void dispose() {
try {
- fSession.getExecutor().execute(new Runnable() {
- @Override
- public void run() {
- fSession.removeServiceEventListener(GdbPinProvider.this);
- }
- });
+ fSession.getExecutor().execute(() -> fSession.removeServiceEventListener(GdbPinProvider.this));
} catch (RejectedExecutionException e) {
// Session already gone.
}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/GdbStatusHandler.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/GdbStatusHandler.java
index de5cd3c62a..f73d6257e3 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/GdbStatusHandler.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/GdbStatusHandler.java
@@ -30,35 +30,22 @@ public class GdbStatusHandler implements IStatusHandler {
public Object handleStatus(final IStatus status, Object source) throws CoreException {
Runnable runnable = null;
if (status.getSeverity() == IStatus.ERROR) {
- runnable = new Runnable() {
-
- @Override
- public void run() {
- Shell parent = GdbUIPlugin.getActiveWorkbenchShell();
- if (parent != null)
- MessageDialog.openError(parent, Messages.GdbStatusHandler_Error, status.getMessage());
- }
+ runnable = () -> {
+ Shell parent = GdbUIPlugin.getActiveWorkbenchShell();
+ if (parent != null)
+ MessageDialog.openError(parent, Messages.GdbStatusHandler_Error, status.getMessage());
};
} else if (status.getSeverity() == IStatus.WARNING) {
- runnable = new Runnable() {
-
- @Override
- public void run() {
- Shell parent = GdbUIPlugin.getActiveWorkbenchShell();
- if (parent != null)
- MessageDialog.openWarning(parent, Messages.GdbStatusHandler_Warning, status.getMessage());
- }
+ runnable = () -> {
+ Shell parent = GdbUIPlugin.getActiveWorkbenchShell();
+ if (parent != null)
+ MessageDialog.openWarning(parent, Messages.GdbStatusHandler_Warning, status.getMessage());
};
} else if (status.getSeverity() == IStatus.INFO) {
- runnable = new Runnable() {
-
- @Override
- public void run() {
- Shell parent = GdbUIPlugin.getActiveWorkbenchShell();
- if (parent != null)
- MessageDialog.openInformation(parent, Messages.GdbStatusHandler_Information,
- status.getMessage());
- }
+ runnable = () -> {
+ Shell parent = GdbUIPlugin.getActiveWorkbenchShell();
+ if (parent != null)
+ MessageDialog.openInformation(parent, Messages.GdbStatusHandler_Information, status.getMessage());
};
}
if (runnable != null)
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/DsfTerminateCommand.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/DsfTerminateCommand.java
index a5e172ebf4..1125346943 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/DsfTerminateCommand.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/DsfTerminateCommand.java
@@ -212,23 +212,20 @@ public class DsfTerminateCommand implements ITerminateHandler {
// session is also terminated before the timeout).
// We haven't found a problem with delaying the completion
// of the request that way.
- fFutureWrapper.fFuture = fExecutor.schedule(new Runnable() {
- @Override
- public void run() {
- // Check that the session is still active when the timeout hits.
- // If it is not, then everything has been cleaned up already.
- if (DsfSession.isSessionActive(fSession.getId())) {
- DsfSession.removeSessionEndedListener(endedListener);
+ fFutureWrapper.fFuture = fExecutor.schedule(() -> {
+ // Check that the session is still active when the timeout hits.
+ // If it is not, then everything has been cleaned up already.
+ if (DsfSession.isSessionActive(fSession.getId())) {
+ DsfSession.removeSessionEndedListener(endedListener);
- // Marking the request as cancelled will prevent the removal of
- // the launch from the Debug view in case of "Terminate and Remove".
- // This is important for multi-process sessions when "Terminate and Remove"
- // is applied to one of the running processes. In this case the selected
- // process will be terminated but the associated launch will not be removed
- // from the Debug view.
- request.setStatus(Status.CANCEL_STATUS);
- request.done();
- }
+ // Marking the request as cancelled will prevent the removal of
+ // the launch from the Debug view in case of "Terminate and Remove".
+ // This is important for multi-process sessions when "Terminate and Remove"
+ // is applied to one of the running processes. In this case the selected
+ // process will be terminated but the associated launch will not be removed
+ // from the Debug view.
+ request.setStatus(Status.CANCEL_STATUS);
+ request.done();
}
}, 1, TimeUnit.MINUTES);
}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/GdbDisconnectCommand.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/GdbDisconnectCommand.java
index 4532112d11..ac97a37757 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/GdbDisconnectCommand.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/GdbDisconnectCommand.java
@@ -161,23 +161,20 @@ public class GdbDisconnectCommand implements IDisconnectHandler {
// need it anymore, once the session has terminated;
// instead, we let it timeout and ignore it if the session
// is already terminated.
- fExecutor.schedule(new Runnable() {
- @Override
- public void run() {
- // Check that the session is still active when the timeout hits.
- // If it is not, then everything has been cleaned up already.
- if (DsfSession.isSessionActive(fSession.getId())) {
- DsfSession.removeSessionEndedListener(endedListener);
+ fExecutor.schedule(() -> {
+ // Check that the session is still active when the timeout hits.
+ // If it is not, then everything has been cleaned up already.
+ if (DsfSession.isSessionActive(fSession.getId())) {
+ DsfSession.removeSessionEndedListener(endedListener);
- // Marking the request as cancelled will prevent the removal of
- // the launch from the Debug view in case of "Terminate and Remove".
- // This is important for multi-process sessions when "Terminate and Remove"
- // is applied to one of the running processes. In this case the selected
- // process will be terminated but the associated launch will not be removed
- // from the Debug view.
- request.setStatus(Status.CANCEL_STATUS);
- request.done();
- }
+ // Marking the request as cancelled will prevent the removal of
+ // the launch from the Debug view in case of "Terminate and Remove".
+ // This is important for multi-process sessions when "Terminate and Remove"
+ // is applied to one of the running processes. In this case the selected
+ // process will be terminated but the associated launch will not be removed
+ // from the Debug view.
+ request.setStatus(Status.CANCEL_STATUS);
+ request.done();
}
}, 1, TimeUnit.MINUTES);
}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbSaveTraceDataCommand.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbSaveTraceDataCommand.java
index 0eb5c81563..ed908246f2 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbSaveTraceDataCommand.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbSaveTraceDataCommand.java
@@ -71,12 +71,7 @@ public class GdbSaveTraceDataCommand extends AbstractDebugCommand implements ISa
}
final String[] fileName = new String[1];
- PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
- @Override
- public void run() {
- fileName[0] = promptForFileName();
- }
- });
+ PlatformUI.getWorkbench().getDisplay().syncExec(() -> fileName[0] = promptForFileName());
if (fileName[0] != null) {
Query<Object> saveTraceDataQuery = new Query<Object>() {
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/console/GdbFullCliConsolePage.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/console/GdbFullCliConsolePage.java
index c10b7fd3c7..61366a3ef9 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/console/GdbFullCliConsolePage.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/console/GdbFullCliConsolePage.java
@@ -175,17 +175,14 @@ public class GdbFullCliConsolePage extends Page implements IDebugContextListener
// Must use syncExec because the logic within must complete before the rest
// of the class methods (specifically getProcess()) is called
- fMainComposite.getDisplay().syncExec(new Runnable() {
- @Override
- public void run() {
- if (fTerminalControl != null && !fTerminalControl.isDisposed()) {
- fTerminalControl.clearTerminal();
- fTerminalControl.connectTerminal();
-
- // The actual terminal widget initializes its defaults in the line above,
- // lets override them with our application defaults right after.
- setDefaults();
- }
+ fMainComposite.getDisplay().syncExec(() -> {
+ if (fTerminalControl != null && !fTerminalControl.isDisposed()) {
+ fTerminalControl.clearTerminal();
+ fTerminalControl.connectTerminal();
+
+ // The actual terminal widget initializes its defaults in the line above,
+ // lets override them with our application defaults right after.
+ setDefaults();
}
});
}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/console/IGDBDebuggerConsole.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/console/IGDBDebuggerConsole.java
index 7606ec7f4c..6a0ca22899 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/console/IGDBDebuggerConsole.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/console/IGDBDebuggerConsole.java
@@ -42,15 +42,12 @@ public interface IGDBDebuggerConsole extends IDebuggerConsole {
}
}
- session.getExecutor().execute(new Runnable() {
- @Override
- public void run() {
- DsfServicesTracker tracker = new DsfServicesTracker(GdbUIPlugin.getBundleContext(), session.getId());
- IGDBFocusSynchronizer gdbSync = tracker.getService(IGDBFocusSynchronizer.class);
- tracker.dispose();
- if (gdbSync != null) {
- gdbSync.sessionSelected();
- }
+ session.getExecutor().execute(() -> {
+ DsfServicesTracker tracker = new DsfServicesTracker(GdbUIPlugin.getBundleContext(), session.getId());
+ IGDBFocusSynchronizer gdbSync = tracker.getService(IGDBFocusSynchronizer.class);
+ tracker.dispose();
+ if (gdbSync != null) {
+ gdbSync.sessionSelected();
}
});
}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/console/actions/ConsoleSaveAction.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/console/actions/ConsoleSaveAction.java
index 60b5392eea..82857bcf6c 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/console/actions/ConsoleSaveAction.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/console/actions/ConsoleSaveAction.java
@@ -53,12 +53,7 @@ public class ConsoleSaveAction extends Action {
return;
}
- Runnable saveJob = new Runnable() {
- @Override
- public void run() {
- saveContent(fileName);
- }
- };
+ Runnable saveJob = () -> saveContent(fileName);
BusyIndicator.showWhile(Display.getCurrent(), saveJob);
}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/osview/SessionOSData.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/osview/SessionOSData.java
index 7227c39c6a..812e49dedc 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/osview/SessionOSData.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/osview/SessionOSData.java
@@ -241,14 +241,10 @@ public class SessionOSData {
// async/job runnables, like perspective switch runnable using during debug launch,
// causing launch to be stuck at random point.
//
- Display.getDefault().asyncExec(new Runnable() {
+ Display.getDefault().asyncExec(() -> {
- @Override
- public void run() {
-
- if (!c.isDisposed())
- fUIListener.update();
- }
+ if (!c.isDisposed())
+ fUIListener.update();
});
}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/sync/GdbDebugContextSyncManager.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/sync/GdbDebugContextSyncManager.java
index 58beed0fc5..9ca8a51ee6 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/sync/GdbDebugContextSyncManager.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/sync/GdbDebugContextSyncManager.java
@@ -64,23 +64,19 @@ public class GdbDebugContextSyncManager implements IDebugContextListener {
DsfSession session = DsfSession.getSession(eventSessionId);
// order GDB to switch thread
- session.getExecutor().execute(new Runnable() {
- @Override
- public void run() {
- DsfServicesTracker tracker = new DsfServicesTracker(GdbUIPlugin.getBundleContext(),
- eventSessionId);
- IGDBFocusSynchronizer gdbSync = tracker.getService(IGDBFocusSynchronizer.class);
- tracker.dispose();
+ session.getExecutor().execute(() -> {
+ DsfServicesTracker tracker = new DsfServicesTracker(GdbUIPlugin.getBundleContext(), eventSessionId);
+ IGDBFocusSynchronizer gdbSync = tracker.getService(IGDBFocusSynchronizer.class);
+ tracker.dispose();
- if (gdbSync != null) {
- gdbSync.setFocus(new IDMContext[] { dmc }, new ImmediateRequestMonitor() {
- @Override
- protected void handleFailure() {
- // do not set error - it's normal in some cases to fail to switch thread
- // for example in a remote session with the inferior running and in all-stop mode
- }
- });
- }
+ if (gdbSync != null) {
+ gdbSync.setFocus(new IDMContext[] { dmc }, new ImmediateRequestMonitor() {
+ @Override
+ protected void handleFailure() {
+ // do not set error - it's normal in some cases to fail to switch thread
+ // for example in a remote session with the inferior running and in all-stop mode
+ }
+ });
}
});
}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/tracepoints/TraceControlModel.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/tracepoints/TraceControlModel.java
index b6d3b87aee..3d034d61c6 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/tracepoints/TraceControlModel.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/tracepoints/TraceControlModel.java
@@ -72,12 +72,9 @@ public class TraceControlModel {
private volatile ITraceTargetDMContext fTargetContext;
private TraceControlView fTraceControlView;
- private IDebugContextListener fDebugContextListener = new IDebugContextListener() {
- @Override
- public void debugContextChanged(DebugContextEvent event) {
- if ((event.getFlags() & DebugContextEvent.ACTIVATED) != 0) {
- updateDebugContext();
- }
+ private IDebugContextListener fDebugContextListener = event -> {
+ if ((event.getFlags() & DebugContextEvent.ACTIVATED) != 0) {
+ updateDebugContext();
}
};
@@ -461,13 +458,10 @@ public class TraceControlModel {
private void notifyUI(final ITraceStatusDMData2 data) {
final TraceControlView v = fTraceControlView;
if (v != null) {
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- if (v != null) {
- v.fLastRefreshTime = System.currentTimeMillis();
- v.updateUI(data);
- }
+ Display.getDefault().asyncExec(() -> {
+ if (v != null) {
+ v.fLastRefreshTime = System.currentTimeMillis();
+ v.updateUI(data);
}
});
}
@@ -476,12 +470,9 @@ public class TraceControlModel {
private void notifyUI(final String message) {
final TraceControlView v = fTraceControlView;
if (v != null) {
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- if (v != null) {
- v.updateUI(message);
- }
+ Display.getDefault().asyncExec(() -> {
+ if (v != null) {
+ v.updateUI(message);
}
});
}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/GdbVariableVMNode.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/GdbVariableVMNode.java
index 066d63777a..eb3b275088 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/GdbVariableVMNode.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/GdbVariableVMNode.java
@@ -119,28 +119,25 @@ public class GdbVariableVMNode extends VariableVMNode {
final IExpressionDMContext exprDmc = DMContexts.getAncestorOfType(getDMContext(),
IExpressionDMContext.class);
if (exprDmc != null) {
- getSession().getExecutor().execute(new Runnable() {
- @Override
- public void run() {
- final IExpressions expressionService = getServicesTracker().getService(IExpressions.class);
- if (expressionService != null) {
- final DataRequestMonitor<IExpressionDMAddress> drm = new DataRequestMonitor<IExpressionDMAddress>(
- getSession().getExecutor(), null) {
- @Override
- public void handleCompleted() {
- if (isSuccess()) {
- request.setSize(getData().getSize());
- }
- request.setStatus(getStatus());
- request.done();
+ getSession().getExecutor().execute(() -> {
+ final IExpressions expressionService = getServicesTracker().getService(IExpressions.class);
+ if (expressionService != null) {
+ final DataRequestMonitor<IExpressionDMAddress> drm = new DataRequestMonitor<IExpressionDMAddress>(
+ getSession().getExecutor(), null) {
+ @Override
+ public void handleCompleted() {
+ if (isSuccess()) {
+ request.setSize(getData().getSize());
}
- };
+ request.setStatus(getStatus());
+ request.done();
+ }
+ };
- expressionService.getExpressionAddressData(exprDmc, drm);
- } else {
- request.setStatus(internalError());
- request.done();
- }
+ expressionService.getExpressionAddressData(exprDmc, drm);
+ } else {
+ request.setStatus(internalError());
+ request.done();
}
});
} else {
@@ -161,28 +158,25 @@ public class GdbVariableVMNode extends VariableVMNode {
final IExpressionDMContext exprDmc = DMContexts.getAncestorOfType(getDMContext(),
IExpressionDMContext.class);
if (exprDmc != null) {
- getSession().getExecutor().execute(new Runnable() {
- @Override
- public void run() {
- final IExpressions expressionService = getServicesTracker().getService(IExpressions.class);
- if (expressionService != null) {
- final DataRequestMonitor<IExpressionDMAddress> drm = new DataRequestMonitor<IExpressionDMAddress>(
- getSession().getExecutor(), null) {
- @Override
- public void handleCompleted() {
- if (isSuccess()) {
- request.setCanCreate(getData().getSize() > 0);
- }
- request.setStatus(getStatus());
- request.done();
+ getSession().getExecutor().execute(() -> {
+ final IExpressions expressionService = getServicesTracker().getService(IExpressions.class);
+ if (expressionService != null) {
+ final DataRequestMonitor<IExpressionDMAddress> drm = new DataRequestMonitor<IExpressionDMAddress>(
+ getSession().getExecutor(), null) {
+ @Override
+ public void handleCompleted() {
+ if (isSuccess()) {
+ request.setCanCreate(getData().getSize() > 0);
}
- };
+ request.setStatus(getStatus());
+ request.done();
+ }
+ };
- expressionService.getExpressionAddressData(exprDmc, drm);
- } else {
- request.setStatus(internalError());
- request.done();
- }
+ expressionService.getExpressionAddressData(exprDmc, drm);
+ } else {
+ request.setStatus(internalError());
+ request.done();
}
});
} else {
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/launch/GdbStackFramesVMNode.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/launch/GdbStackFramesVMNode.java
index fa3b549f96..eecdb0224b 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/launch/GdbStackFramesVMNode.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/launch/GdbStackFramesVMNode.java
@@ -53,65 +53,60 @@ public class GdbStackFramesVMNode extends StackFramesVMNode {
}
private void buildDeltaForFocusChangedEvent(IGDBFocusChangedEvent event, VMDelta parentDelta, RequestMonitor rm) {
- getSession().getExecutor().execute(new Runnable() {
- @Override
- public void run() {
- IDMContext ctx = event.getDMContext();
+ getSession().getExecutor().execute(() -> {
+ IDMContext ctx = event.getDMContext();
- // Is IGDBFocusChangedEvent pertinent for this VMNode?
- if (ctx instanceof IFrameDMContext) {
- IFrameDMContext newFrameFocus = (IFrameDMContext) ctx;
- IMIExecutionDMContext execDmc = DMContexts.getAncestorOfType(newFrameFocus,
- IMIExecutionDMContext.class);
- if (execDmc == null) {
- rm.done();
- return;
- }
+ // Is IGDBFocusChangedEvent pertinent for this VMNode?
+ if (ctx instanceof IFrameDMContext) {
+ IFrameDMContext newFrameFocus = (IFrameDMContext) ctx;
+ IMIExecutionDMContext execDmc = DMContexts.getAncestorOfType(newFrameFocus,
+ IMIExecutionDMContext.class);
+ if (execDmc == null) {
+ rm.done();
+ return;
+ }
- IRunControl runControl = getServicesTracker().getService(IRunControl.class);
- if (runControl == null) {
- // Required services have not initialized yet. Ignore the event.
- rm.done();
- return;
- }
+ IRunControl runControl = getServicesTracker().getService(IRunControl.class);
+ if (runControl == null) {
+ // Required services have not initialized yet. Ignore the event.
+ rm.done();
+ return;
+ }
- if (runControl.isSuspended(execDmc) || runControl.isStepping(execDmc)) {
- // find the VMC index for the frame that switched, so we can select it correctly.
- getVMCIndexForDmc(GdbStackFramesVMNode.this, newFrameFocus, parentDelta,
- new DataRequestMonitor<Integer>(getExecutor(), rm) {
- @Override
- protected void handleSuccess() {
- // change to frameOffset
- final int frameOffset = getData();
+ if (runControl.isSuspended(execDmc) || runControl.isStepping(execDmc)) {
+ // find the VMC index for the frame that switched, so we can select it correctly.
+ getVMCIndexForDmc(GdbStackFramesVMNode.this, newFrameFocus, parentDelta,
+ new DataRequestMonitor<Integer>(getExecutor(), rm) {
+ @Override
+ protected void handleSuccess() {
+ // change to frameOffset
+ final int frameOffset = getData();
- // Retrieve the list of stack frames
- getVMProvider().updateNode(GdbStackFramesVMNode.this,
- new VMChildrenUpdate(parentDelta,
- getVMProvider().getPresentationContext(), -1, -1,
- new DataRequestMonitor<List<Object>>(getExecutor(), rm) {
- @Override
- public void handleSuccess() {
- final List<Object> data = getData();
- if (data != null && data.size() != 0) {
- // create the delta to select the
- // current stack frame
- parentDelta.addNode(data.get(frameOffset),
- frameOffset,
- IModelDelta.SELECT | IModelDelta.FORCE);
- }
- rm.done();
+ // Retrieve the list of stack frames
+ getVMProvider().updateNode(GdbStackFramesVMNode.this,
+ new VMChildrenUpdate(parentDelta, getVMProvider().getPresentationContext(),
+ -1, -1, new DataRequestMonitor<List<Object>>(getExecutor(), rm) {
+ @Override
+ public void handleSuccess() {
+ final List<Object> data = getData();
+ if (data != null && data.size() != 0) {
+ // create the delta to select the
+ // current stack frame
+ parentDelta.addNode(data.get(frameOffset), frameOffset,
+ IModelDelta.SELECT | IModelDelta.FORCE);
}
- }));
- }
- });
- } else {
- // thread is running - no delta to produce for the stack frame node
- rm.done();
- }
+ rm.done();
+ }
+ }));
+ }
+ });
} else {
- // context not a frame - nothing to do here
+ // thread is running - no delta to produce for the stack frame node
rm.done();
}
+ } else {
+ // context not a frame - nothing to do here
+ rm.done();
}
});
}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBBackend.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBBackend.java
index 9577e2ad27..ad8b76ce30 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBBackend.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBBackend.java
@@ -613,24 +613,21 @@ public class GDBBackend extends AbstractDsfService implements IGDBBackend, IMIBa
};
startGdbJob.schedule();
- fGDBLaunchMonitor.fTimeoutFuture = getExecutor().schedule(new Runnable() {
- @Override
- public void run() {
- // Only process the event if we have not finished yet (hit
- // the breakpoint).
- if (!fGDBLaunchMonitor.fLaunched) {
- fGDBLaunchMonitor.fTimedOut = true;
- Thread jobThread = startGdbJob.getThread();
- if (jobThread != null) {
- jobThread.interrupt();
- }
+ fGDBLaunchMonitor.fTimeoutFuture = getExecutor().schedule(() -> {
+ // Only process the event if we have not finished yet (hit
+ // the breakpoint).
+ if (!fGDBLaunchMonitor.fLaunched) {
+ fGDBLaunchMonitor.fTimedOut = true;
+ Thread jobThread = startGdbJob.getThread();
+ if (jobThread != null) {
+ jobThread.interrupt();
+ }
- destroy();
+ destroy();
- requestMonitor.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID,
- DebugException.TARGET_REQUEST_FAILED, "Timed out trying to launch GDB.", null)); //$NON-NLS-1$
- requestMonitor.done();
- }
+ requestMonitor.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID,
+ DebugException.TARGET_REQUEST_FAILED, "Timed out trying to launch GDB.", null)); //$NON-NLS-1$
+ requestMonitor.done();
}
}, fGDBLaunchTimeout, TimeUnit.SECONDS);
}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBHardwareAndOS.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBHardwareAndOS.java
index 7b7f2c5422..72bc306491 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBHardwareAndOS.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBHardwareAndOS.java
@@ -482,12 +482,7 @@ public class GDBHardwareAndOS extends AbstractDsfService implements IGDBHardware
public <V extends ICommandResult> ICommandToken queueCommand(final ICommand<V> command,
DataRequestMonitor<V> rm) {
- final ICommandToken token = new ICommandToken() {
- @Override
- public ICommand<? extends ICommandResult> getCommand() {
- return command;
- }
- };
+ final ICommandToken token = () -> command;
// The class does not buffer commands itself, but sends them directly to the real
// MICommandControl service. Therefore, we must immediately tell our calling cache that the command
@@ -723,49 +718,44 @@ public class GDBHardwareAndOS extends AbstractDsfService implements IGDBHardware
// delete temp file
new File(localFile).delete();
- getExecutor().schedule(new Runnable() {
- @Override
- public void run() {
- fCommandControl.queueCommand(
- fCommandFactory.createCLIRemoteGet(dmc, statFile, localFile),
- new ImmediateDataRequestMonitor<MIInfo>(rm) {
- @Override
- protected void handleCompleted() {
- if (!isSuccess()) {
- fLoadRequestOngoing = false;
- rm.done(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID,
- INTERNAL_ERROR, "Can't get load info for CPU", null)); //$NON-NLS-1$
- return;
- }
-
- // Success - parse the second set of stat counters and compute loads
- try {
- procStatParser.parseStatFile(localFile);
- } catch (Exception e) {
- rm.done(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID,
- INTERNAL_ERROR, "Can't get load info for CPU", null)); //$NON-NLS-1$
- fLoadRequestOngoing = false;
- return;
- }
- // delete temp file
- new File(localFile).delete();
-
- // Compute load
- fCachedLoads = procStatParser.getCpuLoad();
- processLoads(context, rm, fCachedLoads);
-
- // done with request
- fLoadRequestOngoing = false;
- // process any queued request
- for (Entry<IDMContext, DataRequestMonitor<ILoadInfo>> e : fLoadInfoRequestCache
- .entrySet()) {
- processLoads(e.getKey(), e.getValue(), fCachedLoads);
- }
- fLoadInfoRequestCache.clear();
- }
- });
- }
- }, LOAD_SAMPLE_DELAY, TimeUnit.MILLISECONDS);
+ getExecutor().schedule(() -> fCommandControl.queueCommand(
+ fCommandFactory.createCLIRemoteGet(dmc, statFile, localFile),
+ new ImmediateDataRequestMonitor<MIInfo>(rm) {
+ @Override
+ protected void handleCompleted() {
+ if (!isSuccess()) {
+ fLoadRequestOngoing = false;
+ rm.done(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INTERNAL_ERROR,
+ "Can't get load info for CPU", null)); //$NON-NLS-1$
+ return;
+ }
+
+ // Success - parse the second set of stat counters and compute loads
+ try {
+ procStatParser.parseStatFile(localFile);
+ } catch (Exception e) {
+ rm.done(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INTERNAL_ERROR,
+ "Can't get load info for CPU", null)); //$NON-NLS-1$
+ fLoadRequestOngoing = false;
+ return;
+ }
+ // delete temp file
+ new File(localFile).delete();
+
+ // Compute load
+ fCachedLoads = procStatParser.getCpuLoad();
+ processLoads(context, rm, fCachedLoads);
+
+ // done with request
+ fLoadRequestOngoing = false;
+ // process any queued request
+ for (Entry<IDMContext, DataRequestMonitor<ILoadInfo>> e : fLoadInfoRequestCache
+ .entrySet()) {
+ processLoads(e.getKey(), e.getValue(), fCachedLoads);
+ }
+ fLoadInfoRequestCache.clear();
+ }
+ }), LOAD_SAMPLE_DELAY, TimeUnit.MILLISECONDS);
}
});
// Local debugging? Then we can read /proc/stat directly
@@ -781,29 +771,26 @@ public class GDBHardwareAndOS extends AbstractDsfService implements IGDBHardware
}
// Read /proc/stat file again after a delay
- getExecutor().schedule(new Runnable() {
- @Override
- public void run() {
- try {
- procStatParser.parseStatFile(statFile);
- } catch (Exception e) {
- rm.done(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INTERNAL_ERROR,
- "Can't get load info for CPU", null)); //$NON-NLS-1$
- fLoadRequestOngoing = false;
- return;
- }
- // compute load
- fCachedLoads = procStatParser.getCpuLoad();
- processLoads(context, rm, fCachedLoads);
-
- // done with request
+ getExecutor().schedule(() -> {
+ try {
+ procStatParser.parseStatFile(statFile);
+ } catch (Exception e1) {
+ rm.done(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INTERNAL_ERROR,
+ "Can't get load info for CPU", null)); //$NON-NLS-1$
fLoadRequestOngoing = false;
- // process any queued request
- for (Entry<IDMContext, DataRequestMonitor<ILoadInfo>> e : fLoadInfoRequestCache.entrySet()) {
- processLoads(e.getKey(), e.getValue(), fCachedLoads);
- }
- fLoadInfoRequestCache.clear();
+ return;
+ }
+ // compute load
+ fCachedLoads = procStatParser.getCpuLoad();
+ processLoads(context, rm, fCachedLoads);
+
+ // done with request
+ fLoadRequestOngoing = false;
+ // process any queued request
+ for (Entry<IDMContext, DataRequestMonitor<ILoadInfo>> e2 : fLoadInfoRequestCache.entrySet()) {
+ processLoads(e2.getKey(), e2.getValue(), fCachedLoads);
}
+ fLoadInfoRequestCache.clear();
}, LOAD_SAMPLE_DELAY, TimeUnit.MILLISECONDS);
}
}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses.java
index daf39b69c0..35e4b71bfa 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses.java
@@ -553,36 +553,32 @@ public class GDBProcesses extends MIProcesses implements IGDBProcesses {
// Add the inferior to the launch.
// This cannot be done on the executor or things deadlock.
- DebugPlugin.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- if (restart) {
- // For a restart, remove the old inferior
- IProcess[] launchProcesses = launch.getProcesses();
- for (IProcess p : launchProcesses) {
- // We know there is only one inferior, so just find it.
- if (p instanceof InferiorRuntimeProcess) {
- launch.removeProcess(p);
- break;
- }
+ DebugPlugin.getDefault().asyncExec(() -> {
+ if (restart) {
+ // For a restart, remove the old inferior
+ IProcess[] launchProcesses = launch.getProcesses();
+ for (IProcess p : launchProcesses) {
+ // We know there is only one inferior, so just find it.
+ if (p instanceof InferiorRuntimeProcess) {
+ launch.removeProcess(p);
+ break;
}
}
-
- // Add the inferior
- // Need to go through DebugPlugin.newProcess so that we can use
- // the overrideable process factory to allow others to override.
- // First set attribute to specify we want to create an inferior process.
- // Bug 210366
- Map<String, String> attributes = new HashMap<>();
- attributes.put(IGdbDebugConstants.PROCESS_TYPE_CREATION_ATTR,
- IGdbDebugConstants.INFERIOR_PROCESS_CREATION_VALUE);
- IProcess runtimeInferior = DebugPlugin.newProcess(launch, inferior, label, attributes);
- // Now set the inferior groupId
- runtimeInferior.setAttribute(IGdbDebugConstants.INFERIOR_GROUPID_ATTR,
- MIProcesses.UNIQUE_GROUP_ID);
-
- rm.done();
}
+
+ // Add the inferior
+ // Need to go through DebugPlugin.newProcess so that we can use
+ // the overrideable process factory to allow others to override.
+ // First set attribute to specify we want to create an inferior process.
+ // Bug 210366
+ Map<String, String> attributes = new HashMap<>();
+ attributes.put(IGdbDebugConstants.PROCESS_TYPE_CREATION_ATTR,
+ IGdbDebugConstants.INFERIOR_PROCESS_CREATION_VALUE);
+ IProcess runtimeInferior = DebugPlugin.newProcess(launch, inferior, label, attributes);
+ // Now set the inferior groupId
+ runtimeInferior.setAttribute(IGdbDebugConstants.INFERIOR_GROUPID_ATTR, MIProcesses.UNIQUE_GROUP_ID);
+
+ rm.done();
});
}
});
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java
index db1ad09dfc..a53634e901 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java
@@ -1849,23 +1849,20 @@ public class GDBProcesses_7_0 extends AbstractDsfService implements IGDBProcesse
private void addProcessToLaunch(Process inferior, String groupId, String label) {
// Add the inferior to the launch.
// This cannot be done on the executor or things deadlock.
- DebugPlugin.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- // Add the inferior
- // Need to go through DebugPlugin.newProcess so that we can use
- // the overrideable process factory to allow others to override.
- // First set attribute to specify we want to create an inferior process.
- // Bug 210366
- ILaunch launch = (ILaunch) getSession().getModelAdapter(ILaunch.class);
- Map<String, String> attributes = new HashMap<>();
- attributes.put(IGdbDebugConstants.PROCESS_TYPE_CREATION_ATTR,
- IGdbDebugConstants.INFERIOR_PROCESS_CREATION_VALUE);
- IProcess runtimeInferior = DebugPlugin.newProcess(launch, inferior, label != null ? label : "", //$NON-NLS-1$
- attributes);
- // Now set the inferior groupId
- runtimeInferior.setAttribute(IGdbDebugConstants.INFERIOR_GROUPID_ATTR, groupId);
- }
+ DebugPlugin.getDefault().asyncExec(() -> {
+ // Add the inferior
+ // Need to go through DebugPlugin.newProcess so that we can use
+ // the overrideable process factory to allow others to override.
+ // First set attribute to specify we want to create an inferior process.
+ // Bug 210366
+ ILaunch launch = (ILaunch) getSession().getModelAdapter(ILaunch.class);
+ Map<String, String> attributes = new HashMap<>();
+ attributes.put(IGdbDebugConstants.PROCESS_TYPE_CREATION_ATTR,
+ IGdbDebugConstants.INFERIOR_PROCESS_CREATION_VALUE);
+ IProcess runtimeInferior = DebugPlugin.newProcess(launch, inferior, label != null ? label : "", //$NON-NLS-1$
+ attributes);
+ // Now set the inferior groupId
+ runtimeInferior.setAttribute(IGdbDebugConstants.INFERIOR_GROUPID_ATTR, groupId);
});
}
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBTraceControl_7_2.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBTraceControl_7_2.java
index 55c3642ac9..62a29d655a 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBTraceControl_7_2.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBTraceControl_7_2.java
@@ -804,12 +804,7 @@ public class GDBTraceControl_7_2 extends AbstractDsfService implements IGDBTrace
// the number of frames collected. Having a small interval of
// stale data is currently not a big deal, and not user-visible.
// Bug 353034
- getExecutor().schedule(new Runnable() {
- @Override
- public void run() {
- fTraceStatusCache.reset(context);
- }
- }, 300, TimeUnit.MILLISECONDS);
+ getExecutor().schedule(() -> fTraceStatusCache.reset(context), 300, TimeUnit.MILLISECONDS);
fTraceStatusCache.execute(fCommandFactory.createMITraceStatus(context),
new DataRequestMonitor<MITraceStatusInfo>(getExecutor(), rm) {
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java
index 7ba106e31a..631c9fbfbf 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java
@@ -453,10 +453,8 @@ public class MIBreakpointsManager extends AbstractDsfService
@Override
protected IStatus run(IProgressMonitor monitor) {
// Submit the runnable to plant the breakpoints on dispatch thread.
- getExecutor().submit(new Runnable() {
- @Override
- public void run() {
- installInitialBreakpoints(dmc, new RequestMonitor(ImmediateExecutor.getInstance(), rm) {
+ getExecutor().submit(
+ () -> installInitialBreakpoints(dmc, new RequestMonitor(ImmediateExecutor.getInstance(), rm) {
@Override
protected void handleSuccess() {
// Notify breakpoints tracking listeners that the tracking is started.
@@ -465,9 +463,7 @@ public class MIBreakpointsManager extends AbstractDsfService
}
rm.done();
}
- });
- }
- });
+ }));
return Status.OK_STATUS;
}
@@ -1765,19 +1761,16 @@ public class MIBreakpointsManager extends AbstractDsfService
* @param bps
*/
private void clearBreakpointStatus(final ICBreakpoint[] bps, final IBreakpointsTargetDMContext ctx) {
- IWorkspaceRunnable wr = new IWorkspaceRunnable() {
- @Override
- public void run(IProgressMonitor monitor) throws CoreException {
- // For every platform breakpoint that has at least one target breakpoint installed
- // we must decrement the install count, for every target breakpoint.
- // Note that we cannot simply call resetInstallCount() because another
- // launch may be using the same platform breakpoint.
- Map<ICBreakpoint, Vector<IBreakpointDMContext>> breakpoints = fPlatformToBPsMaps.get(ctx);
- for (ICBreakpoint breakpoint : breakpoints.keySet()) {
- Vector<IBreakpointDMContext> targetBps = breakpoints.get(breakpoint);
- for (IBreakpointDMContext targetBp : targetBps) {
- decrementInstallCount(targetBp, breakpoint, new RequestMonitor(getExecutor(), null));
- }
+ IWorkspaceRunnable wr = monitor -> {
+ // For every platform breakpoint that has at least one target breakpoint installed
+ // we must decrement the install count, for every target breakpoint.
+ // Note that we cannot simply call resetInstallCount() because another
+ // launch may be using the same platform breakpoint.
+ Map<ICBreakpoint, Vector<IBreakpointDMContext>> breakpoints = fPlatformToBPsMaps.get(ctx);
+ for (ICBreakpoint breakpoint : breakpoints.keySet()) {
+ Vector<IBreakpointDMContext> targetBps = breakpoints.get(breakpoint);
+ for (IBreakpointDMContext targetBp : targetBps) {
+ decrementInstallCount(targetBp, breakpoint, new RequestMonitor(getExecutor(), null));
}
}
};
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/EvaluationContextManager.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/EvaluationContextManager.java
index 6b84831d59..7020ccd690 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/EvaluationContextManager.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/EvaluationContextManager.java
@@ -52,24 +52,20 @@ public class EvaluationContextManager implements IWindowListener, IDebugContextL
}
public static void startup() {
- Runnable r = new Runnable() {
-
- @Override
- public void run() {
- if (fgManager == null) {
- // FindBugs reported that it is unsafe to set s_resources
- // before we finish to initialize the object, because of
- // multi-threading. This is why we use a temporary variable.
- EvaluationContextManager manager = new EvaluationContextManager();
- IWorkbench workbench = PlatformUI.getWorkbench();
- IWorkbenchWindow[] windows = workbench.getWorkbenchWindows();
- for (int i = 0; i < windows.length; i++) {
- manager.windowOpened(windows[i]);
- }
- workbench.addWindowListener(manager);
-
- fgManager = manager;
+ Runnable r = () -> {
+ if (fgManager == null) {
+ // FindBugs reported that it is unsafe to set s_resources
+ // before we finish to initialize the object, because of
+ // multi-threading. This is why we use a temporary variable.
+ EvaluationContextManager manager = new EvaluationContextManager();
+ IWorkbench workbench = PlatformUI.getWorkbench();
+ IWorkbenchWindow[] windows = workbench.getWorkbenchWindows();
+ for (int i = 0; i < windows.length; i++) {
+ manager.windowOpened(windows[i]);
}
+ workbench.addWindowListener(manager);
+
+ fgManager = manager;
}
};
Display display = Display.getCurrent();
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/ExpressionInformationControlCreator.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/ExpressionInformationControlCreator.java
index 76477e9124..bed7e8d6ce 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/ExpressionInformationControlCreator.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/ExpressionInformationControlCreator.java
@@ -400,18 +400,15 @@ public class ExpressionInformationControlCreator implements IInformationControlC
fViewerUpdateListener = new IViewerUpdateListener() {
@Override
public void viewerUpdatesComplete() {
- fViewer.getDisplay().timerExec(100, new Runnable() {
- @Override
- public void run() {
- if (!fViewer.getTree().isDisposed()) {
- TreeSelection selection = (TreeSelection) fViewer.getSelection();
- if (selection.isEmpty()) {
- selection = new TreeSelection(fViewer.getTopElementPath());
- }
- fViewer.setSelection(selection);
- if (fDetailPane != null) {
- fDetailPane.display(selection);
- }
+ fViewer.getDisplay().timerExec(100, () -> {
+ if (!fViewer.getTree().isDisposed()) {
+ TreeSelection selection = (TreeSelection) fViewer.getSelection();
+ if (selection.isEmpty()) {
+ selection = new TreeSelection(fViewer.getTopElementPath());
+ }
+ fViewer.setSelection(selection);
+ if (fDetailPane != null) {
+ fDetailPane.display(selection);
}
}
});
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/AbstractDsfRegisterGroupActions.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/AbstractDsfRegisterGroupActions.java
index ed1db18251..7ed3bb2230 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/AbstractDsfRegisterGroupActions.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/actions/AbstractDsfRegisterGroupActions.java
@@ -963,14 +963,11 @@ public abstract class AbstractDsfRegisterGroupActions extends AbstractHandler {
private void notifyUser(final String message) {
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- Shell parent = DsfUIPlugin.getActiveWorkbenchShell();
- if (parent != null) {
- MessageDialog.openInformation(parent, Messages.Information,
- Messages.RegisterGroupInfo + ": " + message); //$NON-NLS-1$
- }
+ Runnable runnable = () -> {
+ Shell parent = DsfUIPlugin.getActiveWorkbenchShell();
+ if (parent != null) {
+ MessageDialog.openInformation(parent, Messages.Information,
+ Messages.RegisterGroupInfo + ": " + message); //$NON-NLS-1$
}
};
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsf.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsf.java
index 7285b32e2a..c01adeaefe 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsf.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsf.java
@@ -353,12 +353,7 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
if (canDisassemble()) {
final BigInteger address = getLastKnownAddress();
if (address != null && !UNKNOWN_ADDRESS.equals(address)) {
- fCallback.asyncExec(new Runnable() {
- @Override
- public void run() {
- fCallback.updatePC(address);
- }
- });
+ fCallback.asyncExec(() -> fCallback.updatePC(address));
}
}
}
@@ -387,17 +382,14 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
if (DEBUG)
System.out
.println("retrieveFrameAddress done " + DisassemblyUtils.getAddressText(addressValue)); //$NON-NLS-1$
- fCallback.asyncExec(new Runnable() {
- @Override
- public void run() {
- if (address.getSize() * 8 != fCallback.getAddressSize()) {
- fCallback.addressSizeChanged(address.getSize() * 8);
- }
- if (frame == 0) {
- fCallback.updatePC(addressValue);
- } else {
- fCallback.gotoFrame(frame, addressValue);
- }
+ fCallback.asyncExec(() -> {
+ if (address.getSize() * 8 != fCallback.getAddressSize()) {
+ fCallback.addressSizeChanged(address.getSize() * 8);
+ }
+ if (frame == 0) {
+ fCallback.updatePC(addressValue);
+ } else {
+ fCallback.gotoFrame(frame, addressValue);
}
});
} else {
@@ -474,12 +466,7 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
}
final IExecutionDMContext context = event.getDMContext();
if (context.equals(fTargetContext) || DMContexts.isAncestorOf(fTargetContext, context)) {
- fCallback.asyncExec(new Runnable() {
- @Override
- public void run() {
- fCallback.handleTargetEnded();
- }
- });
+ fCallback.asyncExec(() -> fCallback.handleTargetEnded());
}
}
@@ -571,152 +558,98 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
final IDisassemblyDMContext context = DMContexts.getAncestorOfType(fTargetContext, IDisassemblyDMContext.class);
// align the start address first (bug 328168)
- executor.execute(new Runnable() {
- @Override
- public void run() {
- alignOpCodeAddress(startAddress, new DataRequestMonitor<BigInteger>(executor, null) {
+ executor.execute(() -> alignOpCodeAddress(startAddress, new DataRequestMonitor<BigInteger>(executor, null) {
- @Override
- public void handleCompleted() {
- final BigInteger finalStartAddress = getData();
- if (mixed) {
- final DataRequestMonitor<IMixedInstruction[]> disassemblyRequest = new DataRequestMonitor<IMixedInstruction[]>(
- executor, null) {
- @Override
- public void handleCompleted() {
- final IMixedInstruction[] data = getData();
- if (!isCanceled() && data != null) {
- fCallback.asyncExec(new Runnable() {
- @Override
- public void run() {
- if (!insertDisassembly(finalStartAddress, finalEndAddress, data,
- showSymbols, showDisassembly)) {
- // retry in non-mixed mode
- fCallback.retrieveDisassembly(finalStartAddress, finalEndAddress,
- linesHint, false, true);
- }
- }
- });
- } else {
- final IStatus status = getStatus();
- if (status != null && !status.isOK()) {
- if (file != null) {
- fCallback.asyncExec(new Runnable() {
- @Override
- public void run() {
- fCallback.retrieveDisassembly(finalStartAddress,
- finalEndAddress, linesHint, true, true);
- }
- });
- } else {
- fCallback.asyncExec(new Runnable() {
- @Override
- public void run() {
- fCallback.doScrollLocked(new Runnable() {
- @Override
- public void run() {
- fCallback.insertError(finalStartAddress,
- status.getMessage());
- }
- });
- }
- });
- }
- }
- fCallback.setUpdatePending(false);
- }
- }
- };
- if (file != null) {
- executor.execute(new Runnable() {
- @Override
- public void run() {
- final IDisassembly disassembly = fServicesTracker
- .getService(IDisassembly.class);
- if (disassembly == null) {
- disassemblyRequest.cancel();
- disassemblyRequest.done();
- return;
- }
- disassembly.getMixedInstructions(context, file, lineNumber, lines * 2,
- disassemblyRequest);
+ @Override
+ public void handleCompleted() {
+ final BigInteger finalStartAddress = getData();
+ if (mixed) {
+ final DataRequestMonitor<IMixedInstruction[]> disassemblyRequest = new DataRequestMonitor<IMixedInstruction[]>(
+ executor, null) {
+ @Override
+ public void handleCompleted() {
+ final IMixedInstruction[] data = getData();
+ if (!isCanceled() && data != null) {
+ fCallback.asyncExec(() -> {
+ if (!insertDisassembly(finalStartAddress, finalEndAddress, data, showSymbols,
+ showDisassembly)) {
+ // retry in non-mixed mode
+ fCallback.retrieveDisassembly(finalStartAddress, finalEndAddress, linesHint,
+ false, true);
}
});
} else {
- executor.execute(new Runnable() {
- @Override
- public void run() {
- final IDisassembly disassembly = fServicesTracker
- .getService(IDisassembly.class);
- if (disassembly == null) {
- disassemblyRequest.cancel();
- disassemblyRequest.done();
- return;
- }
- disassembly.getMixedInstructions(context, finalStartAddress, finalEndAddress,
- disassemblyRequest);
- }
- });
- }
- } else {
- final DataRequestMonitor<IInstruction[]> disassemblyRequest = new DataRequestMonitor<IInstruction[]>(
- executor, null) {
- @Override
- public void handleCompleted() {
- if (!isCanceled() && getData() != null) {
- fCallback.asyncExec(new Runnable() {
- @Override
- public void run() {
- if (!insertDisassembly(finalStartAddress, finalEndAddress, getData(),
- showSymbols, showDisassembly)) {
- fCallback.doScrollLocked(new Runnable() {
- @Override
- public void run() {
- fCallback.insertError(finalStartAddress,
- DisassemblyMessages.DisassemblyBackendDsf_error_UnableToRetrieveData);
- }
- });
- }
- }
- });
+ final IStatus status = getStatus();
+ if (status != null && !status.isOK()) {
+ if (file != null) {
+ fCallback.asyncExec(() -> fCallback.retrieveDisassembly(finalStartAddress,
+ finalEndAddress, linesHint, true, true));
} else {
- final IStatus status = getStatus();
- if (status != null && !status.isOK()) {
- fCallback.asyncExec(new Runnable() {
- @Override
- public void run() {
- fCallback.doScrollLocked(new Runnable() {
- @Override
- public void run() {
- fCallback.insertError(finalStartAddress,
- status.getMessage());
- }
- });
- }
- });
- }
- fCallback.setUpdatePending(false);
+ fCallback.asyncExec(() -> fCallback.doScrollLocked(
+ () -> fCallback.insertError(finalStartAddress, status.getMessage())));
}
}
- };
- executor.execute(new Runnable() {
- @Override
- public void run() {
- final IDisassembly disassembly = fServicesTracker.getService(IDisassembly.class);
- if (disassembly == null) {
- disassemblyRequest.cancel();
- disassemblyRequest.done();
- return;
+ fCallback.setUpdatePending(false);
+ }
+ }
+ };
+ if (file != null) {
+ executor.execute(() -> {
+ final IDisassembly disassembly = fServicesTracker.getService(IDisassembly.class);
+ if (disassembly == null) {
+ disassemblyRequest.cancel();
+ disassemblyRequest.done();
+ return;
+ }
+ disassembly.getMixedInstructions(context, file, lineNumber, lines * 2, disassemblyRequest);
+ });
+ } else {
+ executor.execute(() -> {
+ final IDisassembly disassembly = fServicesTracker.getService(IDisassembly.class);
+ if (disassembly == null) {
+ disassemblyRequest.cancel();
+ disassemblyRequest.done();
+ return;
+ }
+ disassembly.getMixedInstructions(context, finalStartAddress, finalEndAddress,
+ disassemblyRequest);
+ });
+ }
+ } else {
+ final DataRequestMonitor<IInstruction[]> disassemblyRequest = new DataRequestMonitor<IInstruction[]>(
+ executor, null) {
+ @Override
+ public void handleCompleted() {
+ if (!isCanceled() && getData() != null) {
+ fCallback.asyncExec(() -> {
+ if (!insertDisassembly(finalStartAddress, finalEndAddress, getData(), showSymbols,
+ showDisassembly)) {
+ fCallback.doScrollLocked(() -> fCallback.insertError(finalStartAddress,
+ DisassemblyMessages.DisassemblyBackendDsf_error_UnableToRetrieveData));
}
- disassembly.getInstructions(context, finalStartAddress, finalEndAddress,
- disassemblyRequest);
+ });
+ } else {
+ final IStatus status = getStatus();
+ if (status != null && !status.isOK()) {
+ fCallback.asyncExec(() -> fCallback.doScrollLocked(
+ () -> fCallback.insertError(finalStartAddress, status.getMessage())));
}
- });
+ fCallback.setUpdatePending(false);
+ }
}
- }
- });
+ };
+ executor.execute(() -> {
+ final IDisassembly disassembly = fServicesTracker.getService(IDisassembly.class);
+ if (disassembly == null) {
+ disassemblyRequest.cancel();
+ disassemblyRequest.done();
+ return;
+ }
+ disassembly.getInstructions(context, finalStartAddress, finalEndAddress, disassemblyRequest);
+ });
+ }
}
- });
+ }));
}
private boolean insertDisassembly(BigInteger startAddress, BigInteger endAddress, IInstruction[] instructions,
@@ -1039,12 +972,7 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
protected void handleSuccess() {
final BigInteger address = getData();
if (address != null) {
- fCallback.asyncExec(new Runnable() {
- @Override
- public void run() {
- fCallback.gotoAddress(address);
- }
- });
+ fCallback.asyncExec(() -> fCallback.gotoAddress(address));
}
}
});
@@ -1090,12 +1018,7 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
final IAddress address = data.getAddress();
if (address != null && address != IExpressionDMLocation.INVALID_ADDRESS) {
final BigInteger addressValue = address.getValue();
- fCallback.asyncExec(new Runnable() {
- @Override
- public void run() {
- fCallback.gotoAddress(addressValue);
- }
- });
+ fCallback.asyncExec(() -> fCallback.gotoAddress(addressValue));
rm.setData(addressValue);
rm.done();
} else {
@@ -1191,13 +1114,10 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
public void handleCompleted() {
final IMixedInstruction[] data = getData();
if (!isCanceled() && data != null) {
- fCallback.asyncExec(new Runnable() {
- @Override
- public void run() {
- if (!insertDisassembly(null, endAddress, data, showSymbols, showDisassembly)) {
- // retry in non-mixed mode
- retrieveDisassembly(file, lines, endAddress, false, showSymbols, showDisassembly);
- }
+ fCallback.asyncExec(() -> {
+ if (!insertDisassembly(null, endAddress, data, showSymbols, showDisassembly)) {
+ // retry in non-mixed mode
+ retrieveDisassembly(file, lines, endAddress, false, showSymbols, showDisassembly);
}
});
} else {
@@ -1211,17 +1131,14 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
};
assert !fCallback.getUpdatePending();
fCallback.setUpdatePending(true);
- executor.execute(new Runnable() {
- @Override
- public void run() {
- final IDisassembly disassembly = fServicesTracker.getService(IDisassembly.class);
- if (disassembly == null) {
- disassemblyRequest.cancel();
- disassemblyRequest.done();
- return;
- }
- disassembly.getMixedInstructions(context, finalFile, 1, lines, disassemblyRequest);
+ executor.execute(() -> {
+ final IDisassembly disassembly = fServicesTracker.getService(IDisassembly.class);
+ if (disassembly == null) {
+ disassemblyRequest.cancel();
+ disassemblyRequest.done();
+ return;
}
+ disassembly.getMixedInstructions(context, finalFile, 1, lines, disassemblyRequest);
});
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java
index d23e0576b5..fd8393f60f 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java
@@ -136,12 +136,9 @@ import org.eclipse.jface.text.source.SourceViewerConfiguration;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.util.SafeRunnable;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyleRange;
import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.custom.VerifyKeyListener;
import org.eclipse.swt.dnd.DND;
import org.eclipse.swt.dnd.DragSource;
import org.eclipse.swt.dnd.DropTarget;
@@ -150,7 +147,6 @@ import org.eclipse.swt.dnd.TextTransfer;
import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.VerifyEvent;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontData;
@@ -580,12 +576,7 @@ public abstract class DisassemblyPart extends WorkbenchPart
} else if (Control.class.equals(required)) {
return fViewer != null ? (T) fViewer.getTextWidget() : null;
} else if (IGotoMarker.class.equals(required)) {
- return (T) new IGotoMarker() {
- @Override
- public void gotoMarker(IMarker marker) {
- DisassemblyPart.this.gotoMarker(marker);
- }
- };
+ return (T) (IGotoMarker) marker -> DisassemblyPart.this.gotoMarker(marker);
} else if (IColumnSupport.class.equals(required)) {
if (fColumnSupport == null)
fColumnSupport = createColumnSupport();
@@ -780,25 +771,17 @@ public abstract class DisassemblyPart extends WorkbenchPart
hookContextMenu();
contributeToActionBars();
- fViewer.getTextWidget().addVerifyKeyListener(new VerifyKeyListener() {
- @Override
- public void verifyKey(VerifyEvent event) {
- switch (event.keyCode) {
- case SWT.PAGE_UP:
- case SWT.PAGE_DOWN:
- case SWT.ARROW_UP:
- case SWT.ARROW_DOWN:
- event.doit = !keyScroll(event.keyCode);
- }
+ fViewer.getTextWidget().addVerifyKeyListener(event -> {
+ switch (event.keyCode) {
+ case SWT.PAGE_UP:
+ case SWT.PAGE_DOWN:
+ case SWT.ARROW_UP:
+ case SWT.ARROW_DOWN:
+ event.doit = !keyScroll(event.keyCode);
}
});
- fViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- updateSelectionDependentActions();
- }
- });
+ fViewer.addSelectionChangedListener(event -> updateSelectionDependentActions());
fErrorColor = EditorsUI.getSharedTextColors().getColor(
PreferenceConverter.getColor(getPreferenceStore(), DisassemblyPreferenceConstants.ERROR_COLOR));
@@ -834,12 +817,9 @@ public abstract class DisassemblyPart extends WorkbenchPart
protected void setSite(IWorkbenchPartSite site) {
super.setSite(site);
site.getPage().addPartListener(fPartListener);
- fDebugContextListener = new IDebugContextListener() {
- @Override
- public void debugContextChanged(DebugContextEvent event) {
- if ((event.getFlags() & DebugContextEvent.ACTIVATED) != 0) {
- updateDebugContext();
- }
+ fDebugContextListener = event -> {
+ if ((event.getFlags() & DebugContextEvent.ACTIVATED) != 0) {
+ updateDebugContext();
}
};
DebugUITools.addPartDebugContextListener(site, fDebugContextListener);
@@ -1198,12 +1178,7 @@ public abstract class DisassemblyPart extends WorkbenchPart
String id = "#DisassemblyPartContext"; //$NON-NLS-1$
MenuManager menuMgr = new MenuManager(id, id);
menuMgr.setRemoveAllWhenShown(true);
- menuMgr.addMenuListener(new IMenuListener() {
- @Override
- public void menuAboutToShow(IMenuManager manager) {
- DisassemblyPart.this.fillContextMenu(manager);
- }
- });
+ menuMgr.addMenuListener(manager -> DisassemblyPart.this.fillContextMenu(manager));
Menu menu = menuMgr.createContextMenu(fViewer.getTextWidget());
fViewer.getTextWidget().setMenu(menu);
getSite().registerContextMenu(id, menuMgr, fViewer);
@@ -1213,12 +1188,7 @@ public abstract class DisassemblyPart extends WorkbenchPart
String id = "#DisassemblyPartRulerContext"; //$NON-NLS-1$
MenuManager menuMgr = new MenuManager(id, id);
menuMgr.setRemoveAllWhenShown(true);
- menuMgr.addMenuListener(new IMenuListener() {
- @Override
- public void menuAboutToShow(IMenuManager manager) {
- DisassemblyPart.this.fillRulerContextMenu(manager);
- }
- });
+ menuMgr.addMenuListener(manager -> DisassemblyPart.this.fillRulerContextMenu(manager));
Menu menu = menuMgr.createContextMenu(fVerticalRuler.getControl());
fVerticalRuler.getControl().setMenu(menu);
getSite().registerContextMenu(id, menuMgr, fViewer);
@@ -1442,13 +1412,10 @@ public abstract class DisassemblyPart extends WorkbenchPart
assert isGuiThread();
if (address != null) {
final BigInteger addr = address.getValue();
- startUpdate(new Runnable() {
- @Override
- public void run() {
- fGotoFramePending = false;
- fGotoAddressPending = PC_UNKNOWN;
- gotoAddress(addr);
- }
+ startUpdate(() -> {
+ fGotoFramePending = false;
+ fGotoAddressPending = PC_UNKNOWN;
+ gotoAddress(addr);
});
}
}
@@ -1560,15 +1527,12 @@ public abstract class DisassemblyPart extends WorkbenchPart
&& !fRefreshViewPending && fFocusAddress != PC_UNKNOWN) {
fUpdatePending = true;
final int updateCount = fUpdateCount;
- invokeLater(new Runnable() {
- @Override
- public void run() {
- if (updateCount == fUpdateCount) {
- assert fUpdatePending;
- if (fUpdatePending) {
- fUpdatePending = false;
- updateVisibleArea();
- }
+ invokeLater(() -> {
+ if (updateCount == fUpdateCount) {
+ assert fUpdatePending;
+ if (fUpdatePending) {
+ fUpdatePending = false;
+ updateVisibleArea();
}
}
});
@@ -1767,13 +1731,10 @@ public abstract class DisassemblyPart extends WorkbenchPart
if (fDebugSessionId == null) {
return;
}
- startUpdate(new Runnable() {
- @Override
- public void run() {
- if (DEBUG)
- System.out.println("retrieveDisassembly " + file); //$NON-NLS-1$
- fBackend.retrieveDisassembly(file, lines, fEndAddress, mixed, fShowSymbols, fShowDisassembly);
- }
+ startUpdate(() -> {
+ if (DEBUG)
+ System.out.println("retrieveDisassembly " + file); //$NON-NLS-1$
+ fBackend.retrieveDisassembly(file, lines, fEndAddress, mixed, fShowSymbols, fShowDisassembly);
});
}
@@ -2002,12 +1963,7 @@ public abstract class DisassemblyPart extends WorkbenchPart
prevBackend.dispose();
}
if (needUpdate && fViewer != null) {
- startUpdate(new Runnable() {
- @Override
- public void run() {
- debugContextChanged();
- }
- });
+ startUpdate(() -> debugContextChanged());
}
}
@@ -2107,45 +2063,37 @@ public abstract class DisassemblyPart extends WorkbenchPart
fRunnableQueue.clear();
fRefreshViewPending = true;
final long refreshViewScheduled = System.currentTimeMillis() + delay;
- final Runnable refresh = new Runnable() {
- @Override
- public void run() {
- fRefreshViewPending = false;
- long now = System.currentTimeMillis();
- if (now >= refreshViewScheduled) {
- if (DEBUG)
- System.err.println("*** refreshing view ***"); //$NON-NLS-1$
-
- // save viewport position and frame info
- BigInteger topAddress = getTopAddress();
- int targetFrame = fTargetFrame;
- BigInteger frameAddress = fFrameAddress;
- BigInteger pcAddress = fPCAddress;
-
- // clear viewer
- resetViewer();
- if (fScrollPos != null) {
- fScrollPos.isDeleted = true;
- }
-
- // restore frame info and viewport
- fPCAnnotationUpdatePending = true;
- fTargetFrame = targetFrame;
- fFrameAddress = frameAddress;
- fPCAddress = pcAddress;
- gotoAddress(topAddress);
- } else {
- refreshView((int) (refreshViewScheduled - now));
+ final Runnable refresh = () -> {
+ fRefreshViewPending = false;
+ long now = System.currentTimeMillis();
+ if (now >= refreshViewScheduled) {
+ if (DEBUG)
+ System.err.println("*** refreshing view ***"); //$NON-NLS-1$
+
+ // save viewport position and frame info
+ BigInteger topAddress = getTopAddress();
+ int targetFrame = fTargetFrame;
+ BigInteger frameAddress = fFrameAddress;
+ BigInteger pcAddress = fPCAddress;
+
+ // clear viewer
+ resetViewer();
+ if (fScrollPos != null) {
+ fScrollPos.isDeleted = true;
}
+
+ // restore frame info and viewport
+ fPCAnnotationUpdatePending = true;
+ fTargetFrame = targetFrame;
+ fFrameAddress = frameAddress;
+ fPCAddress = pcAddress;
+ gotoAddress(topAddress);
+ } else {
+ refreshView((int) (refreshViewScheduled - now));
}
};
if (delay > 0) {
- invokeLater(delay, new Runnable() {
- @Override
- public void run() {
- doScrollLocked(refresh);
- }
- });
+ invokeLater(delay, () -> doScrollLocked(refresh));
} else {
doScrollLocked(refresh);
}
@@ -2610,12 +2558,9 @@ public abstract class DisassemblyPart extends WorkbenchPart
private void scheduleDoPending() {
if (!fUpdatePending && !fDoPendingPosted) {
fDoPendingPosted = true;
- invokeLater(new Runnable() {
- @Override
- public void run() {
- doPending();
- fDoPendingPosted = false;
- }
+ invokeLater(() -> {
+ doPending();
+ fDoPendingPosted = false;
});
}
}
@@ -2678,12 +2623,9 @@ public abstract class DisassemblyPart extends WorkbenchPart
final int updateCount = fUpdateCount;
if (fUpdatePending) {
if (fRunnableQueue.size() == 1) {
- Runnable doitlater = new Runnable() {
- @Override
- public void run() {
- if (updateCount == fUpdateCount) {
- doScrollLocked(null);
- }
+ Runnable doitlater = () -> {
+ if (updateCount == fUpdateCount) {
+ doScrollLocked(null);
}
};
invokeLater(doitlater);
@@ -3113,12 +3055,9 @@ public abstract class DisassemblyPart extends WorkbenchPart
*/
@Override
public void handleTargetSuspended() {
- asyncExec(new Runnable() {
- @Override
- public void run() {
- updatePC(PC_UNKNOWN);
- firePropertyChange(PROP_SUSPENDED);
- }
+ asyncExec(() -> {
+ updatePC(PC_UNKNOWN);
+ firePropertyChange(PROP_SUSPENDED);
});
}
@@ -3127,12 +3066,9 @@ public abstract class DisassemblyPart extends WorkbenchPart
*/
@Override
public void handleTargetResumed() {
- asyncExec(new Runnable() {
- @Override
- public void run() {
- updatePC(PC_RUNNING);
- firePropertyChange(PROP_SUSPENDED);
- }
+ asyncExec(() -> {
+ updatePC(PC_RUNNING);
+ firePropertyChange(PROP_SUSPENDED);
});
}
@@ -3141,17 +3077,9 @@ public abstract class DisassemblyPart extends WorkbenchPart
*/
@Override
public void handleTargetEnded() {
- asyncExec(new Runnable() {
- @Override
- public void run() {
- fDebugSessionId = null;
- startUpdate(new Runnable() {
- @Override
- public void run() {
- debugContextChanged();
- }
- });
- }
+ asyncExec(() -> {
+ fDebugSessionId = null;
+ startUpdate(() -> debugContextChanged());
});
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/presentation/CSourcePresentationCreator.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/presentation/CSourcePresentationCreator.java
index 5941fab3de..f1ad10ab40 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/presentation/CSourcePresentationCreator.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/presentation/CSourcePresentationCreator.java
@@ -266,12 +266,7 @@ public class CSourcePresentationCreator extends PresentationReconciler
fDamagerRepairer = new SourceTagDamagerRepairer(scanner, fSourceTagProvider, colorManager, store);
if (fSourceTagProvider != null) {
if (fSourceTagListener == null) {
- fSourceTagListener = new ISourceTagListener() {
- @Override
- public void sourceTagsChanged(ISourceTagProvider provider) {
- handleSourceTagsChanged();
- }
- };
+ fSourceTagListener = provider -> handleSourceTagsChanged();
}
fSourceTagProvider.addSourceTagListener(fSourceTagListener);
}
@@ -341,12 +336,9 @@ public class CSourcePresentationCreator extends PresentationReconciler
if (fViewer != null) {
Display display = fViewer.getTextWidget().getDisplay();
if (display.getThread() != Thread.currentThread()) {
- display.asyncExec(new Runnable() {
- @Override
- public void run() {
- if (fViewer != null) {
- fViewer.invalidateTextPresentation();
- }
+ display.asyncExec(() -> {
+ if (fViewer != null) {
+ fViewer.invalidateTextPresentation();
}
});
} else {
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/provisional/DisassemblyRulerColumn.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/provisional/DisassemblyRulerColumn.java
index bcd5cf1645..35ca013667 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/provisional/DisassemblyRulerColumn.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/provisional/DisassemblyRulerColumn.java
@@ -40,14 +40,10 @@ import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyleRange;
import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseListener;
import org.eclipse.swt.events.MouseMoveListener;
import org.eclipse.swt.events.MouseTrackListener;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontMetrics;
@@ -393,14 +389,11 @@ public class DisassemblyRulerColumn extends AbstractContributedRulerColumn imple
/**
* Redraw runnable
*/
- private Runnable fRunnable = new Runnable() {
- @Override
- public void run() {
- synchronized (fRunnableLock) {
- fIsRunnablePosted = false;
- }
- redraw();
+ private Runnable fRunnable = () -> {
+ synchronized (fRunnableLock) {
+ fIsRunnablePosted = false;
}
+ redraw();
};
private boolean fAlignRight;
private boolean fPaintStyleBackground;
@@ -608,21 +601,15 @@ public class DisassemblyRulerColumn extends AbstractContributedRulerColumn imple
fCanvas.setBackground(getBackground(fCanvas.getDisplay()));
fCanvas.setForeground(fForeground);
- fCanvas.addPaintListener(new PaintListener() {
- @Override
- public void paintControl(PaintEvent event) {
- if (fCachedTextViewer != null)
- doubleBufferPaint(event.gc);
- }
+ fCanvas.addPaintListener(event -> {
+ if (fCachedTextViewer != null)
+ doubleBufferPaint(event.gc);
});
- fCanvas.addDisposeListener(new DisposeListener() {
- @Override
- public void widgetDisposed(DisposeEvent e) {
- handleDispose();
- fCachedTextViewer = null;
- fCachedTextWidget = null;
- }
+ fCanvas.addDisposeListener(e -> {
+ handleDispose();
+ fCachedTextViewer = null;
+ fCachedTextWidget = null;
});
fCanvas.addMouseListener(new MouseHandler());
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/sourcelookup/DsfSourceDisplayAdapter.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/sourcelookup/DsfSourceDisplayAdapter.java
index a1c5fd9cbe..0e7bb3a955 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/sourcelookup/DsfSourceDisplayAdapter.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/sourcelookup/DsfSourceDisplayAdapter.java
@@ -756,12 +756,9 @@ public class DsfSourceDisplayAdapter implements ISourceDisplay, ISteppingControl
// Need to remove annotations in UI thread.
Display display = PlatformUI.getWorkbench().getDisplay();
if (display != null && !display.isDisposed()) {
- display.asyncExec(new Runnable() {
- @Override
- public void run() {
- enableLineBackgroundPainter();
- fIPManager.removeAllAnnotations();
- }
+ display.asyncExec(() -> {
+ enableLineBackgroundPainter();
+ fIPManager.removeAllAnnotations();
});
}
}
@@ -997,20 +994,17 @@ public class DsfSourceDisplayAdapter implements ISourceDisplay, ISteppingControl
System.out.println("[DsfSourceDisplayAdapter] eventDispatched e=" + e); //$NON-NLS-1$
}
// trigger source display immediately (should be optional?)
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- Object context = DebugUITools.getDebugContext();
- if (context instanceof IDMVMContext) {
- final IDMContext dmc = ((IDMVMContext) context).getDMContext();
- if (dmc instanceof IFrameDMContext && DMContexts.isAncestorOf(dmc, e.getDMContext())) {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- doDisplaySource((IFrameDMContext) dmc, page, false, true);
- return;
- }
+ Display.getDefault().asyncExec(() -> {
+ Object context = DebugUITools.getDebugContext();
+ if (context instanceof IDMVMContext) {
+ final IDMContext dmc = ((IDMVMContext) context).getDMContext();
+ if (dmc instanceof IFrameDMContext && DMContexts.isAncestorOf(dmc, e.getDMContext())) {
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ doDisplaySource((IFrameDMContext) dmc, page, false, true);
+ return;
}
- doneStepping(e.getDMContext());
}
+ doneStepping(e.getDMContext());
});
} else {
doneStepping(e.getDMContext());
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/AbstractLaunchVMProvider.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/AbstractLaunchVMProvider.java
index 2e327446f0..4fc4167f94 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/AbstractLaunchVMProvider.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/AbstractLaunchVMProvider.java
@@ -83,12 +83,7 @@ public class AbstractLaunchVMProvider extends AbstractDMVMProvider
store.getInt(IDsfDebugUIConstants.PREF_STACK_FRAME_LIMIT));
}
- fPreferencesListener = new IPropertyChangeListener() {
- @Override
- public void propertyChange(final PropertyChangeEvent event) {
- handlePropertyChanged(store, event);
- }
- };
+ fPreferencesListener = event -> handlePropertyChanged(store, event);
store.addPropertyChangeListener(fPreferencesListener);
final IPreferenceStore cStore = CDebugUIPlugin.getDefault().getPreferenceStore();
@@ -116,15 +111,12 @@ public class AbstractLaunchVMProvider extends AbstractDMVMProvider
// We're in session's executor thread. Re-dispatch to our executor thread
// and then call root layout node.
try {
- getExecutor().execute(new Runnable() {
- @Override
- public void run() {
- if (isDisposed())
- return;
+ getExecutor().execute(() -> {
+ if (isDisposed())
+ return;
- for (final DebugEvent event : events) {
- handleEvent(event);
- }
+ for (final DebugEvent event : events) {
+ handleEvent(event);
}
});
} catch (RejectedExecutionException e) {
@@ -175,15 +167,12 @@ public class AbstractLaunchVMProvider extends AbstractDMVMProvider
@Override
public void run() {
if (getSession().isActive()) {
- getExecutor().execute(new Runnable() {
- @Override
- public void run() {
- // trigger full stack frame update
- ScheduledFuture<?> future = fRefreshStackFramesFutures.get(exeContext);
- if (future != null && !isDisposed()) {
- fRefreshStackFramesFutures.remove(exeContext);
- handleEvent(new FullStackRefreshEvent(exeContext, suspendEvent), null);
- }
+ getExecutor().execute(() -> {
+ // trigger full stack frame update
+ ScheduledFuture<?> future = fRefreshStackFramesFutures.get(exeContext);
+ if (future != null && !isDisposed()) {
+ fRefreshStackFramesFutures.remove(exeContext);
+ handleEvent(new FullStackRefreshEvent(exeContext, suspendEvent), null);
}
});
}
@@ -259,16 +248,13 @@ public class AbstractLaunchVMProvider extends AbstractDMVMProvider
// We're in session's executor thread. Re-dispach to our executor thread
// and then call root layout node.
try {
- getExecutor().execute(new Runnable() {
- @Override
- public void run() {
- if (isDisposed())
- return;
+ getExecutor().execute(() -> {
+ if (isDisposed())
+ return;
- IRootVMNode rootLayoutNode = getRootVMNode();
- if (rootLayoutNode != null && rootLayoutNode.getDeltaFlags(event) != IModelDelta.NO_CHANGE) {
- handleEvent(event);
- }
+ IRootVMNode rootLayoutNode = getRootVMNode();
+ if (rootLayoutNode != null && rootLayoutNode.getDeltaFlags(event) != IModelDelta.NO_CHANGE) {
+ handleEvent(event);
}
});
} catch (RejectedExecutionException e) {
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/variable/VariableVMNode.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/variable/VariableVMNode.java
index 7a250dd6a2..d37921c070 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/variable/VariableVMNode.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/variable/VariableVMNode.java
@@ -418,15 +418,12 @@ public class VariableVMNode extends AbstractExpressionVMNode
DebugUITools.getPreferenceStore().removePropertyChangeListener(fPreferenceChangeListener);
}
- fPreferenceChangeListener = new IPropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent event) {
- if (event.getProperty().equals(IDebugUIConstants.PREF_CHANGED_VALUE_BACKGROUND)) {
- columnIdValueBackground.setBackground(
- DebugUITools.getPreferenceColor(IDebugUIConstants.PREF_CHANGED_VALUE_BACKGROUND).getRGB());
- columnNoColumnsBackground.setBackground(
- DebugUITools.getPreferenceColor(IDebugUIConstants.PREF_CHANGED_VALUE_BACKGROUND).getRGB());
- }
+ fPreferenceChangeListener = event -> {
+ if (event.getProperty().equals(IDebugUIConstants.PREF_CHANGED_VALUE_BACKGROUND)) {
+ columnIdValueBackground.setBackground(
+ DebugUITools.getPreferenceColor(IDebugUIConstants.PREF_CHANGED_VALUE_BACKGROUND).getRGB());
+ columnNoColumnsBackground.setBackground(
+ DebugUITools.getPreferenceColor(IDebugUIConstants.PREF_CHANGED_VALUE_BACKGROUND).getRGB());
}
};
@@ -865,22 +862,19 @@ public class VariableVMNode extends AbstractExpressionVMNode
@Override
public void update(final IExpressionUpdate update) {
try {
- getSession().getExecutor().execute(new Runnable() {
- @Override
- public void run() {
- final IExpressions expressionService = getServicesTracker().getService(IExpressions.class);
- if (expressionService != null) {
- IExpressionDMContext expressionDMC = createExpression(expressionService,
- createCompositeDMVMContext(update), update.getExpression().getExpressionText());
+ getSession().getExecutor().execute(() -> {
+ final IExpressions expressionService = getServicesTracker().getService(IExpressions.class);
+ if (expressionService != null) {
+ IExpressionDMContext expressionDMC = createExpression(expressionService,
+ createCompositeDMVMContext(update), update.getExpression().getExpressionText());
- VariableExpressionVMC variableVmc = (VariableExpressionVMC) createVMContext(expressionDMC);
- variableVmc.setExpression(update.getExpression());
+ VariableExpressionVMC variableVmc = (VariableExpressionVMC) createVMContext(expressionDMC);
+ variableVmc.setExpression(update.getExpression());
- update.setExpressionElement(variableVmc);
- update.done();
- } else {
- handleFailedUpdate(update);
- }
+ update.setExpressionElement(variableVmc);
+ update.done();
+ } else {
+ handleFailedUpdate(update);
}
});
} catch (RejectedExecutionException e) {
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/concurrent/DisplayDsfExecutor.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/concurrent/DisplayDsfExecutor.java
index 34f12789d7..1be706b500 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/concurrent/DisplayDsfExecutor.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/concurrent/DisplayDsfExecutor.java
@@ -29,8 +29,6 @@ import org.eclipse.cdt.dsf.concurrent.DsfExecutable;
import org.eclipse.swt.SWT;
import org.eclipse.swt.SWTException;
import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
/**
* DSF executor which uses the display thread to run the submitted runnables
@@ -78,12 +76,9 @@ public class DisplayDsfExecutor extends DefaultDsfExecutor {
private DisplayDsfExecutor(Display display) {
super("Display DSF Executor"); //$NON-NLS-1$
fDisplay = display;
- fDisplay.addListener(SWT.Dispose, new Listener() {
- @Override
- public void handleEvent(Event event) {
- if (event.type == SWT.Dispose) {
- DisplayDsfExecutor.super.shutdownNow();
- }
+ fDisplay.addListener(SWT.Dispose, event -> {
+ if (event.type == SWT.Dispose) {
+ DisplayDsfExecutor.super.shutdownNow();
}
});
}
@@ -120,14 +115,11 @@ public class DisplayDsfExecutor extends DefaultDsfExecutor {
final Throwable[] e = new Throwable[1];
try {
- fDisplay.syncExec(new Runnable() {
- @Override
- public void run() {
- try {
- v[0] = callable.call();
- } catch (Throwable exception) {
- e[0] = exception;
- }
+ fDisplay.syncExec(() -> {
+ try {
+ v[0] = callable.call();
+ } catch (Throwable exception) {
+ e[0] = exception;
}
});
} catch (SWTException swtException) {
@@ -164,20 +156,12 @@ public class DisplayDsfExecutor extends DefaultDsfExecutor {
((DsfExecutable) runnable).setSubmitted();
}
- return new Runnable() {
- @Override
- public void run() {
- try {
- fDisplay.syncExec(new Runnable() {
- @Override
- public void run() {
- runnable.run();
- }
- });
- } catch (SWTException swtException) {
- if (swtException.code == SWT.ERROR_DEVICE_DISPOSED) {
- DisplayDsfExecutor.super.shutdownNow();
- }
+ return () -> {
+ try {
+ fDisplay.syncExec(() -> runnable.run());
+ } catch (SWTException swtException) {
+ if (swtException.code == SWT.ERROR_DEVICE_DISPOSED) {
+ DisplayDsfExecutor.super.shutdownNow();
}
}
};
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/concurrent/SimpleDisplayExecutor.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/concurrent/SimpleDisplayExecutor.java
index b8ff68cd69..d2fe4ab952 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/concurrent/SimpleDisplayExecutor.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/concurrent/SimpleDisplayExecutor.java
@@ -78,12 +78,7 @@ public class SimpleDisplayExecutor implements Executor {
final boolean needsPosting = enqueue(command);
if (needsPosting) {
try {
- fDisplay.asyncExec(new Runnable() {
- @Override
- public void run() {
- runInSwtThread();
- }
- });
+ fDisplay.asyncExec(() -> runInSwtThread());
} catch (final SWTException e) {
if (e.code == SWT.ERROR_DEVICE_DISPOSED) {
throw new RejectedExecutionException("Display " + fDisplay + " is disposed", e); //$NON-NLS-1$ //$NON-NLS-2$
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/AbstractVMAdapter.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/AbstractVMAdapter.java
index 3ce16d5569..c28ebca8c2 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/AbstractVMAdapter.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/AbstractVMAdapter.java
@@ -104,12 +104,7 @@ abstract public class AbstractVMAdapter implements IVMAdapter {
for (final IVMProvider provider : providers) {
try {
- provider.getExecutor().execute(new Runnable() {
- @Override
- public void run() {
- provider.dispose();
- }
- });
+ provider.getExecutor().execute(() -> provider.dispose());
} catch (RejectedExecutionException e) {
// Not much we can do at this point.
}
@@ -155,16 +150,13 @@ abstract public class AbstractVMAdapter implements IVMAdapter {
private void updateProvider(final IVMProvider provider, final IViewerUpdate[] updates) {
try {
- provider.getExecutor().execute(new Runnable() {
- @Override
- public void run() {
- if (updates instanceof IHasChildrenUpdate[]) {
- provider.update((IHasChildrenUpdate[]) updates);
- } else if (updates instanceof IChildrenCountUpdate[]) {
- provider.update((IChildrenCountUpdate[]) updates);
- } else if (updates instanceof IChildrenUpdate[]) {
- provider.update((IChildrenUpdate[]) updates);
- }
+ provider.getExecutor().execute(() -> {
+ if (updates instanceof IHasChildrenUpdate[]) {
+ provider.update((IHasChildrenUpdate[]) updates);
+ } else if (updates instanceof IChildrenCountUpdate[]) {
+ provider.update((IChildrenCountUpdate[]) updates);
+ } else if (updates instanceof IChildrenUpdate[]) {
+ provider.update((IChildrenUpdate[]) updates);
}
});
} catch (RejectedExecutionException e) {
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/datamodel/AbstractDMVMAdapter.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/datamodel/AbstractDMVMAdapter.java
index 3cd75ce385..1d10b40411 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/datamodel/AbstractDMVMAdapter.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/datamodel/AbstractDMVMAdapter.java
@@ -50,13 +50,10 @@ abstract public class AbstractDMVMAdapter extends AbstractVMAdapter {
fSession = session;
// Add ourselves as listener for DM events events.
try {
- session.getExecutor().execute(new Runnable() {
- @Override
- public void run() {
- if (DsfSession.isSessionActive(getSession().getId())) {
- getSession().addServiceEventListener(AbstractDMVMAdapter.this, null);
- fRegisteredAsEventListener = true;
- }
+ session.getExecutor().execute(() -> {
+ if (DsfSession.isSessionActive(getSession().getId())) {
+ getSession().addServiceEventListener(AbstractDMVMAdapter.this, null);
+ fRegisteredAsEventListener = true;
}
});
} catch (RejectedExecutionException e) {
@@ -67,12 +64,9 @@ abstract public class AbstractDMVMAdapter extends AbstractVMAdapter {
@Override
public void dispose() {
try {
- getSession().getExecutor().execute(new Runnable() {
- @Override
- public void run() {
- if (fRegisteredAsEventListener && getSession().isActive()) {
- fSession.removeServiceEventListener(AbstractDMVMAdapter.this);
- }
+ getSession().getExecutor().execute(() -> {
+ if (fRegisteredAsEventListener && getSession().isActive()) {
+ fSession.removeServiceEventListener(AbstractDMVMAdapter.this);
}
});
} catch (RejectedExecutionException e) {
diff --git a/dsf/org.eclipse.cdt.dsf/META-INF/MANIFEST.MF b/dsf/org.eclipse.cdt.dsf/META-INF/MANIFEST.MF
index 77e9434e0c..731f8dac5a 100644
--- a/dsf/org.eclipse.cdt.dsf/META-INF/MANIFEST.MF
+++ b/dsf/org.eclipse.cdt.dsf/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.eclipse.cdt.dsf;singleton:=true
-Bundle-Version: 2.8.1.qualifier
+Bundle-Version: 2.8.100.qualifier
Bundle-Activator: org.eclipse.cdt.dsf.internal.DsfPlugin
Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.runtime,
diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/AbstractCache.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/AbstractCache.java
index 0d2eb1f4bd..8d3af7c63e 100644
--- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/AbstractCache.java
+++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/AbstractCache.java
@@ -41,12 +41,7 @@ public abstract class AbstractCache<V> implements ICache<V> {
private class RequestCanceledListener implements RequestMonitor.ICanceledListener {
@Override
public void requestCanceled(final RequestMonitor canceledRm) {
- fExecutor.getDsfExecutor().execute(new Runnable() {
- @Override
- public void run() {
- handleCanceledRm(canceledRm);
- }
- });
+ fExecutor.getDsfExecutor().execute(() -> handleCanceledRm(canceledRm));
}
}
diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfLaunch.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfLaunch.java
index 5706f5fe56..062580ad0e 100644
--- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfLaunch.java
+++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfLaunch.java
@@ -39,21 +39,11 @@ public class DsfLaunch extends Launch {
@Override
protected void fireChanged() {
- DebugPlugin.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- DsfLaunch.super.fireChanged();
- }
- });
+ DebugPlugin.getDefault().asyncExec(() -> DsfLaunch.super.fireChanged());
}
@Override
protected void fireTerminate() {
- DebugPlugin.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- DsfLaunch.super.fireTerminate();
- }
- });
+ DebugPlugin.getDefault().asyncExec(() -> DsfLaunch.super.fireTerminate());
}
}
diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfMemoryBlock.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfMemoryBlock.java
index 527fe198a9..da7d1c0627 100644
--- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfMemoryBlock.java
+++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfMemoryBlock.java
@@ -109,12 +109,8 @@ public class DsfMemoryBlock extends PlatformObject implements IMemoryBlockExtens
fBlock = null;
try {
- fRetrieval.getExecutor().execute(new Runnable() {
- @Override
- public void run() {
- fRetrieval.getSession().addServiceEventListener(DsfMemoryBlock.this, null);
- }
- });
+ fRetrieval.getExecutor()
+ .execute(() -> fRetrieval.getSession().addServiceEventListener(DsfMemoryBlock.this, null));
} catch (RejectedExecutionException e) {
// Session is shut down.
}
@@ -565,12 +561,8 @@ public class DsfMemoryBlock extends PlatformObject implements IMemoryBlockExtens
@Override
public void dispose() throws DebugException {
try {
- fRetrieval.getExecutor().execute(new Runnable() {
- @Override
- public void run() {
- fRetrieval.getSession().removeServiceEventListener(DsfMemoryBlock.this);
- }
- });
+ fRetrieval.getExecutor()
+ .execute(() -> fRetrieval.getSession().removeServiceEventListener(DsfMemoryBlock.this));
} catch (RejectedExecutionException e) {
// Session is down.
}
diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfMemoryBlockRetrieval.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfMemoryBlockRetrieval.java
index f0f688a220..8995785004 100644
--- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfMemoryBlockRetrieval.java
+++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfMemoryBlockRetrieval.java
@@ -217,14 +217,11 @@ public class DsfMemoryBlockRetrieval extends PlatformObject implements IMemoryBl
DEFAULT_ATTR_DEBUGGER_MEMORY_BLOCKS_VALUE);
if (memento != null && memento.trim().length() != 0) {
// Submit the runnable to install the monitors on dispatch thread.
- getExecutor().submit(new Runnable() {
- @Override
- public void run() {
- try {
- createBlocksFromConfiguration(memoryCtx, memento);
- } catch (CoreException e) {
- DsfPlugin.getDefault().getLog().log(e.getStatus());
- }
+ getExecutor().submit(() -> {
+ try {
+ createBlocksFromConfiguration(memoryCtx, memento);
+ } catch (CoreException e) {
+ DsfPlugin.getDefault().getLog().log(e.getStatus());
}
});
}
diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/BreakpointsMediator.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/BreakpointsMediator.java
index b7c4b07d9f..ca73e17a1b 100644
--- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/BreakpointsMediator.java
+++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/BreakpointsMediator.java
@@ -296,12 +296,7 @@ public class BreakpointsMediator extends AbstractDsfService implements IBreakpoi
}
// Submit the runnable to plant the breakpoints on dispatch thread.
- getExecutor().submit(new Runnable() {
- @Override
- public void run() {
- installInitialBreakpoints(breakpointsDmc, initialPlatformBPs, rm);
- }
- });
+ getExecutor().submit(() -> installInitialBreakpoints(breakpointsDmc, initialPlatformBPs, rm));
return Status.OK_STATUS;
}
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPropertyTab.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPropertyTab.java
index de3cf48514..02c0744a7e 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPropertyTab.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPropertyTab.java
@@ -977,26 +977,22 @@ public class ContainerPropertyTab extends AbstractCBuildPropertyTab
public void listChanged(IDockerConnection c, java.util.List<IDockerImage> list) {
final IDockerImage[] finalList = list.toArray(new IDockerImage[0]);
if (c.getName().equals(connection.getName())) {
- Display.getDefault().syncExec(new Runnable() {
- @Override
- public void run() {
- connection.removeImageListener(containerTab);
- ArrayList<String> imageNames = new ArrayList<>();
- displayedImages = new ArrayList<>();
- for (IDockerImage image : finalList) {
- java.util.List<String> tags = image.repoTags();
- if (tags != null) {
- for (String tag : tags) {
- imageNames.add(tag);
- displayedImages.add(image);
- }
+ Display.getDefault().syncExec(() -> {
+ connection.removeImageListener(containerTab);
+ ArrayList<String> imageNames = new ArrayList<>();
+ displayedImages = new ArrayList<>();
+ for (IDockerImage image : finalList) {
+ java.util.List<String> tags = image.repoTags();
+ if (tags != null) {
+ for (String tag : tags) {
+ imageNames.add(tag);
+ displayedImages.add(image);
}
}
- if (!imageCombo.isDisposed())
- imageCombo.setItems(imageNames.toArray(new String[0]));
- connection.addImageListener(containerTab);
}
-
+ if (!imageCombo.isDisposed())
+ imageCombo.setItems(imageNames.toArray(new String[0]));
+ connection.addImageListener(containerTab);
});
}
}
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerTab.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerTab.java
index a86960e804..3b312994f0 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerTab.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerTab.java
@@ -736,24 +736,20 @@ public class ContainerTab extends AbstractLaunchConfigurationTab
setErrorMessage(Messages.ContainerTab_Error_No_Images);
}
if (c.getName().equals(connection.getName())) {
- Display.getDefault().syncExec(new Runnable() {
- @Override
- public void run() {
- connection.removeImageListener(containerTab);
- ArrayList<String> imageNames = new ArrayList<>();
- for (IDockerImage image : finalList) {
- java.util.List<String> tags = image.repoTags();
- if (tags != null) {
- for (String tag : tags) {
- imageNames.add(tag);
- }
+ Display.getDefault().syncExec(() -> {
+ connection.removeImageListener(containerTab);
+ ArrayList<String> imageNames = new ArrayList<>();
+ for (IDockerImage image : finalList) {
+ java.util.List<String> tags = image.repoTags();
+ if (tags != null) {
+ for (String tag : tags) {
+ imageNames.add(tag);
}
}
- if (!imageCombo.isDisposed())
- imageCombo.setItems(imageNames.toArray(new String[0]));
- connection.addImageListener(containerTab);
}
-
+ if (!imageCombo.isDisposed())
+ imageCombo.setItems(imageNames.toArray(new String[0]));
+ connection.addImageListener(containerTab);
});
}
}
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/LaunchShortcut.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/LaunchShortcut.java
index 4372251be5..52354d28c8 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/LaunchShortcut.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/LaunchShortcut.java
@@ -467,15 +467,8 @@ public class LaunchShortcut implements ILaunchShortcut {
}
// issue error message if no connections exist
if (connection == null) {
- Display.getDefault().syncExec(new Runnable() {
-
- @Override
- public void run() {
- MessageDialog.openError(Display.getCurrent().getActiveShell(),
- Messages.LaunchShortcut_Error_Launching, Messages.LaunchShortcut_No_Connections);
- }
-
- });
+ Display.getDefault().syncExec(() -> MessageDialog.openError(Display.getCurrent().getActiveShell(),
+ Messages.LaunchShortcut_Error_Launching, Messages.LaunchShortcut_No_Connections));
return null;
}
@@ -495,15 +488,8 @@ public class LaunchShortcut implements ILaunchShortcut {
// issue error msg if no images exist
if (image == null) {
- Display.getDefault().syncExec(new Runnable() {
-
- @Override
- public void run() {
- MessageDialog.openError(Display.getCurrent().getActiveShell(),
- Messages.LaunchShortcut_Error_Launching, Messages.LaunchShortcut_No_Images);
- }
-
- });
+ Display.getDefault().syncExec(() -> MessageDialog.openError(Display.getCurrent().getActiveShell(),
+ Messages.LaunchShortcut_Error_Launching, Messages.LaunchShortcut_No_Images));
return null;
}
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/NewContainerTargetWizardPage.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/NewContainerTargetWizardPage.java
index de8e86e96f..986d441745 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/NewContainerTargetWizardPage.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/NewContainerTargetWizardPage.java
@@ -273,24 +273,20 @@ public class NewContainerTargetWizardPage extends WizardPage
setErrorMessage(Messages.NewContainerTargetWizardPage_no_images);
}
if (c.getName().equals(connection.getName())) {
- Display.getDefault().syncExec(new Runnable() {
- @Override
- public void run() {
- connection.removeImageListener(wizardPage);
- ArrayList<String> imageNames = new ArrayList<>();
- for (IDockerImage image : finalList) {
- java.util.List<String> tags = image.repoTags();
- if (tags != null) {
- for (String tag : tags) {
- imageNames.add(tag);
- }
+ Display.getDefault().syncExec(() -> {
+ connection.removeImageListener(wizardPage);
+ ArrayList<String> imageNames = new ArrayList<>();
+ for (IDockerImage image : finalList) {
+ java.util.List<String> tags = image.repoTags();
+ if (tags != null) {
+ for (String tag : tags) {
+ imageNames.add(tag);
}
}
- if (!imageCombo.isDisposed())
- imageCombo.setItems(imageNames.toArray(new String[0]));
- connection.addImageListener(wizardPage);
}
-
+ if (!imageCombo.isDisposed())
+ imageCombo.setItems(imageNames.toArray(new String[0]));
+ connection.addImageListener(wizardPage);
});
}
}
diff --git a/memory/org.eclipse.cdt.debug.ui.memory.floatingpoint/META-INF/MANIFEST.MF b/memory/org.eclipse.cdt.debug.ui.memory.floatingpoint/META-INF/MANIFEST.MF
index 76046d0938..6ec7f6d84e 100644
--- a/memory/org.eclipse.cdt.debug.ui.memory.floatingpoint/META-INF/MANIFEST.MF
+++ b/memory/org.eclipse.cdt.debug.ui.memory.floatingpoint/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.debug.ui.memory.floatingpoint;singleton:=true
-Bundle-Version: 1.0.1.qualifier
+Bundle-Version: 1.0.100.qualifier
Bundle-Localization: plugin
Require-Bundle: org.eclipse.debug.core;bundle-version="3.7.100",
org.eclipse.debug.ui;bundle-version="3.8.1",
diff --git a/memory/org.eclipse.cdt.debug.ui.memory.floatingpoint/src/org/eclipse/cdt/debug/ui/memory/floatingpoint/FPRendering.java b/memory/org.eclipse.cdt.debug.ui.memory.floatingpoint/src/org/eclipse/cdt/debug/ui/memory/floatingpoint/FPRendering.java
index df0d0e86ac..dbb0c03dd7 100644
--- a/memory/org.eclipse.cdt.debug.ui.memory.floatingpoint/src/org/eclipse/cdt/debug/ui/memory/floatingpoint/FPRendering.java
+++ b/memory/org.eclipse.cdt.debug.ui.memory.floatingpoint/src/org/eclipse/cdt/debug/ui/memory/floatingpoint/FPRendering.java
@@ -53,17 +53,13 @@ import org.eclipse.debug.ui.memory.IRepositionableMemoryRendering;
import org.eclipse.debug.ui.memory.IResettableMemoryRendering;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.dialogs.IInputValidator;
import org.eclipse.jface.dialogs.InputDialog;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferenceConverter;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.IBasicPropertyConstants;
import org.eclipse.jface.window.Window;
@@ -121,49 +117,37 @@ public class FPRendering extends AbstractMemoryRendering implements IRepositiona
public FPRendering(String id) {
super(id);
- JFaceResources.getFontRegistry().addListener(new IPropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent event) {
- if (event.getProperty().equals(IInternalDebugUIConstants.FONT_NAME)) {
- FPRendering.this.fRendering
- .handleFontPreferenceChange(JFaceResources.getFont(IInternalDebugUIConstants.FONT_NAME));
- }
+ JFaceResources.getFontRegistry().addListener(event -> {
+ if (event.getProperty().equals(IInternalDebugUIConstants.FONT_NAME)) {
+ FPRendering.this.fRendering
+ .handleFontPreferenceChange(JFaceResources.getFont(IInternalDebugUIConstants.FONT_NAME));
}
});
- this.addPropertyChangeListener(new IPropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent event) {
- IMemoryRendering sourceRendering = (IMemoryRendering) event.getSource();
- if (!sourceRendering.getMemoryBlock().equals(getMemoryBlock()))
- return;
+ this.addPropertyChangeListener(event -> {
+ IMemoryRendering sourceRendering = (IMemoryRendering) event.getSource();
+ if (!sourceRendering.getMemoryBlock().equals(getMemoryBlock()))
+ return;
- Object address = event.getNewValue();
+ Object address = event.getNewValue();
- if (event.getProperty().equals(AbstractTableRendering.PROPERTY_SELECTED_ADDRESS)
- && address instanceof BigInteger) {
- FPRendering.this.fRendering.ensureVisible((BigInteger) address);
- }
+ if (event.getProperty().equals(AbstractTableRendering.PROPERTY_SELECTED_ADDRESS)
+ && address instanceof BigInteger) {
+ FPRendering.this.fRendering.ensureVisible((BigInteger) address);
}
});
- FPRenderingPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(new IPropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent event) {
- disposeColors();
- allocateColors();
- applyPreferences();
- }
+ FPRenderingPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(event -> {
+ disposeColors();
+ allocateColors();
+ applyPreferences();
});
- DebugUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(new IPropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent event) {
- if (event.getProperty().equals(IDebugUIConstants.PREF_PADDED_STR)) {
- if (FPRendering.this.fRendering != null) {
- setRenderingPadding((String) event.getNewValue());
- FPRendering.this.fRendering.redrawPanes();
- }
+ DebugUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(event -> {
+ if (event.getProperty().equals(IDebugUIConstants.PREF_PADDED_STR)) {
+ if (FPRendering.this.fRendering != null) {
+ setRenderingPadding((String) event.getNewValue());
+ FPRendering.this.fRendering.redrawPanes();
}
}
});
@@ -221,13 +205,10 @@ public class FPRendering extends AbstractMemoryRendering implements IRepositiona
* We use the UI dispatch thread to protect the proxy information. Even though I believe the
* dispose routine is always called in the UI dispatch thread. I am going to make sure.
*/
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- if (fModel != null) {
- fModel.removeModelChangedListener(FPRendering.this);
- fModel.dispose();
- }
+ Display.getDefault().asyncExec(() -> {
+ if (fModel != null) {
+ fModel.removeModelChangedListener(FPRendering.this);
+ fModel.dispose();
}
});
@@ -246,29 +227,26 @@ public class FPRendering extends AbstractMemoryRendering implements IRepositiona
*/
final IModelProxyFactory factory = (IModelProxyFactory) DebugPlugin.getAdapter(block, IModelProxyFactory.class);
if (factory != null) {
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
-
- /*
- * The asynchronous model assumes we have an asynchronous viewer that has an IPresentationContext
- * to represent it. The Platform memory subsystem provides a way to create one without a viewewr.
- */
- IMemoryRenderingSite site = container.getMemoryRenderingSite();
- MemoryViewPresentationContext context = new MemoryViewPresentationContext(site, container,
- FPRendering.this);
-
- /*
- * Get a new proxy and perform the initialization sequence so we are known the
- * the model provider.
- */
- fModel = factory.createModelProxy(block, context);
- if (fModel != null) {
- fModel.installed(null);
- fModel.addModelChangedListener(FPRendering.this);
- }
-
+ Display.getDefault().asyncExec(() -> {
+
+ /*
+ * The asynchronous model assumes we have an asynchronous viewer that has an IPresentationContext
+ * to represent it. The Platform memory subsystem provides a way to create one without a viewewr.
+ */
+ IMemoryRenderingSite site = container.getMemoryRenderingSite();
+ MemoryViewPresentationContext context = new MemoryViewPresentationContext(site, container,
+ FPRendering.this);
+
+ /*
+ * Get a new proxy and perform the initialization sequence so we are known the
+ * the model provider.
+ */
+ fModel = factory.createModelProxy(block, context);
+ if (fModel != null) {
+ fModel.installed(null);
+ fModel.addModelChangedListener(FPRendering.this);
}
+
});
}
@@ -605,12 +583,7 @@ public class FPRendering extends AbstractMemoryRendering implements IRepositiona
{
@Override
public void run() {
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- FPRendering.this.fRendering.copyAddressToClipboard();
- }
- });
+ Display.getDefault().asyncExec(() -> FPRendering.this.fRendering.copyAddressToClipboard());
}
};
@@ -621,12 +594,8 @@ public class FPRendering extends AbstractMemoryRendering implements IRepositiona
{
@Override
public void run() {
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- FPRendering.this.fRendering.gotoAddress(FPRendering.this.fRendering.fBaseAddress);
- }
- });
+ Display.getDefault().asyncExec(
+ () -> FPRendering.this.fRendering.gotoAddress(FPRendering.this.fRendering.fBaseAddress));
}
};
@@ -636,21 +605,18 @@ public class FPRendering extends AbstractMemoryRendering implements IRepositiona
{
@Override
public void run() {
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- // For compatibility with DSF update modes (hopefully this will either be replaced
- // by an enhanced platform interface or the caching will move out of the data layer)
-
- try {
- Method m = fRendering.getMemoryBlock().getClass().getMethod("clearCache", new Class[0]); //$NON-NLS-1$
- if (m != null)
- m.invoke(fRendering.getMemoryBlock(), new Object[0]);
- } catch (Exception e) {
- }
-
- FPRendering.this.fRendering.refresh();
+ Display.getDefault().asyncExec(() -> {
+ // For compatibility with DSF update modes (hopefully this will either be replaced
+ // by an enhanced platform interface or the caching will move out of the data layer)
+
+ try {
+ Method m = fRendering.getMemoryBlock().getClass().getMethod("clearCache", new Class[0]); //$NON-NLS-1$
+ if (m != null)
+ m.invoke(fRendering.getMemoryBlock(), new Object[0]);
+ } catch (Exception e) {
}
+
+ FPRendering.this.fRendering.refresh();
});
}
};
@@ -826,24 +792,20 @@ public class FPRendering extends AbstractMemoryRendering implements IRepositiona
@Override
public void run() {
InputDialog inputDialog = new InputDialog(fRendering.getShell(), "Set Column Count", //$NON-NLS-1$
- "Please enter column count", "", new IInputValidator() //$NON-NLS-1$ //$NON-NLS-2$
- {
- @Override
- public String isValid(String input) {
- try {
- int index = Integer.parseInt(input);
-
- if (index <= 0)
- return "Please enter a positive integer"; //$NON-NLS-1$
-
- if (index > 200)
- return "Please enter a positive integer not greater than 200"; //$NON-NLS-1$
- } catch (NumberFormatException x) {
+ "Please enter column count", "", input -> {
+ try {
+ int index = Integer.parseInt(input);
+
+ if (index <= 0)
return "Please enter a positive integer"; //$NON-NLS-1$
- }
- return null;
+ if (index > 200)
+ return "Please enter a positive integer not greater than 200"; //$NON-NLS-1$
+ } catch (NumberFormatException x) {
+ return "Please enter a positive integer"; //$NON-NLS-1$
}
+
+ return null;
});
if (inputDialog.open() != Window.OK) {
@@ -927,104 +889,101 @@ public class FPRendering extends AbstractMemoryRendering implements IRepositiona
// Add the right-mouse-click (RMC) context menu items
- getPopupMenuManager().addMenuListener(new IMenuListener() {
- @Override
- public void menuAboutToShow(IMenuManager manager) {
- manager.add(new Separator());
+ getPopupMenuManager().addMenuListener(manager -> {
+ manager.add(new Separator());
- MenuManager sub = new MenuManager(FPRenderingMessages.getString("FPRendering.PANES")); //$NON-NLS-1$
+ MenuManager sub = new MenuManager(FPRenderingMessages.getString("FPRendering.PANES")); //$NON-NLS-1$
- sub = new MenuManager(FPRenderingMessages.getString("FPRendering.ENDIAN")); //$NON-NLS-1$
- sub.add(actionDisplayBigEndian);
- sub.add(actionDisplayLittleEndian);
- manager.add(sub);
+ sub = new MenuManager(FPRenderingMessages.getString("FPRendering.ENDIAN")); //$NON-NLS-1$
+ sub.add(actionDisplayBigEndian);
+ sub.add(actionDisplayLittleEndian);
+ manager.add(sub);
- sub = new MenuManager(FPRenderingMessages.getString("FPRendering.NUMBER_TYPE")); //$NON-NLS-1$
- sub.add(actionFloatingPoint32);
- sub.add(actionFloatingPoint64);
- manager.add(sub);
+ sub = new MenuManager(FPRenderingMessages.getString("FPRendering.NUMBER_TYPE")); //$NON-NLS-1$
+ sub.add(actionFloatingPoint32);
+ sub.add(actionFloatingPoint64);
+ manager.add(sub);
- sub = new MenuManager(FPRenderingMessages.getString("FPRendering.PRECISION")); //$NON-NLS-1$
- sub.add(actionDisplay4Digits);
- sub.add(actionDisplay8Digits);
- sub.add(actionDisplay16Digits);
- manager.add(sub);
+ sub = new MenuManager(FPRenderingMessages.getString("FPRendering.PRECISION")); //$NON-NLS-1$
+ sub.add(actionDisplay4Digits);
+ sub.add(actionDisplay8Digits);
+ sub.add(actionDisplay16Digits);
+ manager.add(sub);
- // TODO: Add separator for FP group here: manager.add(new Separator());
+ // TODO: Add separator for FP group here: manager.add(new Separator());
- sub = new MenuManager(FPRenderingMessages.getString("FPRendering.COLUMN_COUNT")); //$NON-NLS-1$
- sub.add(displayColumnCountAuto);
+ sub = new MenuManager(FPRenderingMessages.getString("FPRendering.COLUMN_COUNT")); //$NON-NLS-1$
+ sub.add(displayColumnCountAuto);
- for (int index = 0; index < displayColumnCounts.length; index++)
- sub.add(displayColumnCounts[index]);
+ for (int index1 = 0; index1 < displayColumnCounts.length; index1++)
+ sub.add(displayColumnCounts[index1]);
- boolean currentCountIsCustom = fRendering.getColumnsSetting() != 0;
+ boolean currentCountIsCustom = fRendering.getColumnsSetting() != 0;
- for (int index = 0, j = 1; index < MAX_MENU_COLUMN_COUNT && currentCountIsCustom; index++, j *= 2)
- currentCountIsCustom = (j != fRendering.getColumnsSetting());
+ for (int index2 = 0, j = 1; index2 < MAX_MENU_COLUMN_COUNT && currentCountIsCustom; index2++, j *= 2)
+ currentCountIsCustom = (j != fRendering.getColumnsSetting());
- if (currentCountIsCustom)
- sub.add(displayColumnCountCustomValue);
+ if (currentCountIsCustom)
+ sub.add(displayColumnCountCustomValue);
- sub.add(displayColumnCountCustom);
- manager.add(sub);
+ sub.add(displayColumnCountCustom);
+ manager.add(sub);
- // Update modes
+ // Update modes
- int updateMode = getRMCvalue(IFPRConstants.UPDATEMODE_KEY);
+ int updateMode = getRMCvalue(IFPRConstants.UPDATEMODE_KEY);
- final Action updateAlwaysAction = new Action(FPRenderingMessages.getString("FPRendering.UPDATE_ALWAYS"), //$NON-NLS-1$
- IAction.AS_RADIO_BUTTON) {
- @Override
- public void run() {
- fRendering.setUpdateMode(Rendering.UPDATE_ALWAYS);
- setRMCvalue(IFPRConstants.UPDATEMODE_KEY, Rendering.UPDATE_ALWAYS);
- }
- };
- updateAlwaysAction.setChecked(updateMode == Rendering.UPDATE_ALWAYS);
+ final Action updateAlwaysAction = new Action(FPRenderingMessages.getString("FPRendering.UPDATE_ALWAYS"), //$NON-NLS-1$
+ IAction.AS_RADIO_BUTTON) {
+ @Override
+ public void run() {
+ fRendering.setUpdateMode(Rendering.UPDATE_ALWAYS);
+ setRMCvalue(IFPRConstants.UPDATEMODE_KEY, Rendering.UPDATE_ALWAYS);
+ }
+ };
+ updateAlwaysAction.setChecked(updateMode == Rendering.UPDATE_ALWAYS);
- final Action updateOnBreakpointAction = new Action(
- FPRenderingMessages.getString("FPRendering.UPDATE_ON_BREAKPOINT"), IAction.AS_RADIO_BUTTON) //$NON-NLS-1$
- {
- @Override
- public void run() {
- fRendering.setUpdateMode(Rendering.UPDATE_ON_BREAKPOINT);
- setRMCvalue(IFPRConstants.UPDATEMODE_KEY, Rendering.UPDATE_ON_BREAKPOINT);
- }
- };
- updateOnBreakpointAction.setChecked(updateMode == Rendering.UPDATE_ON_BREAKPOINT);
+ final Action updateOnBreakpointAction = new Action(
+ FPRenderingMessages.getString("FPRendering.UPDATE_ON_BREAKPOINT"), IAction.AS_RADIO_BUTTON) //$NON-NLS-1$
+ {
+ @Override
+ public void run() {
+ fRendering.setUpdateMode(Rendering.UPDATE_ON_BREAKPOINT);
+ setRMCvalue(IFPRConstants.UPDATEMODE_KEY, Rendering.UPDATE_ON_BREAKPOINT);
+ }
+ };
+ updateOnBreakpointAction.setChecked(updateMode == Rendering.UPDATE_ON_BREAKPOINT);
- final Action updateManualAction = new Action(FPRenderingMessages.getString("FPRendering.UPDATE_MANUAL"), //$NON-NLS-1$
- IAction.AS_RADIO_BUTTON) {
- @Override
- public void run() {
- fRendering.setUpdateMode(Rendering.UPDATE_MANUAL);
- setRMCvalue(IFPRConstants.UPDATEMODE_KEY, Rendering.UPDATE_MANUAL);
- }
- };
- updateManualAction.setChecked(updateMode == Rendering.UPDATE_MANUAL);
+ final Action updateManualAction = new Action(FPRenderingMessages.getString("FPRendering.UPDATE_MANUAL"), //$NON-NLS-1$
+ IAction.AS_RADIO_BUTTON) {
+ @Override
+ public void run() {
+ fRendering.setUpdateMode(Rendering.UPDATE_MANUAL);
+ setRMCvalue(IFPRConstants.UPDATEMODE_KEY, Rendering.UPDATE_MANUAL);
+ }
+ };
+ updateManualAction.setChecked(updateMode == Rendering.UPDATE_MANUAL);
- // Add menu
+ // Add menu
- sub = new MenuManager(FPRenderingMessages.getString("FPRendering.UPDATEMODE")); //$NON-NLS-1$
- sub.add(updateAlwaysAction);
- sub.add(updateOnBreakpointAction);
- sub.add(updateManualAction);
- manager.add(sub);
- manager.add(new Separator());
+ sub = new MenuManager(FPRenderingMessages.getString("FPRendering.UPDATEMODE")); //$NON-NLS-1$
+ sub.add(updateAlwaysAction);
+ sub.add(updateOnBreakpointAction);
+ sub.add(updateManualAction);
+ manager.add(sub);
+ manager.add(new Separator());
- BigInteger start = fRendering.getSelection().getStart();
- BigInteger end = fRendering.getSelection().getEnd();
- copyAction.setEnabled(start != null && end != null);
+ BigInteger start = fRendering.getSelection().getStart();
+ BigInteger end = fRendering.getSelection().getEnd();
+ copyAction.setEnabled(start != null && end != null);
- manager.add(copyAction);
- manager.add(copyAddressAction);
+ manager.add(copyAction);
+ manager.add(copyAddressAction);
- manager.add(gotoBaseAddressAction);
- manager.add(refreshAction);
- manager.add(new Separator());
- manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
- }
+ manager.add(gotoBaseAddressAction);
+ manager.add(refreshAction);
+ manager.add(new Separator());
+ manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
});
}
@@ -1097,12 +1056,7 @@ public class FPRendering extends AbstractMemoryRendering implements IRepositiona
@Override
public void goToAddress(final BigInteger address) throws DebugException {
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- fRendering.gotoAddress(address);
- }
- });
+ Display.getDefault().asyncExec(() -> fRendering.gotoAddress(address));
}
protected void setTargetMemoryLittleEndian(boolean littleEndian) {
@@ -1145,27 +1099,19 @@ public class FPRendering extends AbstractMemoryRendering implements IRepositiona
if (adapter == IMemoryBlockConnection.class) {
if (fConnection == null) {
- fConnection = new IMemoryBlockConnection() {
- @Override
- public void update() {
- // update UI asynchronously
- Display display = FPRenderingPlugin.getDefault().getWorkbench().getDisplay();
- display.asyncExec(new Runnable() {
- @Override
- public void run() {
- try {
- if (fBigBaseAddress != FPRendering.this.fRendering.getMemoryBlock()
- .getBigBaseAddress()) {
- fBigBaseAddress = FPRendering.this.fRendering.getMemoryBlock()
- .getBigBaseAddress();
- FPRendering.this.fRendering.gotoAddress(fBigBaseAddress);
- }
- FPRendering.this.fRendering.refresh();
- } catch (DebugException e) {
- }
+ fConnection = () -> {
+ // update UI asynchronously
+ Display display = FPRenderingPlugin.getDefault().getWorkbench().getDisplay();
+ display.asyncExec(() -> {
+ try {
+ if (fBigBaseAddress != FPRendering.this.fRendering.getMemoryBlock().getBigBaseAddress()) {
+ fBigBaseAddress = FPRendering.this.fRendering.getMemoryBlock().getBigBaseAddress();
+ FPRendering.this.fRendering.gotoAddress(fBigBaseAddress);
}
- });
- }
+ FPRendering.this.fRendering.refresh();
+ } catch (DebugException e) {
+ }
+ });
};
}
diff --git a/memory/org.eclipse.cdt.debug.ui.memory.floatingpoint/src/org/eclipse/cdt/debug/ui/memory/floatingpoint/FPRenderingPreferenceAction.java b/memory/org.eclipse.cdt.debug.ui.memory.floatingpoint/src/org/eclipse/cdt/debug/ui/memory/floatingpoint/FPRenderingPreferenceAction.java
index 4de3ee401a..4cdf63dbc9 100644
--- a/memory/org.eclipse.cdt.debug.ui.memory.floatingpoint/src/org/eclipse/cdt/debug/ui/memory/floatingpoint/FPRenderingPreferenceAction.java
+++ b/memory/org.eclipse.cdt.debug.ui.memory.floatingpoint/src/org/eclipse/cdt/debug/ui/memory/floatingpoint/FPRenderingPreferenceAction.java
@@ -36,12 +36,7 @@ public class FPRenderingPreferenceAction extends ActionDelegate implements IView
}
protected void showPreferencePage(String id, IPreferencePage page) {
- BusyIndicator.showWhile(FPRenderingPlugin.getStandardDisplay(), new Runnable() {
- @Override
- public void run() {
- PreferencesUtil.createPreferenceDialogOn(FPRenderingPlugin.getShell(), id, new String[] { id }, null)
- .open();
- }
- });
+ BusyIndicator.showWhile(FPRenderingPlugin.getStandardDisplay(), () -> PreferencesUtil
+ .createPreferenceDialogOn(FPRenderingPlugin.getShell(), id, new String[] { id }, null).open());
}
}
diff --git a/memory/org.eclipse.cdt.debug.ui.memory.floatingpoint/src/org/eclipse/cdt/debug/ui/memory/floatingpoint/Rendering.java b/memory/org.eclipse.cdt.debug.ui.memory.floatingpoint/src/org/eclipse/cdt/debug/ui/memory/floatingpoint/Rendering.java
index 7c6a72f7e7..90eec95d7f 100644
--- a/memory/org.eclipse.cdt.debug.ui.memory.floatingpoint/src/org/eclipse/cdt/debug/ui/memory/floatingpoint/Rendering.java
+++ b/memory/org.eclipse.cdt.debug.ui.memory.floatingpoint/src/org/eclipse/cdt/debug/ui/memory/floatingpoint/Rendering.java
@@ -51,8 +51,6 @@ import org.eclipse.swt.events.ControlEvent;
import org.eclipse.swt.events.ControlListener;
import org.eclipse.swt.events.KeyAdapter;
import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
@@ -238,12 +236,9 @@ public class Rendering extends Composite implements IDebugEventSetListener {
getHorizontalBar().addSelectionListener(createHorizontalBarSelectionListener());
getVerticalBar().addSelectionListener(createVerticalBarSelectinListener());
- this.addPaintListener(new PaintListener() {
- @Override
- public void paintControl(PaintEvent pe) {
- pe.gc.setBackground(Rendering.this.getFPRendering().getColorBackground());
- pe.gc.fillRectangle(0, 0, Rendering.this.getBounds().width, Rendering.this.getBounds().height);
- }
+ this.addPaintListener(pe -> {
+ pe.gc.setBackground(Rendering.this.getFPRendering().getColorBackground());
+ pe.gc.fillRectangle(0, 0, Rendering.this.getBounds().width, Rendering.this.getBounds().height);
});
setLayout();
@@ -560,24 +555,16 @@ public class Rendering extends Composite implements IDebugEventSetListener {
protected void handleSuspend(boolean isBreakpointHit) {
if (getUpdateMode() == UPDATE_ALWAYS || (getUpdateMode() == UPDATE_ON_BREAKPOINT && isBreakpointHit)) {
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- archiveDeltas();
- refresh();
- }
+ Display.getDefault().asyncExec(() -> {
+ archiveDeltas();
+ refresh();
});
}
}
protected void handleChange() {
if (getUpdateMode() == UPDATE_ALWAYS) {
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- refresh();
- }
- });
+ Display.getDefault().asyncExec(() -> refresh());
}
}
@@ -859,205 +846,202 @@ public class Rendering extends Composite implements IDebugEventSetListener {
fCache.end = endAddress;
fCache.bytes = cachedBytesFinal;
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- // Generate deltas
-
- for (int historyIndex = 0; historyIndex < getHistoryDepth(); historyIndex++) {
- if (fHistoryCache[historyIndex] != null && fHistoryCache[historyIndex].isValid()) {
- BigInteger maxStart = startAddress.max(fHistoryCache[historyIndex].start);
- BigInteger minEnd = endAddress.min(fHistoryCache[historyIndex].end)
- .subtract(BigInteger.ONE);
-
- BigInteger overlapLength = minEnd.subtract(maxStart);
- if (overlapLength.compareTo(BigInteger.valueOf(0)) > 0) {
- // there is overlap
-
- int offsetIntoOld = maxStart.subtract(fHistoryCache[historyIndex].start).intValue();
- int offsetIntoNew = maxStart.subtract(startAddress).intValue();
-
- for (int i = overlapLength.intValue(); i >= 0; i--) {
- cachedBytesFinal[offsetIntoNew + i].setChanged(historyIndex,
- cachedBytesFinal[offsetIntoNew + i]
- .getValue() != fHistoryCache[historyIndex].bytes[offsetIntoOld
- + i].getValue());
- }
+ Display.getDefault().asyncExec(() -> {
+ // Generate deltas
- // There are several scenarios where the history cache must be updated from the data cache, so that when a
- // cell is edited the font color changes appropriately. The following code deals with the different cases.
+ for (int historyIndex = 0; historyIndex < getHistoryDepth(); historyIndex++) {
+ if (fHistoryCache[historyIndex] != null && fHistoryCache[historyIndex].isValid()) {
+ BigInteger maxStart = startAddress.max(fHistoryCache[historyIndex].start);
+ BigInteger minEnd = endAddress.min(fHistoryCache[historyIndex].end)
+ .subtract(BigInteger.ONE);
- if (historyIndex != 0)
- continue;
+ BigInteger overlapLength = minEnd.subtract(maxStart);
+ if (overlapLength.compareTo(BigInteger.valueOf(0)) > 0) {
+ // there is overlap
- int dataStart = fCache.start.intValue();
- int dataEnd = fCache.end.intValue();
- int dataLength = fCache.bytes.length;
+ int offsetIntoOld = maxStart.subtract(fHistoryCache[historyIndex].start).intValue();
+ int offsetIntoNew = maxStart.subtract(startAddress).intValue();
- int historyStart = fHistoryCache[0].start.intValue();
- int historyEnd = fHistoryCache[0].end.intValue();
- int historyLength = fHistoryCache[0].bytes.length;
+ for (int i = overlapLength.intValue(); i >= 0; i--) {
+ cachedBytesFinal[offsetIntoNew + i].setChanged(historyIndex,
+ cachedBytesFinal[offsetIntoNew + i]
+ .getValue() != fHistoryCache[historyIndex].bytes[offsetIntoOld + i]
+ .getValue());
+ }
- // Case 1: The data cache is smaller than the history cache; the data cache's
- // address range is fully covered by the history cache. Do nothing.
+ // There are several scenarios where the history cache must be updated from the data cache, so that when a
+ // cell is edited the font color changes appropriately. The following code deals with the different cases.
- if ((dataStart >= historyStart) && (dataEnd <= historyEnd))
- continue;
+ if (historyIndex != 0)
+ continue;
- // Case 2: The data and history cache's do not overlap at all
+ int dataStart = fCache.start.intValue();
+ int dataEnd = fCache.end.intValue();
+ int dataLength = fCache.bytes.length;
- if (((dataStart < historyStart) && (dataEnd < historyStart))
- || (dataStart > historyEnd)) {
- // Create a new history cache: Copy the data cache bytes to the history cache
+ int historyStart = fHistoryCache[0].start.intValue();
+ int historyEnd = fHistoryCache[0].end.intValue();
+ int historyLength = fHistoryCache[0].bytes.length;
- MemoryUnit newHistoryCache = new MemoryUnit();
+ // Case 1: The data cache is smaller than the history cache; the data cache's
+ // address range is fully covered by the history cache. Do nothing.
- newHistoryCache.start = fCache.start;
- newHistoryCache.end = fCache.end;
- int newHistoryCacheSize = fCache.bytes.length;
- newHistoryCache.bytes = new FPMemoryByte[newHistoryCacheSize];
+ if ((dataStart >= historyStart) && (dataEnd <= historyEnd))
+ continue;
- for (int index = 0; index < newHistoryCacheSize; index++)
- newHistoryCache.bytes[index] = new FPMemoryByte(
- fCache.bytes[index].getValue());
+ // Case 2: The data and history cache's do not overlap at all
- fHistoryCache[0] = newHistoryCache;
+ if (((dataStart < historyStart) && (dataEnd < historyStart))
+ || (dataStart > historyEnd)) {
+ // Create a new history cache: Copy the data cache bytes to the history cache
- continue;
- }
+ MemoryUnit newHistoryCache1 = new MemoryUnit();
- // Case 3: The data cache starts at a lower address than the history cache, but overlaps the history cache
+ newHistoryCache1.start = fCache.start;
+ newHistoryCache1.end = fCache.end;
+ int newHistoryCacheSize1 = fCache.bytes.length;
+ newHistoryCache1.bytes = new FPMemoryByte[newHistoryCacheSize1];
- if ((dataStart < historyStart)
- && ((dataEnd >= historyStart) && (dataEnd <= historyEnd))) {
- // Create a new history cache with the missing data from the main cache and append the old history to it.
+ for (int index1 = 0; index1 < newHistoryCacheSize1; index1++)
+ newHistoryCache1.bytes[index1] = new FPMemoryByte(
+ fCache.bytes[index1].getValue());
- int missingDataByteCount = historyStart - dataStart;
- int historyCacheSize = historyLength;
- int newHistoryCacheSize = missingDataByteCount + historyLength;
+ fHistoryCache[0] = newHistoryCache1;
- if (missingDataByteCount <= 0 && historyCacheSize <= 0)
- break;
+ continue;
+ }
- MemoryUnit newHistoryCache = new MemoryUnit();
+ // Case 3: The data cache starts at a lower address than the history cache, but overlaps the history cache
- newHistoryCache.start = fCache.start;
- newHistoryCache.end = fHistoryCache[0].end;
- newHistoryCache.bytes = new FPMemoryByte[newHistoryCacheSize];
+ if ((dataStart < historyStart)
+ && ((dataEnd >= historyStart) && (dataEnd <= historyEnd))) {
+ // Create a new history cache with the missing data from the main cache and append the old history to it.
- // Copy the missing bytes from the beginning of the main cache to the history cache.
+ int missingDataByteCount1 = historyStart - dataStart;
+ int historyCacheSize1 = historyLength;
+ int newHistoryCacheSize2 = missingDataByteCount1 + historyLength;
- for (int index = 0; index < missingDataByteCount; index++)
- newHistoryCache.bytes[index] = new FPMemoryByte(
- fCache.bytes[index].getValue());
+ if (missingDataByteCount1 <= 0 && historyCacheSize1 <= 0)
+ break;
- // Copy the remaining bytes from the old history cache to the new history cache
+ MemoryUnit newHistoryCache2 = new MemoryUnit();
- for (int index = 0; index < historyCacheSize; index++)
- newHistoryCache.bytes[index + missingDataByteCount] = new FPMemoryByte(
- fHistoryCache[0].bytes[index].getValue());
+ newHistoryCache2.start = fCache.start;
+ newHistoryCache2.end = fHistoryCache[0].end;
+ newHistoryCache2.bytes = new FPMemoryByte[newHistoryCacheSize2];
- fHistoryCache[0] = newHistoryCache;
+ // Copy the missing bytes from the beginning of the main cache to the history cache.
- continue;
- }
+ for (int index2 = 0; index2 < missingDataByteCount1; index2++)
+ newHistoryCache2.bytes[index2] = new FPMemoryByte(
+ fCache.bytes[index2].getValue());
- // Case 4: The data cache starts at a higher address than the history cache
+ // Copy the remaining bytes from the old history cache to the new history cache
- if (((dataStart >= historyStart) && (dataStart <= historyEnd))
- && (dataEnd > historyEnd)) {
- // Append the missing main cache bytes to the history cache.
+ for (int index3 = 0; index3 < historyCacheSize1; index3++)
+ newHistoryCache2.bytes[index3 + missingDataByteCount1] = new FPMemoryByte(
+ fHistoryCache[0].bytes[index3].getValue());
- int missingDataByteCount = dataEnd - historyEnd;
- int historyCacheSize = historyEnd - historyStart;
- int newHistoryCacheSize = missingDataByteCount + historyLength;
+ fHistoryCache[0] = newHistoryCache2;
- if (missingDataByteCount > 0 && historyCacheSize > 0) {
- MemoryUnit newHistoryCache = new MemoryUnit();
+ continue;
+ }
- newHistoryCache.start = fHistoryCache[0].start;
- newHistoryCache.end = fCache.end;
- newHistoryCache.bytes = new FPMemoryByte[newHistoryCacheSize];
+ // Case 4: The data cache starts at a higher address than the history cache
- // Copy the old history bytes to the new history cache
+ if (((dataStart >= historyStart) && (dataStart <= historyEnd))
+ && (dataEnd > historyEnd)) {
+ // Append the missing main cache bytes to the history cache.
- System.arraycopy(fHistoryCache[0].bytes, 0, newHistoryCache.bytes, 0,
- historyLength);
+ int missingDataByteCount2 = dataEnd - historyEnd;
+ int historyCacheSize2 = historyEnd - historyStart;
+ int newHistoryCacheSize3 = missingDataByteCount2 + historyLength;
- // Copy the bytes from the main cache that are not in the history cache to the end of the new history cache.
+ if (missingDataByteCount2 > 0 && historyCacheSize2 > 0) {
+ MemoryUnit newHistoryCache3 = new MemoryUnit();
- for (int index = 0; index < missingDataByteCount; index++) {
- int srcIndex = dataLength - missingDataByteCount + index;
- int dstIndex = historyLength + index;
- newHistoryCache.bytes[dstIndex] = new FPMemoryByte(
- fCache.bytes[srcIndex].getValue());
- }
+ newHistoryCache3.start = fHistoryCache[0].start;
+ newHistoryCache3.end = fCache.end;
+ newHistoryCache3.bytes = new FPMemoryByte[newHistoryCacheSize3];
- fHistoryCache[0] = newHistoryCache;
+ // Copy the old history bytes to the new history cache
- continue;
+ System.arraycopy(fHistoryCache[0].bytes, 0, newHistoryCache3.bytes, 0,
+ historyLength);
+
+ // Copy the bytes from the main cache that are not in the history cache to the end of the new history cache.
+
+ for (int index4 = 0; index4 < missingDataByteCount2; index4++) {
+ int srcIndex = dataLength - missingDataByteCount2 + index4;
+ int dstIndex = historyLength + index4;
+ newHistoryCache3.bytes[dstIndex] = new FPMemoryByte(
+ fCache.bytes[srcIndex].getValue());
}
+
+ fHistoryCache[0] = newHistoryCache3;
+
+ continue;
}
+ }
- // Case 5 - The data cache is greater than the history cache and fully covers it
+ // Case 5 - The data cache is greater than the history cache and fully covers it
- if (dataStart < historyStart && dataEnd > historyEnd) {
- int start = 0;
- int end = 0;
+ if (dataStart < historyStart && dataEnd > historyEnd) {
+ int start = 0;
+ int end = 0;
- // Create a new history cache to reflect the entire data cache
+ // Create a new history cache to reflect the entire data cache
- MemoryUnit newHistoryCache = new MemoryUnit();
+ MemoryUnit newHistoryCache4 = new MemoryUnit();
- newHistoryCache.start = fCache.start;
- newHistoryCache.end = fCache.end;
- int newHistoryCacheSize = fCache.bytes.length;
- newHistoryCache.bytes = new FPMemoryByte[newHistoryCacheSize];
+ newHistoryCache4.start = fCache.start;
+ newHistoryCache4.end = fCache.end;
+ int newHistoryCacheSize4 = fCache.bytes.length;
+ newHistoryCache4.bytes = new FPMemoryByte[newHistoryCacheSize4];
- int topByteCount = historyStart - dataStart;
- int bottomByteCount = dataEnd - historyEnd;
+ int topByteCount = historyStart - dataStart;
+ int bottomByteCount = dataEnd - historyEnd;
- // Copy the bytes from the beginning of the data cache to the new history cache
+ // Copy the bytes from the beginning of the data cache to the new history cache
- for (int index = 0; index < topByteCount; index++)
- newHistoryCache.bytes[index] = new FPMemoryByte(
- fCache.bytes[index].getValue());
+ for (int index5 = 0; index5 < topByteCount; index5++)
+ newHistoryCache4.bytes[index5] = new FPMemoryByte(
+ fCache.bytes[index5].getValue());
- // Copy the old history cache bytes to the new history cache
+ // Copy the old history cache bytes to the new history cache
- start = topByteCount;
- end = topByteCount + historyLength;
+ start = topByteCount;
+ end = topByteCount + historyLength;
- for (int index = start; index < end; index++)
- newHistoryCache.bytes[index] = new FPMemoryByte(
- fCache.bytes[index].getValue());
+ for (int index6 = start; index6 < end; index6++)
+ newHistoryCache4.bytes[index6] = new FPMemoryByte(
+ fCache.bytes[index6].getValue());
- // Copy the bytes from the end of the data cache to the new history cache
+ // Copy the bytes from the end of the data cache to the new history cache
- start = topByteCount + historyLength;
- end = topByteCount + historyLength + bottomByteCount;
+ start = topByteCount + historyLength;
+ end = topByteCount + historyLength + bottomByteCount;
- for (int index = start; index < end; index++)
- newHistoryCache.bytes[index] = new FPMemoryByte(
- fCache.bytes[index].getValue());
+ for (int index7 = start; index7 < end; index7++)
+ newHistoryCache4.bytes[index7] = new FPMemoryByte(
+ fCache.bytes[index7].getValue());
- fHistoryCache[0] = newHistoryCache;
+ fHistoryCache[0] = newHistoryCache4;
- continue;
- }
+ continue;
}
}
}
+ }
- // If the history does not exist, populate the history with the just populated
- // cache. This solves the use case of (1) connect to target; (2) edit memory
- // before the first suspend debug event; (3) paint differences in changed color.
+ // If the history does not exist, populate the history with the just populated
+ // cache. This solves the use case of (1) connect to target; (2) edit memory
+ // before the first suspend debug event; (3) paint differences in changed color.
- if (fHistoryCache[0] == null)
- fHistoryCache[0] = fCache.clone();
+ if (fHistoryCache[0] == null)
+ fHistoryCache[0] = fCache.clone();
- Rendering.this.redrawPanes();
- }
+ Rendering.this.redrawPanes();
});
} catch (Exception e) {
@@ -1728,12 +1712,9 @@ public class Rendering extends Composite implements IDebugEventSetListener {
fParent.setTargetMemoryLittleEndian(littleEndian);
fIsTargetLittleEndian = littleEndian;
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- fireSettingsChanged();
- layoutPanes();
- }
+ Display.getDefault().asyncExec(() -> {
+ fireSettingsChanged();
+ layoutPanes();
});
}
@@ -1747,12 +1728,7 @@ public class Rendering extends Composite implements IDebugEventSetListener {
fIsDisplayLittleEndian = isLittleEndian;
fireSettingsChanged();
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- layoutPanes();
- }
- });
+ Display.getDefault().asyncExec(() -> layoutPanes());
}
public int getCharsPerColumn() {
diff --git a/memory/org.eclipse.cdt.debug.ui.memory.memorybrowser/META-INF/MANIFEST.MF b/memory/org.eclipse.cdt.debug.ui.memory.memorybrowser/META-INF/MANIFEST.MF
index a12d58a852..8d1b218535 100644
--- a/memory/org.eclipse.cdt.debug.ui.memory.memorybrowser/META-INF/MANIFEST.MF
+++ b/memory/org.eclipse.cdt.debug.ui.memory.memorybrowser/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.debug.ui.memory.memorybrowser;singleton:=true
-Bundle-Version: 1.3.1.qualifier
+Bundle-Version: 1.3.100.qualifier
Bundle-Activator: org.eclipse.cdt.debug.ui.memory.memorybrowser.MemoryBrowserPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/memory/org.eclipse.cdt.debug.ui.memory.memorybrowser/src/org/eclipse/cdt/debug/ui/memory/memorybrowser/MemoryBrowser.java b/memory/org.eclipse.cdt.debug.ui.memory.memorybrowser/src/org/eclipse/cdt/debug/ui/memory/memorybrowser/MemoryBrowser.java
index 46cdcf15de..e14e2090f1 100644
--- a/memory/org.eclipse.cdt.debug.ui.memory.memorybrowser/src/org/eclipse/cdt/debug/ui/memory/memorybrowser/MemoryBrowser.java
+++ b/memory/org.eclipse.cdt.debug.ui.memory.memorybrowser/src/org/eclipse/cdt/debug/ui/memory/memorybrowser/MemoryBrowser.java
@@ -59,7 +59,6 @@ import org.eclipse.debug.ui.memory.IMemoryRenderingType;
import org.eclipse.debug.ui.memory.IRepositionableMemoryRendering;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.MenuManager;
@@ -575,26 +574,18 @@ public class MemoryBrowser extends ViewPart
renderingFinal.goToAddress(newBase);
}
- runOnUIThread(new Runnable() {
- @Override
- public void run() {
- CTabItem selection = activeFolder.getSelection();
- selection.setData(KEY_EXPRESSION, expression);
- selection.setData(KEY_EXPRESSION_ADDRESS, newBase);
- fGotoAddressBar.handleExpressionStatus(Status.OK_STATUS);
- updateLabel(selection, renderingFinal);
- }
+ runOnUIThread(() -> {
+ CTabItem selection = activeFolder.getSelection();
+ selection.setData(KEY_EXPRESSION, expression);
+ selection.setData(KEY_EXPRESSION_ADDRESS, newBase);
+ fGotoAddressBar.handleExpressionStatus(Status.OK_STATUS);
+ updateLabel(selection, renderingFinal);
});
} catch (final DebugException e1) {
// widgets update require Display
- runOnUIThread(new Runnable() {
- @Override
- public void run() {
- fGotoAddressBar.handleExpressionStatus(
- new Status(Status.ERROR, MemoryBrowserPlugin.PLUGIN_ID,
- Messages.getString("MemoryBrowser.FailedToGoToAddressTitle"), e1)); //$NON-NLS-1$
- }
- });
+ runOnUIThread(() -> fGotoAddressBar
+ .handleExpressionStatus(new Status(Status.ERROR, MemoryBrowserPlugin.PLUGIN_ID,
+ Messages.getString("MemoryBrowser.FailedToGoToAddressTitle"), e1)));
}
}
}.start();
@@ -769,12 +760,7 @@ public class MemoryBrowser extends ViewPart
private void hookContextMenu() {
MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$
menuMgr.setRemoveAllWhenShown(true);
- menuMgr.addMenuListener(new IMenuListener() {
- @Override
- public void menuAboutToShow(IMenuManager manager) {
- MemoryBrowser.this.fillContextMenu(manager);
- }
- });
+ menuMgr.addMenuListener(manager -> MemoryBrowser.this.fillContextMenu(manager));
Menu menu = menuMgr.createContextMenu(getControl());
getControl().setMenu(menu);
}
@@ -1097,86 +1083,82 @@ public class MemoryBrowser extends ViewPart
*/
private void updateTab(final IMemoryBlockRetrieval retrieval, final Object context, final String[] memorySpaces) {
// GUI activity must be on the main thread
- runOnUIThread(new Runnable() {
- @Override
- public void run() {
- if (fGotoAddressBarControl.isDisposed() || fGotoMemorySpaceControl.isDisposed()) {
- return;
- }
+ runOnUIThread(() -> {
+ if (fGotoAddressBarControl.isDisposed() || fGotoMemorySpaceControl.isDisposed()) {
+ return;
+ }
- fGotoAddressBarControl.setVisible(true);
+ fGotoAddressBarControl.setVisible(true);
+
+ // If we've already created a tab folder for this retrieval
+ // object, bring it to the forefront. Otherwise create the
+ // folder.
+ CTabFolder tabFolder = fContextFolders.get(retrieval);
+ if (tabFolder != null) {
+ fStackLayout.topControl = tabFolder;
+ CTabItem tabItem = tabFolder.getSelection();
+ if (tabItem != null) {
+ getSite().getSelectionProvider()
+ .setSelection(new StructuredSelection(tabItem.getData(KEY_RENDERING)));
+ }
+ handleTabActivated(tabItem);
+ } else {
+ tabFolder = createTabFolder(fRenderingsComposite);
+ tabFolder.addSelectionListener(new SelectionListener() {
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
- // If we've already created a tab folder for this retrieval
- // object, bring it to the forefront. Otherwise create the
- // folder.
- CTabFolder tabFolder = fContextFolders.get(retrieval);
- if (tabFolder != null) {
- fStackLayout.topControl = tabFolder;
- CTabItem tabItem = tabFolder.getSelection();
- if (tabItem != null) {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ CTabItem tabItem = (CTabItem) e.item;
+ updateMemorySpaceControlSelection(tabItem);
+ fGotoAddressBar.loadSavedExpressions(context,
+ fGotoMemorySpaceControl.isVisible() ? fGotoMemorySpaceControl.getText() : null);
getSite().getSelectionProvider()
.setSelection(new StructuredSelection(tabItem.getData(KEY_RENDERING)));
+ handleTabActivated(tabItem);
}
- handleTabActivated(tabItem);
- } else {
- tabFolder = createTabFolder(fRenderingsComposite);
- tabFolder.addSelectionListener(new SelectionListener() {
- @Override
- public void widgetDefaultSelected(SelectionEvent e) {
- }
+ });
- @Override
- public void widgetSelected(SelectionEvent e) {
- CTabItem tabItem = (CTabItem) e.item;
- updateMemorySpaceControlSelection(tabItem);
- fGotoAddressBar.loadSavedExpressions(context,
- fGotoMemorySpaceControl.isVisible() ? fGotoMemorySpaceControl.getText() : null);
- getSite().getSelectionProvider()
- .setSelection(new StructuredSelection(tabItem.getData(KEY_RENDERING)));
- handleTabActivated(tabItem);
- }
- });
+ tabFolder.setData(KEY_RETRIEVAL, retrieval);
+ fContextFolders.put(retrieval, tabFolder);
+ fStackLayout.topControl = tabFolder;
+ }
+ // update debug context to the new selection
+ tabFolder.setData(KEY_CONTEXT, context);
- tabFolder.setData(KEY_RETRIEVAL, retrieval);
- fContextFolders.put(retrieval, tabFolder);
- fStackLayout.topControl = tabFolder;
- }
- // update debug context to the new selection
- tabFolder.setData(KEY_CONTEXT, context);
+ final CTabFolder activeFolder = tabFolder;
+ if (!activeFolder.equals(tabFolder)) {
+ return;
+ }
- final CTabFolder activeFolder = tabFolder;
- if (!activeFolder.equals(tabFolder)) {
- return;
- }
+ // Don't expose the memory spaces widget if there are none or
+ // only one memory space involved.
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=309032#c50
+ if (memorySpaces.length >= 2) {
+ fGotoMemorySpaceControl.setItems(memorySpaces);
- // Don't expose the memory spaces widget if there are none or
- // only one memory space involved.
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=309032#c50
- if (memorySpaces.length >= 2) {
- fGotoMemorySpaceControl.setItems(memorySpaces);
-
- // Add the '----' (N/A) entry unless the retrieval object
- // says it requires a memory space ID in all cases
- boolean addNA = true;
- if (retrieval instanceof IMemorySpaceAwareMemoryBlockRetrieval) {
- addNA = !((IMemorySpaceAwareMemoryBlockRetrieval) retrieval)
- .creatingBlockRequiresMemorySpaceID();
- }
- if (addNA) {
- fGotoMemorySpaceControl.add(NA_MEMORY_SPACE_ID, 0);
- }
- setMemorySpaceControlVisible(true);
- } else {
- fGotoMemorySpaceControl.setItems(new String[0]);
- setMemorySpaceControlVisible(false);
+ // Add the '----' (N/A) entry unless the retrieval object
+ // says it requires a memory space ID in all cases
+ boolean addNA = true;
+ if (retrieval instanceof IMemorySpaceAwareMemoryBlockRetrieval) {
+ addNA = !((IMemorySpaceAwareMemoryBlockRetrieval) retrieval).creatingBlockRequiresMemorySpaceID();
}
+ if (addNA) {
+ fGotoMemorySpaceControl.add(NA_MEMORY_SPACE_ID, 0);
+ }
+ setMemorySpaceControlVisible(true);
+ } else {
+ fGotoMemorySpaceControl.setItems(new String[0]);
+ setMemorySpaceControlVisible(false);
+ }
- updateMemorySpaceControlSelection(activeFolder.getSelection());
- fGotoAddressBar.loadSavedExpressions(context,
- fGotoMemorySpaceControl.isVisible() ? fGotoMemorySpaceControl.getText() : null);
+ updateMemorySpaceControlSelection(activeFolder.getSelection());
+ fGotoAddressBar.loadSavedExpressions(context,
+ fGotoMemorySpaceControl.isVisible() ? fGotoMemorySpaceControl.getText() : null);
- fStackLayout.topControl.getParent().layout(true);
- }
+ fStackLayout.topControl.getParent().layout(true);
});
}
@@ -1337,18 +1319,15 @@ public class MemoryBrowser extends ViewPart
private void releaseTabFolder(final IMemoryBlockRetrieval retrieval) {
final CTabFolder folder = fContextFolders.get(retrieval);
if (folder != null) {
- Runnable run = new Runnable() {
- @Override
- public void run() {
- for (CTabItem tab : folder.getItems()) {
- disposeTab(tab);
- }
- fContextFolders.remove(retrieval);
- folder.dispose();
+ Runnable run = () -> {
+ for (CTabItem tab : folder.getItems()) {
+ disposeTab(tab);
+ }
+ fContextFolders.remove(retrieval);
+ folder.dispose();
- if (fStackLayout.topControl.equals(folder)) {
- handleUnsupportedSelection();
- }
+ if (fStackLayout.topControl.equals(folder)) {
+ handleUnsupportedSelection();
}
};
runOnUIThread(run);
diff --git a/memory/org.eclipse.cdt.debug.ui.memory.search/src/org/eclipse/cdt/debug/ui/memory/search/FindReplaceDialog.java b/memory/org.eclipse.cdt.debug.ui.memory.search/src/org/eclipse/cdt/debug/ui/memory/search/FindReplaceDialog.java
index 6d160e5c31..ebbbb0f906 100644
--- a/memory/org.eclipse.cdt.debug.ui.memory.search/src/org/eclipse/cdt/debug/ui/memory/search/FindReplaceDialog.java
+++ b/memory/org.eclipse.cdt.debug.ui.memory.search/src/org/eclipse/cdt/debug/ui/memory/search/FindReplaceDialog.java
@@ -40,8 +40,6 @@ import org.eclipse.search.ui.ISearchQuery;
import org.eclipse.search.ui.ISearchResult;
import org.eclipse.search.ui.NewSearchUI;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.FormAttachment;
@@ -729,52 +727,34 @@ public class FindReplaceDialog extends SelectionDialog {
fFormatDecimalButton.addSelectionListener(nonAsciiListener);
fFormatByteSequenceButton.addSelectionListener(nonAsciiListener);
- fStartText.addModifyListener(new ModifyListener() {
- @Override
- public void modifyText(ModifyEvent e) {
- boolean valid = true;
- try {
- getStartAddress();
- } catch (Exception ex) {
- valid = false;
- }
-
- fStartText.setForeground(valid ? Display.getDefault().getSystemColor(SWT.COLOR_BLACK)
- : Display.getDefault().getSystemColor(SWT.COLOR_RED));
-
- validate();
+ fStartText.addModifyListener(e -> {
+ boolean valid = true;
+ try {
+ getStartAddress();
+ } catch (Exception ex) {
+ valid = false;
}
- });
+ fStartText.setForeground(valid ? Display.getDefault().getSystemColor(SWT.COLOR_BLACK)
+ : Display.getDefault().getSystemColor(SWT.COLOR_RED));
- fEndText.addModifyListener(new ModifyListener() {
- @Override
- public void modifyText(ModifyEvent e) {
- try {
- getEndAddress();
- fEndText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
- } catch (Exception ex) {
- fEndText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
- }
+ validate();
+ });
- validate();
+ fEndText.addModifyListener(e -> {
+ try {
+ getEndAddress();
+ fEndText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
+ } catch (Exception ex) {
+ fEndText.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
}
+ validate();
});
- fFindText.addModifyListener(new ModifyListener() {
- @Override
- public void modifyText(ModifyEvent e) {
- validate();
- }
- });
+ fFindText.addModifyListener(e -> validate());
- fReplaceText.addModifyListener(new ModifyListener() {
- @Override
- public void modifyText(ModifyEvent e) {
- validate();
- }
- });
+ fReplaceText.addModifyListener(e -> validate());
composite.setTabList(
new Control[] { fFindText, fReplaceText, directionGroup, rangeGroup, formatGroup, optionsGroup, });
@@ -1137,40 +1117,35 @@ public class FindReplaceDialog extends SelectionDialog {
final BigInteger finalCurrentPosition = currentPosition;
final BigInteger finalStart = start;
final BigInteger finalEnd = end;
- Display.getDefault().asyncExec(new Runnable() {
-
- @Override
- public void run() {
- IMemoryRenderingContainer containers[] = getMemoryView()
- .getMemoryRenderingContainers();
- for (int i = 0; i < containers.length; i++) {
- IMemoryRendering rendering = containers[i].getActiveRendering();
- if (rendering instanceof IRepositionableMemoryRendering) {
- try {
- ((IRepositionableMemoryRendering) rendering)
- .goToAddress(finalCurrentPosition);
- } catch (DebugException e) {
- MemorySearchPlugin.logError(
- Messages.getString(
- "FindReplaceDialog.RepositioningMemoryViewFailed"), //$NON-NLS-1$
- e);
- }
+ Display.getDefault().asyncExec(() -> {
+ IMemoryRenderingContainer containers[] = getMemoryView()
+ .getMemoryRenderingContainers();
+ for (int i = 0; i < containers.length; i++) {
+ IMemoryRendering rendering = containers[i].getActiveRendering();
+ if (rendering instanceof IRepositionableMemoryRendering) {
+ try {
+ ((IRepositionableMemoryRendering) rendering)
+ .goToAddress(finalCurrentPosition);
+ } catch (DebugException e1) {
+ MemorySearchPlugin.logError(
+ Messages.getString(
+ "FindReplaceDialog.RepositioningMemoryViewFailed"), //$NON-NLS-1$
+ e1);
}
- if (rendering != null) {
- // Temporary, until platform accepts/adds new interface for setting the selection
- try {
- Method m = rendering.getClass().getMethod("setSelection", //$NON-NLS-1$
- new Class[] { BigInteger.class, BigInteger.class });
- if (m != null)
- m.invoke(rendering, finalCurrentPosition,
- finalCurrentPosition.add(searchPhraseLength));
- } catch (Exception e) {
- // do nothing
- }
+ }
+ if (rendering != null) {
+ // Temporary, until platform accepts/adds new interface for setting the selection
+ try {
+ Method m = rendering.getClass().getMethod("setSelection", //$NON-NLS-1$
+ new Class[] { BigInteger.class, BigInteger.class });
+ if (m != null)
+ m.invoke(rendering, finalCurrentPosition,
+ finalCurrentPosition.add(searchPhraseLength));
+ } catch (Exception e2) {
+ // do nothing
}
}
}
-
});
fProperties.setProperty(SEARCH_ENABLE_FIND_NEXT, Boolean.TRUE.toString());
@@ -1222,12 +1197,9 @@ public class FindReplaceDialog extends SelectionDialog {
};
if (all && replaceData == null) {
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- NewSearchUI.activateSearchResultView();
- NewSearchUI.runQueryInBackground(query);
- }
+ Display.getDefault().asyncExec(() -> {
+ NewSearchUI.activateSearchResultView();
+ NewSearchUI.runQueryInBackground(query);
});
} else {
Job job = new Job("Searching memory for " + searchPhrase) { //$NON-NLS-1$
diff --git a/memory/org.eclipse.cdt.debug.ui.memory.search/src/org/eclipse/cdt/debug/ui/memory/search/MemorySearchResultsPage.java b/memory/org.eclipse.cdt.debug.ui.memory.search/src/org/eclipse/cdt/debug/ui/memory/search/MemorySearchResultsPage.java
index 4dd16d83a3..ad73dc2559 100644
--- a/memory/org.eclipse.cdt.debug.ui.memory.search/src/org/eclipse/cdt/debug/ui/memory/search/MemorySearchResultsPage.java
+++ b/memory/org.eclipse.cdt.debug.ui.memory.search/src/org/eclipse/cdt/debug/ui/memory/search/MemorySearchResultsPage.java
@@ -111,12 +111,7 @@ public class MemorySearchResultsPage extends Page implements ISearchResultPage,
((MemorySearchResult) search).addListener(new ISearchResultListener() {
@Override
public void searchResultChanged(SearchResultEvent e) {
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- fTreeViewer.refresh();
- }
- });
+ Display.getDefault().asyncExec(() -> fTreeViewer.refresh());
}
});
}
diff --git a/memory/org.eclipse.cdt.debug.ui.memory.traditional/META-INF/MANIFEST.MF b/memory/org.eclipse.cdt.debug.ui.memory.traditional/META-INF/MANIFEST.MF
index 4b360aef0c..dd1632d6c7 100644
--- a/memory/org.eclipse.cdt.debug.ui.memory.traditional/META-INF/MANIFEST.MF
+++ b/memory/org.eclipse.cdt.debug.ui.memory.traditional/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.debug.ui.memory.traditional;singleton:=true
-Bundle-Version: 1.5.1.qualifier
+Bundle-Version: 1.5.100.qualifier
Bundle-Localization: plugin
Require-Bundle: org.eclipse.debug.core,
org.eclipse.debug.ui,
diff --git a/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/Rendering.java b/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/Rendering.java
index 4b897352d7..146f2efaef 100755
--- a/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/Rendering.java
+++ b/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/Rendering.java
@@ -54,8 +54,6 @@ import org.eclipse.swt.events.ControlEvent;
import org.eclipse.swt.events.ControlListener;
import org.eclipse.swt.events.KeyAdapter;
import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
@@ -265,12 +263,9 @@ public class Rendering extends Composite implements IDebugEventSetListener {
getVerticalBar().addSelectionListener(createVerticalBarSelectinListener());
- this.addPaintListener(new PaintListener() {
- @Override
- public void paintControl(PaintEvent pe) {
- pe.gc.setBackground(Rendering.this.getTraditionalRendering().getColorBackground());
- pe.gc.fillRectangle(0, 0, Rendering.this.getBounds().width, Rendering.this.getBounds().height);
- }
+ this.addPaintListener(pe -> {
+ pe.gc.setBackground(Rendering.this.getTraditionalRendering().getColorBackground());
+ pe.gc.fillRectangle(0, 0, Rendering.this.getBounds().width, Rendering.this.getBounds().height);
});
setLayout();
@@ -569,24 +564,18 @@ public class Rendering extends Composite implements IDebugEventSetListener {
protected void handleSuspend(boolean isBreakpointHit) {
if (getUpdateMode() == UPDATE_ALWAYS || (getUpdateMode() == UPDATE_ON_BREAKPOINT && isBreakpointHit)) {
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- archiveDeltas();
- refresh();
- }
+ Display.getDefault().asyncExec(() -> {
+ archiveDeltas();
+ refresh();
});
}
}
protected void handleChange() {
if (getUpdateMode() == UPDATE_ALWAYS) {
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- archiveDeltas();
- refresh();
- }
+ Display.getDefault().asyncExec(() -> {
+ archiveDeltas();
+ refresh();
});
}
}
@@ -861,43 +850,40 @@ public class Rendering extends Composite implements IDebugEventSetListener {
fCache.end = endAddress;
fCache.bytes = cachedBytesFinal;
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- // generate deltas
- for (int historyIndex = 0; historyIndex < getHistoryDepth(); historyIndex++) {
- if (fHistoryCache[historyIndex] != null && fHistoryCache[historyIndex].isValid()) {
- BigInteger maxStart = startAddress.max(fHistoryCache[historyIndex].start);
- BigInteger minEnd = endAddress.min(fHistoryCache[historyIndex].end)
- .subtract(BigInteger.valueOf(1));
-
- BigInteger overlapLength = minEnd.subtract(maxStart).multiply(addressableSize);
- if (overlapLength.compareTo(BigInteger.valueOf(0)) > 0) {
- // there is overlap
-
- int offsetIntoOld = (maxStart.subtract(fHistoryCache[historyIndex].start)
- .multiply(addressableSize)).intValue();
- int offsetIntoNew = maxStart.subtract(startAddress).multiply(addressableSize)
- .intValue();
-
- for (int i = overlapLength.intValue(); i >= 0; i--) {
- cachedBytesFinal[offsetIntoNew + i].setChanged(historyIndex,
- cachedBytesFinal[offsetIntoNew + i]
- .getValue() != fHistoryCache[historyIndex].bytes[offsetIntoOld
- + i].getValue());
- }
+ Display.getDefault().asyncExec(() -> {
+ // generate deltas
+ for (int historyIndex = 0; historyIndex < getHistoryDepth(); historyIndex++) {
+ if (fHistoryCache[historyIndex] != null && fHistoryCache[historyIndex].isValid()) {
+ BigInteger maxStart = startAddress.max(fHistoryCache[historyIndex].start);
+ BigInteger minEnd = endAddress.min(fHistoryCache[historyIndex].end)
+ .subtract(BigInteger.valueOf(1));
+
+ BigInteger overlapLength = minEnd.subtract(maxStart).multiply(addressableSize);
+ if (overlapLength.compareTo(BigInteger.valueOf(0)) > 0) {
+ // there is overlap
+
+ int offsetIntoOld = (maxStart.subtract(fHistoryCache[historyIndex].start)
+ .multiply(addressableSize)).intValue();
+ int offsetIntoNew = maxStart.subtract(startAddress).multiply(addressableSize)
+ .intValue();
+
+ for (int i = overlapLength.intValue(); i >= 0; i--) {
+ cachedBytesFinal[offsetIntoNew + i].setChanged(historyIndex,
+ cachedBytesFinal[offsetIntoNew + i]
+ .getValue() != fHistoryCache[historyIndex].bytes[offsetIntoOld + i]
+ .getValue());
}
}
}
+ }
- // If the history does not exist, populate the history with the just populated cache. This solves the
- // use case of 1) connect to target; 2) edit memory before the first suspend debug event; 3) paint
- // differences in changed color.
- if (fHistoryCache[0] == null)
- fHistoryCache[0] = fCache.clone();
+ // If the history does not exist, populate the history with the just populated cache. This solves the
+ // use case of 1) connect to target; 2) edit memory before the first suspend debug event; 3) paint
+ // differences in changed color.
+ if (fHistoryCache[0] == null)
+ fHistoryCache[0] = fCache.clone();
- Rendering.this.redrawPanes();
- }
+ Rendering.this.redrawPanes();
});
} catch (Exception e) {
@@ -1623,12 +1609,9 @@ public class Rendering extends Composite implements IDebugEventSetListener {
fParent.setTargetMemoryLittleEndian(littleEndian);
fIsTargetLittleEndian = littleEndian;
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- fireSettingsChanged();
- layoutPanes();
- }
+ Display.getDefault().asyncExec(() -> {
+ fireSettingsChanged();
+ layoutPanes();
});
}
@@ -1643,14 +1626,11 @@ public class Rendering extends Composite implements IDebugEventSetListener {
fIsDisplayLittleEndian = littleEndian;
fireSettingsChanged();
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- if (isShowCrossReferenceInfo()) {
- resolveAddressInfoForCurrentSelection();
- }
- layoutPanes();
+ Display.getDefault().asyncExec(() -> {
+ if (isShowCrossReferenceInfo()) {
+ resolveAddressInfoForCurrentSelection();
}
+ layoutPanes();
});
}
diff --git a/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/RenderingAddressInfo.java b/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/RenderingAddressInfo.java
index ad02d424f9..dc708d0364 100644
--- a/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/RenderingAddressInfo.java
+++ b/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/RenderingAddressInfo.java
@@ -248,26 +248,23 @@ public class RenderingAddressInfo extends Rendering implements IDebugContextList
final String[] types = getAddressInfoItemTypes();
if (!display.isDisposed()) {
- display.asyncExec(new Runnable() {
- @Override
- public void run() {
- for (String type : types) {
- if (!fAddressInfoTypeStatusMap.containsKey(type)) {
- fAddressInfoTypeStatusMap.put(type, Boolean.TRUE);
- }
+ display.asyncExec(() -> {
+ for (String type : types) {
+ if (!fAddressInfoTypeStatusMap.containsKey(type)) {
+ fAddressInfoTypeStatusMap.put(type, Boolean.TRUE);
}
+ }
- // The selection has changed, so our Address information may no longer be valid
- fAddressInfoItems = addressInfoItems;
- fMapStartAddrToInfoItems.clear();
- fMapAddrToInfoItems.clear();
-
- if (fBinaryPane.isVisible()) {
- redrawPanes();
- }
+ // The selection has changed, so our Address information may no longer be valid
+ fAddressInfoItems = addressInfoItems;
+ fMapStartAddrToInfoItems.clear();
+ fMapAddrToInfoItems.clear();
- refreshUpdateListener(addrInfo);
+ if (fBinaryPane.isVisible()) {
+ redrawPanes();
}
+
+ refreshUpdateListener(addrInfo);
});
}
}
diff --git a/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/TraditionalRendering.java b/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/TraditionalRendering.java
index d12933f93e..61b00a0947 100644
--- a/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/TraditionalRendering.java
+++ b/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/TraditionalRendering.java
@@ -56,17 +56,13 @@ import org.eclipse.debug.ui.memory.IRepositionableMemoryRendering;
import org.eclipse.debug.ui.memory.IResettableMemoryRendering;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.dialogs.IInputValidator;
import org.eclipse.jface.dialogs.InputDialog;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferenceConverter;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.IBasicPropertyConstants;
import org.eclipse.jface.window.Window;
@@ -139,50 +135,37 @@ public class TraditionalRendering extends AbstractMemoryRendering implements IRe
public TraditionalRendering(String id) {
super(id);
- JFaceResources.getFontRegistry().addListener(new IPropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent event) {
- if (event.getProperty().equals(IInternalDebugUIConstants.FONT_NAME)) {
- TraditionalRendering.this.fRendering
- .handleFontPreferenceChange(JFaceResources.getFont(IInternalDebugUIConstants.FONT_NAME));
- }
+ JFaceResources.getFontRegistry().addListener(event -> {
+ if (event.getProperty().equals(IInternalDebugUIConstants.FONT_NAME)) {
+ TraditionalRendering.this.fRendering
+ .handleFontPreferenceChange(JFaceResources.getFont(IInternalDebugUIConstants.FONT_NAME));
}
});
- this.addPropertyChangeListener(new IPropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent event) {
- IMemoryRendering sourceRendering = (IMemoryRendering) event.getSource();
- if (!sourceRendering.getMemoryBlock().equals(getMemoryBlock()))
- return;
+ this.addPropertyChangeListener(event -> {
+ IMemoryRendering sourceRendering = (IMemoryRendering) event.getSource();
+ if (!sourceRendering.getMemoryBlock().equals(getMemoryBlock()))
+ return;
- Object address = event.getNewValue();
+ Object address = event.getNewValue();
- if (event.getProperty().equals(AbstractTableRendering.PROPERTY_SELECTED_ADDRESS)
- && address instanceof BigInteger) {
- TraditionalRendering.this.fRendering.ensureVisible((BigInteger) address);
- }
+ if (event.getProperty().equals(AbstractTableRendering.PROPERTY_SELECTED_ADDRESS)
+ && address instanceof BigInteger) {
+ TraditionalRendering.this.fRendering.ensureVisible((BigInteger) address);
}
});
- TraditionalRenderingPlugin.getDefault().getPreferenceStore()
- .addPropertyChangeListener(new IPropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent event) {
- disposeColors();
- allocateColors();
- applyPreferences();
- }
- });
+ TraditionalRenderingPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(event -> {
+ disposeColors();
+ allocateColors();
+ applyPreferences();
+ });
- DebugUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(new IPropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent event) {
- if (event.getProperty().equals(IDebugUIConstants.PREF_PADDED_STR)) {
- if (TraditionalRendering.this.fRendering != null) {
- setRenderingPadding((String) event.getNewValue());
- TraditionalRendering.this.fRendering.redrawPanes();
- }
+ DebugUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(event -> {
+ if (event.getProperty().equals(IDebugUIConstants.PREF_PADDED_STR)) {
+ if (TraditionalRendering.this.fRendering != null) {
+ setRenderingPadding((String) event.getNewValue());
+ TraditionalRendering.this.fRendering.redrawPanes();
}
}
});
@@ -240,13 +223,10 @@ public class TraditionalRendering extends AbstractMemoryRendering implements IRe
* We use the UI dispatch thread to protect the proxy information. Even though I believe the
* dispose routine is always called in the UI dispatch thread. I am going to make sure.
*/
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- if (fModel != null) {
- fModel.removeModelChangedListener(TraditionalRendering.this);
- fModel.dispose();
- }
+ Display.getDefault().asyncExec(() -> {
+ if (fModel != null) {
+ fModel.removeModelChangedListener(TraditionalRendering.this);
+ fModel.dispose();
}
});
@@ -278,12 +258,7 @@ public class TraditionalRendering extends AbstractMemoryRendering implements IRe
public void done() {
final String[] spaces = isSuccess() ? getMemorySpaces() : new String[0];
// remember memory spaces
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- fMemSpacePreferenceHelper.updateMemorySpaces(spaces);
- }
- });
+ Display.getDefault().asyncExec(() -> fMemSpacePreferenceHelper.updateMemorySpaces(spaces));
}
});
}
@@ -293,29 +268,26 @@ public class TraditionalRendering extends AbstractMemoryRendering implements IRe
*/
final IModelProxyFactory factory = (IModelProxyFactory) DebugPlugin.getAdapter(block, IModelProxyFactory.class);
if (factory != null) {
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
-
- /*
- * The asynchronous model assumes we have an asynchronous viewer that has an IPresentationContext
- * to represent it. The Platform memory subsystem provides a way to create one without a viewewr.
- */
- IMemoryRenderingSite site = container.getMemoryRenderingSite();
- MemoryViewPresentationContext context = new MemoryViewPresentationContext(site, container,
- TraditionalRendering.this);
-
- /*
- * Get a new proxy and perform the initialization sequence so we are known the
- * the model provider.
- */
- fModel = factory.createModelProxy(block, context);
- if (fModel != null) {
- fModel.installed(null);
- fModel.addModelChangedListener(TraditionalRendering.this);
- }
-
+ Display.getDefault().asyncExec(() -> {
+
+ /*
+ * The asynchronous model assumes we have an asynchronous viewer that has an IPresentationContext
+ * to represent it. The Platform memory subsystem provides a way to create one without a viewewr.
+ */
+ IMemoryRenderingSite site = container.getMemoryRenderingSite();
+ MemoryViewPresentationContext context = new MemoryViewPresentationContext(site, container,
+ TraditionalRendering.this);
+
+ /*
+ * Get a new proxy and perform the initialization sequence so we are known the
+ * the model provider.
+ */
+ fModel = factory.createModelProxy(block, context);
+ if (fModel != null) {
+ fModel.installed(null);
+ fModel.addModelChangedListener(TraditionalRendering.this);
}
+
});
}
@@ -746,13 +718,8 @@ public class TraditionalRendering extends AbstractMemoryRendering implements IRe
{
@Override
public void run() {
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- TraditionalRendering.this.fRendering
- .gotoAddress(TraditionalRendering.this.fRendering.fBaseAddress);
- }
- });
+ Display.getDefault().asyncExec(() -> TraditionalRendering.this.fRendering
+ .gotoAddress(TraditionalRendering.this.fRendering.fBaseAddress));
}
};
@@ -762,20 +729,17 @@ public class TraditionalRendering extends AbstractMemoryRendering implements IRe
{
@Override
public void run() {
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- // For compatibility with DSF update modes (hopefully this will either be replaced by an enhanced
- // platform interface or the caching will move out of the data layer
- try {
- Method m = fRendering.getMemoryBlock().getClass().getMethod("clearCache", new Class[0]); //$NON-NLS-1$
- if (m != null)
- m.invoke(fRendering.getMemoryBlock(), new Object[0]);
- } catch (Exception e) {
- }
-
- TraditionalRendering.this.fRendering.refresh();
+ Display.getDefault().asyncExec(() -> {
+ // For compatibility with DSF update modes (hopefully this will either be replaced by an enhanced
+ // platform interface or the caching will move out of the data layer
+ try {
+ Method m = fRendering.getMemoryBlock().getClass().getMethod("clearCache", new Class[0]); //$NON-NLS-1$
+ if (m != null)
+ m.invoke(fRendering.getMemoryBlock(), new Object[0]);
+ } catch (Exception e) {
}
+
+ TraditionalRendering.this.fRendering.refresh();
});
}
};
@@ -1015,21 +979,18 @@ public class TraditionalRendering extends AbstractMemoryRendering implements IRe
InputDialog inputDialog = new InputDialog(fRendering.getShell(), "Set Column Count", //$NON-NLS-1$
"Please enter column count", //$NON-NLS-1$
"", //$NON-NLS-1$
- new IInputValidator() {
- @Override
- public String isValid(String input) {
- try {
- int i = Integer.parseInt(input);
- if (i <= 0)
- return "Please enter a positive integer"; //$NON-NLS-1$
- if (i > 200)
- return "Please enter a positive integer not greater than 200"; //$NON-NLS-1$
-
- } catch (NumberFormatException x) {
+ input -> {
+ try {
+ int i = Integer.parseInt(input);
+ if (i <= 0)
return "Please enter a positive integer"; //$NON-NLS-1$
- }
- return null;
+ if (i > 200)
+ return "Please enter a positive integer not greater than 200"; //$NON-NLS-1$
+
+ } catch (NumberFormatException x) {
+ return "Please enter a positive integer"; //$NON-NLS-1$
}
+ return null;
});
if (inputDialog.open() != Window.OK) {
@@ -1081,133 +1042,130 @@ public class TraditionalRendering extends AbstractMemoryRendering implements IRe
}
};
- getPopupMenuManager().addMenuListener(new IMenuListener() {
- @Override
- public void menuAboutToShow(IMenuManager manager) {
- manager.add(new Separator());
-
- MenuManager sub = new MenuManager(TraditionalRenderingMessages.getString("TraditionalRendering.PANES")); //$NON-NLS-1$
- sub.add(displayAddressPaneAction);
- sub.add(displayBinaryPaneAction);
- sub.add(displayTextPaneAction);
- manager.add(sub);
-
- // if there is cross reference info types available
- // add Actions to allow the user to toggle the visibility for each of them
- if (fRendering.isShowCrossReferenceInfo()) {
- Action[] dynamicActions = fRendering.getDynamicActions();
- if (dynamicActions != null) {
- sub = new MenuManager(TraditionalRenderingMessages
- .getString("TraditionalRenderingPreferencePage_ShowCrossRefInfo_Label")); //$NON-NLS-1$
- for (Action action : dynamicActions) {
- sub.add(action);
- }
-
- manager.add(sub);
+ getPopupMenuManager().addMenuListener(manager -> {
+ manager.add(new Separator());
+
+ MenuManager sub = new MenuManager(TraditionalRenderingMessages.getString("TraditionalRendering.PANES")); //$NON-NLS-1$
+ sub.add(displayAddressPaneAction);
+ sub.add(displayBinaryPaneAction);
+ sub.add(displayTextPaneAction);
+ manager.add(sub);
+
+ // if there is cross reference info types available
+ // add Actions to allow the user to toggle the visibility for each of them
+ if (fRendering.isShowCrossReferenceInfo()) {
+ Action[] dynamicActions = fRendering.getDynamicActions();
+ if (dynamicActions != null) {
+ sub = new MenuManager(TraditionalRenderingMessages
+ .getString("TraditionalRenderingPreferencePage_ShowCrossRefInfo_Label")); //$NON-NLS-1$
+ for (Action action : dynamicActions) {
+ sub.add(action);
}
+
+ manager.add(sub);
}
+ }
- sub = new MenuManager(TraditionalRenderingMessages.getString("TraditionalRendering.ENDIAN")); //$NON-NLS-1$
- sub.add(displayEndianBigAction);
- sub.add(displayEndianLittleAction);
- manager.add(sub);
-
- sub = new MenuManager(TraditionalRenderingMessages.getString("TraditionalRendering.TEXT")); //$NON-NLS-1$
- sub.add(displayCharactersISO8859Action);
- sub.add(displayCharactersUSASCIIAction);
- sub.add(displayCharactersUTF8Action);
- //sub.add(displayCharactersUTF16Action);
- manager.add(sub);
-
- sub = new MenuManager(TraditionalRenderingMessages.getString("TraditionalRendering.CELL_SIZE")); //$NON-NLS-1$
- sub.add(displaySize1BytesAction);
- sub.add(displaySize2BytesAction);
- sub.add(displaySize4BytesAction);
- sub.add(displaySize8BytesAction);
- manager.add(sub);
-
- sub = new MenuManager(TraditionalRenderingMessages.getString("TraditionalRendering.RADIX")); //$NON-NLS-1$
- sub.add(displayRadixHexAction);
- sub.add(displayRadixDecSignedAction);
- sub.add(displayRadixDecUnsignedAction);
- sub.add(displayRadixOctAction);
- sub.add(displayRadixBinAction);
- manager.add(sub);
-
- sub = new MenuManager(TraditionalRenderingMessages.getString("TraditionalRendering.COLUMN_COUNT")); //$NON-NLS-1$
- sub.add(displayColumnCountAuto);
- for (int i = 0; i < displayColumnCounts.length; i++)
- sub.add(displayColumnCounts[i]);
-
- boolean currentCountIsCustom = fRendering.getColumnsSetting() != 0;
- for (int i = 0, j = 1; i < MAX_MENU_COLUMN_COUNT && currentCountIsCustom; i++, j *= 2)
- currentCountIsCustom = (j != fRendering.getColumnsSetting());
- if (currentCountIsCustom)
- sub.add(displayColumnCountCustomValue);
-
- sub.add(displayColumnCountCustom);
- manager.add(sub);
-
- final Action updateAlwaysAction = new Action(
- TraditionalRenderingMessages.getString("TraditionalRendering.UPDATE_ALWAYS"), //$NON-NLS-1$
- IAction.AS_RADIO_BUTTON) {
- @Override
- public void run() {
- fRendering.setUpdateMode(Rendering.UPDATE_ALWAYS);
- }
- };
- updateAlwaysAction.setChecked(fRendering.getUpdateMode() == Rendering.UPDATE_ALWAYS);
+ sub = new MenuManager(TraditionalRenderingMessages.getString("TraditionalRendering.ENDIAN")); //$NON-NLS-1$
+ sub.add(displayEndianBigAction);
+ sub.add(displayEndianLittleAction);
+ manager.add(sub);
+
+ sub = new MenuManager(TraditionalRenderingMessages.getString("TraditionalRendering.TEXT")); //$NON-NLS-1$
+ sub.add(displayCharactersISO8859Action);
+ sub.add(displayCharactersUSASCIIAction);
+ sub.add(displayCharactersUTF8Action);
+ //sub.add(displayCharactersUTF16Action);
+ manager.add(sub);
+
+ sub = new MenuManager(TraditionalRenderingMessages.getString("TraditionalRendering.CELL_SIZE")); //$NON-NLS-1$
+ sub.add(displaySize1BytesAction);
+ sub.add(displaySize2BytesAction);
+ sub.add(displaySize4BytesAction);
+ sub.add(displaySize8BytesAction);
+ manager.add(sub);
+
+ sub = new MenuManager(TraditionalRenderingMessages.getString("TraditionalRendering.RADIX")); //$NON-NLS-1$
+ sub.add(displayRadixHexAction);
+ sub.add(displayRadixDecSignedAction);
+ sub.add(displayRadixDecUnsignedAction);
+ sub.add(displayRadixOctAction);
+ sub.add(displayRadixBinAction);
+ manager.add(sub);
+
+ sub = new MenuManager(TraditionalRenderingMessages.getString("TraditionalRendering.COLUMN_COUNT")); //$NON-NLS-1$
+ sub.add(displayColumnCountAuto);
+ for (int i = 0; i < displayColumnCounts.length; i++)
+ sub.add(displayColumnCounts[i]);
+
+ boolean currentCountIsCustom = fRendering.getColumnsSetting() != 0;
+ for (int i = 0, j = 1; i < MAX_MENU_COLUMN_COUNT && currentCountIsCustom; i++, j *= 2)
+ currentCountIsCustom = (j != fRendering.getColumnsSetting());
+ if (currentCountIsCustom)
+ sub.add(displayColumnCountCustomValue);
+
+ sub.add(displayColumnCountCustom);
+ manager.add(sub);
+
+ final Action updateAlwaysAction = new Action(
+ TraditionalRenderingMessages.getString("TraditionalRendering.UPDATE_ALWAYS"), //$NON-NLS-1$
+ IAction.AS_RADIO_BUTTON) {
+ @Override
+ public void run() {
+ fRendering.setUpdateMode(Rendering.UPDATE_ALWAYS);
+ }
+ };
+ updateAlwaysAction.setChecked(fRendering.getUpdateMode() == Rendering.UPDATE_ALWAYS);
- final Action updateOnBreakpointAction = new Action(
- TraditionalRenderingMessages.getString("TraditionalRendering.UPDATE_ON_BREAKPOINT"), //$NON-NLS-1$
- IAction.AS_RADIO_BUTTON) {
- @Override
- public void run() {
- fRendering.setUpdateMode(Rendering.UPDATE_ON_BREAKPOINT);
- }
- };
- updateOnBreakpointAction.setChecked(fRendering.getUpdateMode() == Rendering.UPDATE_ON_BREAKPOINT);
+ final Action updateOnBreakpointAction = new Action(
+ TraditionalRenderingMessages.getString("TraditionalRendering.UPDATE_ON_BREAKPOINT"), //$NON-NLS-1$
+ IAction.AS_RADIO_BUTTON) {
+ @Override
+ public void run() {
+ fRendering.setUpdateMode(Rendering.UPDATE_ON_BREAKPOINT);
+ }
+ };
+ updateOnBreakpointAction.setChecked(fRendering.getUpdateMode() == Rendering.UPDATE_ON_BREAKPOINT);
- final Action updateManualAction = new Action(
- TraditionalRenderingMessages.getString("TraditionalRendering.UPDATE_MANUAL"), //$NON-NLS-1$
- IAction.AS_RADIO_BUTTON) {
- @Override
- public void run() {
- fRendering.setUpdateMode(Rendering.UPDATE_MANUAL);
- }
- };
- updateManualAction.setChecked(fRendering.getUpdateMode() == Rendering.UPDATE_MANUAL);
-
- sub = new MenuManager(TraditionalRenderingMessages.getString("TraditionalRendering.UPDATEMODE")); //$NON-NLS-1$
- sub.add(updateAlwaysAction);
- sub.add(updateOnBreakpointAction);
- sub.add(updateManualAction);
- manager.add(sub);
- manager.add(new Separator());
-
- BigInteger start = fRendering.getSelection().getStart();
- BigInteger end = fRendering.getSelection().getEnd();
- copyBinaryAction.setEnabled(start != null && end != null);
- copyTextAction.setEnabled(start != null && end != null);
-
- sub = new MenuManager(TraditionalRenderingMessages.getString("TraditionalRendering.COPY")); //$NON-NLS-1$
- sub.add(copyBinaryAction);
- sub.add(copyTextAction);
- sub.add(copyAddressAction);
- sub.add(copyAllAction);
- manager.add(sub);
-
- copyBinaryAction.checkStatus();
- copyTextAction.checkStatus();
- copyAddressAction.checkStatus();
- copyAllAction.checkStatus();
-
- manager.add(gotoBaseAddressAction);
- manager.add(goToAddressAction);
- manager.add(refreshAction);
- manager.add(new Separator());
- manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
- }
+ final Action updateManualAction = new Action(
+ TraditionalRenderingMessages.getString("TraditionalRendering.UPDATE_MANUAL"), //$NON-NLS-1$
+ IAction.AS_RADIO_BUTTON) {
+ @Override
+ public void run() {
+ fRendering.setUpdateMode(Rendering.UPDATE_MANUAL);
+ }
+ };
+ updateManualAction.setChecked(fRendering.getUpdateMode() == Rendering.UPDATE_MANUAL);
+
+ sub = new MenuManager(TraditionalRenderingMessages.getString("TraditionalRendering.UPDATEMODE")); //$NON-NLS-1$
+ sub.add(updateAlwaysAction);
+ sub.add(updateOnBreakpointAction);
+ sub.add(updateManualAction);
+ manager.add(sub);
+ manager.add(new Separator());
+
+ BigInteger start = fRendering.getSelection().getStart();
+ BigInteger end = fRendering.getSelection().getEnd();
+ copyBinaryAction.setEnabled(start != null && end != null);
+ copyTextAction.setEnabled(start != null && end != null);
+
+ sub = new MenuManager(TraditionalRenderingMessages.getString("TraditionalRendering.COPY")); //$NON-NLS-1$
+ sub.add(copyBinaryAction);
+ sub.add(copyTextAction);
+ sub.add(copyAddressAction);
+ sub.add(copyAllAction);
+ manager.add(sub);
+
+ copyBinaryAction.checkStatus();
+ copyTextAction.checkStatus();
+ copyAddressAction.checkStatus();
+ copyAllAction.checkStatus();
+
+ manager.add(gotoBaseAddressAction);
+ manager.add(goToAddressAction);
+ manager.add(refreshAction);
+ manager.add(new Separator());
+ manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
});
}
@@ -1260,12 +1218,7 @@ public class TraditionalRendering extends AbstractMemoryRendering implements IRe
@Override
public void goToAddress(final BigInteger address) throws DebugException {
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- fRendering.gotoAddress(address);
- }
- });
+ Display.getDefault().asyncExec(() -> fRendering.gotoAddress(address));
}
protected void setTargetMemoryLittleEndian(boolean littleEndian) {
@@ -1314,27 +1267,21 @@ public class TraditionalRendering extends AbstractMemoryRendering implements IRe
if (adapter == IMemoryBlockConnection.class) {
if (fConnection == null) {
- fConnection = new IMemoryBlockConnection() {
- @Override
- public void update() {
- // update UI asynchronously
- Display display = TraditionalRenderingPlugin.getDefault().getWorkbench().getDisplay();
- display.asyncExec(new Runnable() {
- @Override
- public void run() {
- try {
- if (fBigBaseAddress != TraditionalRendering.this.fRendering.getMemoryBlock()
- .getBigBaseAddress()) {
- fBigBaseAddress = TraditionalRendering.this.fRendering.getMemoryBlock()
- .getBigBaseAddress();
- TraditionalRendering.this.fRendering.gotoAddress(fBigBaseAddress);
- }
- TraditionalRendering.this.fRendering.refresh();
- } catch (DebugException e) {
- }
+ fConnection = () -> {
+ // update UI asynchronously
+ Display display = TraditionalRenderingPlugin.getDefault().getWorkbench().getDisplay();
+ display.asyncExec(() -> {
+ try {
+ if (fBigBaseAddress != TraditionalRendering.this.fRendering.getMemoryBlock()
+ .getBigBaseAddress()) {
+ fBigBaseAddress = TraditionalRendering.this.fRendering.getMemoryBlock()
+ .getBigBaseAddress();
+ TraditionalRendering.this.fRendering.gotoAddress(fBigBaseAddress);
}
- });
- }
+ TraditionalRendering.this.fRendering.refresh();
+ } catch (DebugException e) {
+ }
+ });
};
}
return (T) fConnection;
diff --git a/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/TraditionalRenderingPreferenceAction.java b/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/TraditionalRenderingPreferenceAction.java
index 48a38b6b21..93dfdd3ebf 100644
--- a/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/TraditionalRenderingPreferenceAction.java
+++ b/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/TraditionalRenderingPreferenceAction.java
@@ -41,14 +41,8 @@ public class TraditionalRenderingPreferenceAction extends ActionDelegate impleme
}
protected void showPreferencePage(String id, IPreferencePage page) {
- BusyIndicator.showWhile(TraditionalRenderingPlugin.getStandardDisplay(), new Runnable() {
- @Override
- public void run() {
- PreferencesUtil
- .createPreferenceDialogOn(TraditionalRenderingPlugin.getShell(), id, new String[] { id }, null)
- .open();
- }
- });
+ BusyIndicator.showWhile(TraditionalRenderingPlugin.getStandardDisplay(), () -> PreferencesUtil
+ .createPreferenceDialogOn(TraditionalRenderingPlugin.getShell(), id, new String[] { id }, null).open());
}
}
diff --git a/memory/org.eclipse.cdt.debug.ui.memory.transport/META-INF/MANIFEST.MF b/memory/org.eclipse.cdt.debug.ui.memory.transport/META-INF/MANIFEST.MF
index 4deab8b299..50f2afd706 100644
--- a/memory/org.eclipse.cdt.debug.ui.memory.transport/META-INF/MANIFEST.MF
+++ b/memory/org.eclipse.cdt.debug.ui.memory.transport/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.debug.ui.memory.transport;singleton:=true
-Bundle-Version: 2.1.1.qualifier
+Bundle-Version: 2.1.100.qualifier
Bundle-Localization: plugin
Bundle-Vendor: %providerName
Require-Bundle: org.eclipse.debug.core,
diff --git a/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/PlainTextExporter.java b/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/PlainTextExporter.java
index 7b6a391acd..d8bc66c642 100644
--- a/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/PlainTextExporter.java
+++ b/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/PlainTextExporter.java
@@ -370,12 +370,7 @@ public class PlainTextExporter implements IMemoryExporter {
* info. In practice the user never sees the invalid state displayed, because of the
* speed of the draw of the dialog.
*/
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- validate();
- }
- });
+ Display.getDefault().asyncExec(() -> validate());
return composite;
}
diff --git a/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/PlainTextImporter.java b/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/PlainTextImporter.java
index e7d72651ed..fd3b36b42d 100644
--- a/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/PlainTextImporter.java
+++ b/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/PlainTextImporter.java
@@ -214,12 +214,7 @@ public class PlainTextImporter implements IMemoryImporter {
composite.pack();
parent.pack();
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- validate();
- }
- });
+ Display.getDefault().asyncExec(() -> validate());
return composite;
}
diff --git a/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/RAWBinaryExporter.java b/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/RAWBinaryExporter.java
index 135ea674c9..6ad3ffec18 100644
--- a/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/RAWBinaryExporter.java
+++ b/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/RAWBinaryExporter.java
@@ -373,12 +373,7 @@ public class RAWBinaryExporter implements IMemoryExporter {
* info. In practice the user never sees the invalid state displayed, because of the
* speed of the draw of the dialog.
*/
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- validate();
- }
- });
+ Display.getDefault().asyncExec(() -> validate());
return composite;
}
diff --git a/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/RAWBinaryImporter.java b/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/RAWBinaryImporter.java
index eb2d4c1687..f9f12b05d7 100644
--- a/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/RAWBinaryImporter.java
+++ b/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/RAWBinaryImporter.java
@@ -194,12 +194,7 @@ public class RAWBinaryImporter implements IMemoryImporter {
composite.pack();
parent.pack();
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- validate();
- }
- });
+ Display.getDefault().asyncExec(() -> validate());
return composite;
}
diff --git a/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/SRecordImporter.java b/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/SRecordImporter.java
index 0b2923002e..318ca6dc6e 100644
--- a/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/SRecordImporter.java
+++ b/memory/org.eclipse.cdt.debug.ui.memory.transport/src/org/eclipse/cdt/debug/ui/memory/transport/SRecordImporter.java
@@ -277,12 +277,7 @@ public class SRecordImporter implements IMemoryImporter {
composite.pack();
parent.pack();
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- validate();
- }
- });
+ Display.getDefault().asyncExec(() -> validate());
return composite;
}
diff --git a/toolchains/arduino/org.eclipse.cdt.arduino.ui/src/org/eclipse/cdt/arduino/ui/internal/FormTextHoverManager.java b/toolchains/arduino/org.eclipse.cdt.arduino.ui/src/org/eclipse/cdt/arduino/ui/internal/FormTextHoverManager.java
index 813a169cc5..2380dfa5fe 100644
--- a/toolchains/arduino/org.eclipse.cdt.arduino.ui/src/org/eclipse/cdt/arduino/ui/internal/FormTextHoverManager.java
+++ b/toolchains/arduino/org.eclipse.cdt.arduino.ui/src/org/eclipse/cdt/arduino/ui/internal/FormTextHoverManager.java
@@ -133,12 +133,7 @@ public abstract class FormTextHoverManager extends AbstractHoverInformationContr
@Override
public IInformationControlCreator getInformationPresenterControlCreator() {
- return new IInformationControlCreator() {
- @Override
- public IInformationControl createInformationControl(Shell parent) {
- return new FormTextInformationControl(parent, true);
- }
- };
+ return parent -> new FormTextInformationControl(parent, true);
}
public Control getControl() {
@@ -273,12 +268,7 @@ public abstract class FormTextHoverManager extends AbstractHoverInformationContr
@Override
public void focusLost(FocusEvent event) {
if (display != null && !display.isDisposed()) {
- display.asyncExec(new Runnable() {
- @Override
- public void run() {
- hideInformationControl();
- }
- });
+ display.asyncExec(() -> hideInformationControl());
}
}

Back to the top