aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamilo Bernal2013-03-07 11:36:44 (EST)
committerRoland Grunberg2013-03-07 13:54:22 (EST)
commit3e564354f1b90c59959979e20aa8134a161d7d73 (patch)
tree9877e26bdcb0467609d8fcc9cc81e7dfb1223cc3
parent559a9fede192a24e56bf4b9f99d69f67857f6081 (diff)
downloadorg.eclipse.linuxtools-3e564354f1b90c59959979e20aa8134a161d7d73.zip
org.eclipse.linuxtools-3e564354f1b90c59959979e20aa8134a161d7d73.tar.gz
org.eclipse.linuxtools-3e564354f1b90c59959979e20aa8134a161d7d73.tar.bz2
Avoid passing null to StatData contructor.refs/changes/35/10935/3
Minor change for readability. Change-Id: I53558711142a48061c89567c88826acb0449486e Reviewed-on: https://git.eclipse.org/r/10935 Tested-by: Hudson CI Reviewed-by: Roland Grunberg <rgrunber@redhat.com> IP-Clean: Roland Grunberg <rgrunber@redhat.com> Tested-by: Roland Grunberg <rgrunber@redhat.com>
-rw-r--r--perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/launch/PerfLaunchConfigDelegate.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/launch/PerfLaunchConfigDelegate.java b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/launch/PerfLaunchConfigDelegate.java
index 62885b5..cd910e9 100644
--- a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/launch/PerfLaunchConfigDelegate.java
+++ b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/launch/PerfLaunchConfigDelegate.java
@@ -87,15 +87,15 @@ public class PerfLaunchConfigDelegate extends ProfileLaunchConfigurationDelegate
+ " (" + runCount + " runs)" ); //$NON-NLS-1$ /$NON-NLS-2$
StatData sd = null;
+ Object[] configEvents = config.getAttribute(PerfPlugin.ATTR_SelectedEvents, PerfPlugin.ATTR_SelectedEvents_default).toArray();
+ String[] statEvents = new String[0];
+
if(!config.getAttribute(PerfPlugin.ATTR_DefaultEvent, PerfPlugin.ATTR_DefaultEvent_default)){
// gather selected events
- Object[] configEvents = config.getAttribute(PerfPlugin.ATTR_SelectedEvents, PerfPlugin.ATTR_SelectedEvents_default).toArray();
- String[] statEvents = Arrays.asList(configEvents).toArray(new String[]{});
-
- sd = new StatData(title, exePath.toOSString(), arguments, runCount, statEvents);
- } else{
- sd = new StatData(title, exePath.toOSString(), arguments, runCount, null);
+ statEvents = configEvents == null ? statEvents : Arrays.asList(configEvents).toArray(new String[]{});
}
+
+ sd = new StatData(title, exePath.toOSString(), arguments, runCount, statEvents);
sd.parse();
PerfPlugin.getDefault().setStatData(sd);
StatView.refreshView();