summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorCamilo Bernal2012-09-07 10:21:34 (EDT)
committer Roland Grunberg2012-09-07 13:02:49 (EDT)
commitef2c2aba3eef34d7cdfb6087506e06bdf7c99caa (patch)
treefe9ad317a55381c1aacefeef8d56220cc58575b2
parent7b1312942aa10f3b9feeadd2d084d72bcc62c408 (diff)
downloadorg.eclipse.linuxtools-ef2c2aba3eef34d7cdfb6087506e06bdf7c99caa.zip
org.eclipse.linuxtools-ef2c2aba3eef34d7cdfb6087506e06bdf7c99caa.tar.gz
org.eclipse.linuxtools-ef2c2aba3eef34d7cdfb6087506e06bdf7c99caa.tar.bz2
(bug 387314) Fix exception thrown when creating config with no project.
Handle cases when getting project name results in an empty string, this happens when there is no project associated with the profiling config. Change-Id: I38c12f6d95636d846b0b8176ed8e0bd148609c1c Reviewed-on: https://git.eclipse.org/r/7661 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/PerfCore.java9
-rw-r--r--perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/launch/PerfEventsTab.java2
2 files changed, 8 insertions, 3 deletions
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 a7774d0..2cf95b0 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
@@ -113,7 +113,7 @@ public class PerfCore {
} catch (CoreException e) {
return null;
}
- if (projectName == null) {
+ if (projectName.equals("")) {
return null;
}
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
@@ -134,7 +134,12 @@ public class PerfCore {
} else {
ConfigUtils configUtils = new ConfigUtils(config);
try {
- project = ConfigUtils.getProject(configUtils.getProjectName());
+ String projectName = configUtils.getProjectName();
+ // an empty string is not a legal path to file argument for ConfigUtils.getProject
+ if(projectName != null && !projectName.equals("")){
+ project = ConfigUtils.getProject(projectName);
+ }
+
} catch (CoreException e1) {
e1.printStackTrace();
}
diff --git a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/launch/PerfEventsTab.java b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/launch/PerfEventsTab.java
index 8930ade..380e679 100644
--- a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/launch/PerfEventsTab.java
+++ b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/launch/PerfEventsTab.java
@@ -397,7 +397,7 @@ public class PerfEventsTab extends AbstractLaunchConfigurationTab {
} catch (CoreException e) {
return null;
}
- if (name == null) {
+ if (name.equals(EMPTY_STRING)){
return null;
}