Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/perf
diff options
context:
space:
mode:
authorAlexander Kurtakov2015-12-08 12:59:11 +0000
committerAlexander Kurtakov2015-12-08 13:34:45 +0000
commit7466f8c5461dd140e9906a1cde35e5fadadcd985 (patch)
treed844fe53aabfb994ebdbc2067c913326eb02d33f /perf
parent350019e2a4933a315f5e2a7cf6f1ab44a95af1d0 (diff)
downloadorg.eclipse.linuxtools-7466f8c5461dd140e9906a1cde35e5fadadcd985.tar.gz
org.eclipse.linuxtools-7466f8c5461dd140e9906a1cde35e5fadadcd985.tar.xz
org.eclipse.linuxtools-7466f8c5461dd140e9906a1cde35e5fadadcd985.zip
perf: Move to Java 8 and Neon.
* Bump BREE to Java 1.8. * Use lambdas where feasible. Change-Id: I2703165a075e3cab76ad97ef52e4623928ad94eb Signed-off-by: Alexander Kurtakov <akurtako@redhat.com> Reviewed-on: https://git.eclipse.org/r/62205 Tested-by: Hudson CI
Diffstat (limited to 'perf')
-rw-r--r--perf/org.eclipse.linuxtools.perf/.classpath2
-rw-r--r--perf/org.eclipse.linuxtools.perf/.settings/org.eclipse.jdt.core.prefs6
-rw-r--r--perf/org.eclipse.linuxtools.perf/META-INF/MANIFEST.MF2
-rw-r--r--perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/AbstractDataManipulator.java7
-rw-r--r--perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/PerfCore.java26
-rw-r--r--perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/PerfPlugin.java9
-rw-r--r--perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/handlers/AbstractSaveDataHandler.java7
-rw-r--r--perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/launch/PerfOptionsTab.java32
-rw-r--r--perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/PerfProfileView.java17
-rw-r--r--perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/SourceDisassemblyView.java28
-rw-r--r--perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/StatView.java26
11 files changed, 49 insertions, 113 deletions
diff --git a/perf/org.eclipse.linuxtools.perf/.classpath b/perf/org.eclipse.linuxtools.perf/.classpath
index 098194ca4b..eca7bdba8f 100644
--- a/perf/org.eclipse.linuxtools.perf/.classpath
+++ b/perf/org.eclipse.linuxtools.perf/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
diff --git a/perf/org.eclipse.linuxtools.perf/.settings/org.eclipse.jdt.core.prefs b/perf/org.eclipse.linuxtools.perf/.settings/org.eclipse.jdt.core.prefs
index e231467613..60d805a02b 100644
--- a/perf/org.eclipse.linuxtools.perf/.settings/org.eclipse.jdt.core.prefs
+++ b/perf/org.eclipse.linuxtools.perf/.settings/org.eclipse.jdt.core.prefs
@@ -6,9 +6,9 @@ org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annota
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@@ -97,4 +97,4 @@ org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=warning
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.7
+org.eclipse.jdt.core.compiler.source=1.8
diff --git a/perf/org.eclipse.linuxtools.perf/META-INF/MANIFEST.MF b/perf/org.eclipse.linuxtools.perf/META-INF/MANIFEST.MF
index 1d3a36222c..721ae57e6a 100644
--- a/perf/org.eclipse.linuxtools.perf/META-INF/MANIFEST.MF
+++ b/perf/org.eclipse.linuxtools.perf/META-INF/MANIFEST.MF
@@ -20,7 +20,7 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.linuxtools.profiling.ui;bundle-version="0.9.0",
org.eclipse.ui.ide,
org.eclipse.team.ui;bundle-version="3.7.1"
-Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Import-Package: org.eclipse.compare,
org.eclipse.compare.structuremergeviewer,
diff --git a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/AbstractDataManipulator.java b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/AbstractDataManipulator.java
index 23ad686c82..4a6a1eda7d 100644
--- a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/AbstractDataManipulator.java
+++ b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/AbstractDataManipulator.java
@@ -153,12 +153,7 @@ public abstract class AbstractDataManipulator extends BaseDataManipulator
*/
private void readStream(final BufferedReader buff,
final StringBuffer strBuff) {
- Thread readThread = new Thread(new Runnable() {
- @Override
- public void run() {
- strBuff.append(getBufferContents(buff));
- }
- });
+ Thread readThread = new Thread(() -> strBuff.append(getBufferContents(buff)));
readThread.start();
threads.add(readThread);
}
diff --git a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/PerfCore.java b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/PerfCore.java
index 6ef42f95d2..54e832daaf 100644
--- a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/PerfCore.java
+++ b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/PerfCore.java
@@ -682,21 +682,17 @@ public class PerfCore {
}
public static void refreshView (final String title) {
- Display.getDefault().syncExec(new Runnable() {
-
- @Override
- public void run() {
- try {
- PerfProfileView view = (PerfProfileView) PlatformUI
- .getWorkbench().getActiveWorkbenchWindow()
- .getActivePage().showView(PerfPlugin.VIEW_ID);
- view.setContentDescription(title);
- view.refreshModel();
- } catch (PartInitException e) {
- logException(e);
- }
- }
- });
+ Display.getDefault().syncExec(() -> {
+ try {
+ PerfProfileView view = (PerfProfileView) PlatformUI
+ .getWorkbench().getActiveWorkbenchWindow()
+ .getActivePage().showView(PerfPlugin.VIEW_ID);
+ view.setContentDescription(title);
+ view.refreshModel();
+ } catch (PartInitException e) {
+ logException(e);
+ }
+ });
}
/**
diff --git a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/PerfPlugin.java b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/PerfPlugin.java
index ec8c711bca..1548d3600e 100644
--- a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/PerfPlugin.java
+++ b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/PerfPlugin.java
@@ -274,13 +274,8 @@ public class PerfPlugin extends AbstractUIPlugin {
final Status status = new Status(IStatus.ERROR, PLUGIN_ID, formattedMessage, new Throwable(writer.toString()));
getLog().log(status);
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- ErrorDialog.openError(Display.getDefault().getActiveShell(),
- title, message, status);
- }
- });
+ Display.getDefault().asyncExec(() -> ErrorDialog.openError(Display.getDefault().getActiveShell(),
+ title, message, status));
}
/**
diff --git a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/handlers/AbstractSaveDataHandler.java b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/handlers/AbstractSaveDataHandler.java
index f54b96f249..82d0a26ca7 100644
--- a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/handlers/AbstractSaveDataHandler.java
+++ b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/handlers/AbstractSaveDataHandler.java
@@ -124,12 +124,7 @@ public abstract class AbstractSaveDataHandler extends BaseDataManipulator implem
if (Display.getCurrent() != null) {
MessageDialog.openError(Display.getCurrent().getActiveShell(), title, errorMsg);
} else {
- Display.getDefault().syncExec(new Runnable() {
- @Override
- public void run() {
- MessageDialog.openError(Display.getCurrent().getActiveShell(), title, errorMsg);
- }
- });
+ Display.getDefault().syncExec(() -> MessageDialog.openError(Display.getCurrent().getActiveShell(), title, errorMsg));
}
}
diff --git a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/launch/PerfOptionsTab.java b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/launch/PerfOptionsTab.java
index 02c10a5d03..a3968f614f 100644
--- a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/launch/PerfOptionsTab.java
+++ b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/launch/PerfOptionsTab.java
@@ -25,8 +25,6 @@ import org.eclipse.linuxtools.internal.perf.PerfPlugin;
import org.eclipse.linuxtools.internal.perf.PerfVersion;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ScrolledComposite;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Image;
@@ -35,10 +33,8 @@ import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Spinner;
@@ -117,12 +113,7 @@ public class PerfOptionsTab extends AbstractLaunchConfigurationTab {
txtKernelLocation = new Text(kernelComp, SWT.SINGLE | SWT.BORDER);
data = new GridData(GridData.FILL_HORIZONTAL);
txtKernelLocation.setLayoutData(data);
- txtKernelLocation.addModifyListener(new ModifyListener() {
- @Override
- public void modifyText(ModifyEvent mev) {
- handleKernelImageFileTextModify(txtKernelLocation);
- }
- });
+ txtKernelLocation.addModifyListener(mev -> handleKernelImageFileTextModify(txtKernelLocation));
Button button = createPushButton(kernelComp, Messages.PerfOptionsTab_Browse, null);
final Shell shell = top.getShell();
@@ -161,12 +152,7 @@ public class PerfOptionsTab extends AbstractLaunchConfigurationTab {
statRunCount = new Spinner(showStatComp, SWT.BORDER);
statRunCount.setEnabled(false);
statRunCount.setMinimum(1);
- statRunCount.addModifyListener(new ModifyListener() {
- @Override
- public void modifyText(ModifyEvent e) {
- updateLaunchConfigurationDialog();
- }
- });
+ statRunCount.addModifyListener(e -> updateLaunchConfigurationDialog());
chkSourceLineNumbers.addSelectionListener(new SelectionAdapter() {
@Override
@@ -193,22 +179,12 @@ public class PerfOptionsTab extends AbstractLaunchConfigurationTab {
rtPriority = new Spinner(realtimeComp, SWT.BORDER);
rtPriority.setEnabled(chkRecordRealtime.getSelection());
rtPriority.setMinimum(1);
- rtPriority.addModifyListener(new ModifyListener() {
- @Override
- public void modifyText(ModifyEvent e) {
- updateLaunchConfigurationDialog();
- }
- });
+ rtPriority.addModifyListener(e -> updateLaunchConfigurationDialog());
// A disabled button does not respond to mouse events so use a composite.
final Composite multiplexEventsComp = new Composite(chkBoxComp, SWT.NONE);
multiplexEventsComp.setLayout(chkBoxLayout);
- multiplexEventsComp.addListener(SWT.MouseHover, new Listener() {
- @Override
- public void handleEvent(Event event) {
- multiplexEventsComp.setToolTipText(Messages.PerfOptionsTab_Requires_LTE + multiplexEventsVersion);
- }
- });
+ multiplexEventsComp.addListener(SWT.MouseHover, event -> multiplexEventsComp.setToolTipText(Messages.PerfOptionsTab_Requires_LTE + multiplexEventsVersion));
chkMultiplexEvents = createCheckButtonHelper(multiplexEventsComp, PerfPlugin.STRINGS_Multiplex);
scrollTop.setContent(top);
diff --git a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/PerfProfileView.java b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/PerfProfileView.java
index 59645e47e3..ad1da9ba3e 100644
--- a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/PerfProfileView.java
+++ b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/PerfProfileView.java
@@ -11,13 +11,10 @@
package org.eclipse.linuxtools.internal.perf.ui;
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.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerSorter;
@@ -80,12 +77,7 @@ public class PerfProfileView 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) {
- PerfProfileView.this.fillContextMenu(manager);
- }
- });
+ menuMgr.addMenuListener(manager -> PerfProfileView.this.fillContextMenu(manager));
Menu menu = menuMgr.createContextMenu(viewer.getControl());
viewer.getControl().setMenu(menu);
getSite().registerContextMenu(menuMgr, viewer);
@@ -108,12 +100,7 @@ public class PerfProfileView extends ViewPart {
private void hookDoubleClickAction() {
doubleClickAction = new PerfDoubleClickAction(viewer);
- viewer.addDoubleClickListener(new IDoubleClickListener() {
- @Override
- public void doubleClick(DoubleClickEvent event) {
- doubleClickAction.run();
- }
- });
+ viewer.addDoubleClickListener(event -> doubleClickAction.run());
}
public TreeViewer getTreeViewer () {
diff --git a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/SourceDisassemblyView.java b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/SourceDisassemblyView.java
index 641ef5384b..0be96b5754 100644
--- a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/SourceDisassemblyView.java
+++ b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/SourceDisassemblyView.java
@@ -134,22 +134,18 @@ public class SourceDisassemblyView extends ViewPart implements IFindReplaceTarge
}
public static void refreshView () {
- Display.getDefault().syncExec(new Runnable() {
-
- @Override
- public void run() {
- try {
- // A new view is created every time
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
- .showView(PerfPlugin.SOURCE_DISASSEMBLY_VIEW_ID,
- Integer.toString(SECONDARY_ID++),
- IWorkbenchPage.VIEW_CREATE);
- } catch (PartInitException e) {
- IStatus status = new Status(IStatus.ERROR, PerfPlugin.PLUGIN_ID, e.getMessage(), e);
- PerfPlugin.getDefault().getLog().log(status);
- }
- }
- });
+ Display.getDefault().syncExec(() -> {
+ try {
+ // A new view is created every time
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
+ .showView(PerfPlugin.SOURCE_DISASSEMBLY_VIEW_ID,
+ Integer.toString(SECONDARY_ID++),
+ IWorkbenchPage.VIEW_CREATE);
+ } catch (PartInitException e) {
+ IStatus status = new Status(IStatus.ERROR, PerfPlugin.PLUGIN_ID, e.getMessage(), e);
+ PerfPlugin.getDefault().getLog().log(status);
+ }
+ });
}
/**
diff --git a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/StatView.java b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/StatView.java
index c28e142693..273fb493fb 100644
--- a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/StatView.java
+++ b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/ui/StatView.java
@@ -74,21 +74,17 @@ public class StatView extends ViewPart {
* Refresh perf statistics view.
*/
public static void refreshView () {
- Display.getDefault().syncExec(new Runnable() {
-
- @Override
- public void run() {
- try {
- // A new view is created every time
- StatView view = (StatView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
- .showView(PerfPlugin.STAT_VIEW_ID);
- view.updateData();
- } catch (PartInitException e) {
- IStatus status = new Status(IStatus.ERROR, PerfPlugin.PLUGIN_ID, e.getMessage(), e);
- PerfPlugin.getDefault().getLog().log(status);
- }
- }
- });
+ Display.getDefault().syncExec(() -> {
+ try {
+ // A new view is created every time
+ StatView view = (StatView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
+ .showView(PerfPlugin.STAT_VIEW_ID);
+ view.updateData();
+ } catch (PartInitException e) {
+ IStatus status = new Status(IStatus.ERROR, PerfPlugin.PLUGIN_ID, e.getMessage(), e);
+ PerfPlugin.getDefault().getLog().log(status);
+ }
+ });
}
}

Back to the top