diff options
author | Lars Vogel | 2020-06-15 08:25:15 +0000 |
---|---|---|
committer | Lars Vogel | 2020-06-17 11:42:37 +0000 |
commit | b5d058af7ceaaeb734476b48058581d7ad315b4b (patch) | |
tree | 275e2ed78cd8446d0fd0e6e32fcac5248fbf1fa0 | |
parent | 28390d37f36c1836993acf861ffcd481b4cb64bb (diff) | |
download | eclipse.platform.debug-b5d058af7ceaaeb734476b48058581d7ad315b4b.tar.gz eclipse.platform.debug-b5d058af7ceaaeb734476b48058581d7ad315b4b.tar.xz eclipse.platform.debug-b5d058af7ceaaeb734476b48058581d7ad315b4b.zip |
Bug 564330 - Lambda and method cleanup on o.e.debug.examples.core plug-in
Running the JDT batch cleanup for lambdas and method reference showed
still some places where they can be used. As we received lots of
cleanups in this area, I think it is good to finish this.
Change-Id: I15d68377f660b84439fbe7cec108d9ac79cd4aff
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
2 files changed, 16 insertions, 25 deletions
diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDALineBreakpoint.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDALineBreakpoint.java index c1a21a99b..c7a207b07 100644 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDALineBreakpoint.java +++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDALineBreakpoint.java @@ -19,7 +19,6 @@ import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IWorkspaceRunnable; import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.debug.core.model.IBreakpoint; import org.eclipse.debug.core.model.LineBreakpoint; import org.eclipse.debug.examples.core.pda.DebugCorePlugin; @@ -62,16 +61,13 @@ public class PDALineBreakpoint extends LineBreakpoint implements IPDAEventListen * @throws CoreException if unable to create the breakpoint */ public PDALineBreakpoint(final IResource resource, final int lineNumber) throws CoreException { - IWorkspaceRunnable runnable = new IWorkspaceRunnable() { - @Override - public void run(IProgressMonitor monitor) throws CoreException { - IMarker marker = resource.createMarker("org.eclipse.debug.examples.core.pda.markerType.lineBreakpoint"); //$NON-NLS-1$ - setMarker(marker); - marker.setAttribute(IBreakpoint.ENABLED, Boolean.TRUE); - marker.setAttribute(IMarker.LINE_NUMBER, lineNumber); - marker.setAttribute(IBreakpoint.ID, getModelIdentifier()); - marker.setAttribute(IMarker.MESSAGE, "Line Breakpoint: " + resource.getName() + " [line: " + lineNumber + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - } + IWorkspaceRunnable runnable = monitor -> { + IMarker marker = resource.createMarker("org.eclipse.debug.examples.core.pda.markerType.lineBreakpoint"); //$NON-NLS-1$ + setMarker(marker); + marker.setAttribute(IBreakpoint.ENABLED, Boolean.TRUE); + marker.setAttribute(IMarker.LINE_NUMBER, lineNumber); + marker.setAttribute(IBreakpoint.ID, getModelIdentifier()); + marker.setAttribute(IMarker.MESSAGE, "Line Breakpoint: " + resource.getName() + " [line: " + lineNumber + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ }; run(getMarkerRule(resource), runnable); } diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDARunToLineBreakpoint.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDARunToLineBreakpoint.java index 55eb369ba..e9629042a 100644 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDARunToLineBreakpoint.java +++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDARunToLineBreakpoint.java @@ -18,8 +18,6 @@ import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IWorkspaceRunnable; import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.model.IBreakpoint; @@ -38,18 +36,15 @@ public class PDARunToLineBreakpoint extends PDALineBreakpoint { * @exception DebugException if unable to create the breakpoint */ public PDARunToLineBreakpoint(final IFile resource, final int lineNumber) throws DebugException { - IWorkspaceRunnable runnable = new IWorkspaceRunnable() { - @Override - public void run(IProgressMonitor monitor) throws CoreException { - // associate with workspace root to avoid drawing in editor ruler - IMarker marker = ResourcesPlugin.getWorkspace().getRoot().createMarker("org.eclipse.debug.examples.core.pda.markerType.lineBreakpoint"); //$NON-NLS-1$ - setMarker(marker); - marker.setAttribute(IBreakpoint.ENABLED, Boolean.TRUE); - marker.setAttribute(IMarker.LINE_NUMBER, lineNumber); - marker.setAttribute(IBreakpoint.ID, getModelIdentifier()); - setRegistered(false); - fSourceFile = resource; - } + IWorkspaceRunnable runnable = monitor -> { + // associate with workspace root to avoid drawing in editor ruler + IMarker marker = ResourcesPlugin.getWorkspace().getRoot().createMarker("org.eclipse.debug.examples.core.pda.markerType.lineBreakpoint"); //$NON-NLS-1$ + setMarker(marker); + marker.setAttribute(IBreakpoint.ENABLED, Boolean.TRUE); + marker.setAttribute(IMarker.LINE_NUMBER, lineNumber); + marker.setAttribute(IBreakpoint.ID, getModelIdentifier()); + setRegistered(false); + fSourceFile = resource; }; run(getMarkerRule(resource), runnable); } |