tmf: Bug 484042: Fix source code lookup within the workspace
authorBernd Hufmann <Bernd.Hufmann@ericsson.com>
Fri, 29 Apr 2016 18:50:10 +0000 (14:50 -0400)
committerBernd Hufmann <bernd.hufmann@ericsson.com>
Tue, 10 May 2016 22:44:24 +0000 (18:44 -0400)
If the source code is not found using the path provided by the
source callsite the workspace will be searched using the file name
instead.

Change-Id: I033e7d87ef0918f796f9010d54f3d9f378856078
Signed-off-by: Bernd Hufmann <Bernd.Hufmann@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/71735
Reviewed-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Reviewed-by: Hudson CI
Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Tested-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/events/TmfEventsTable.java

index c62b70d720b0442bdcbe30b426fc4b3800fcb082..87e306b41960d31d06584a7562987f032de5ba3b 100644 (file)
@@ -1139,10 +1139,11 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
                          */
                         IMarker marker = null;
                         final ArrayList<IFile> files = new ArrayList<>();
+                        IPath p = new Path(trimmedPath);
                         ResourcesPlugin.getWorkspace().getRoot().accept(new IResourceVisitor() {
                             @Override
                             public boolean visit(IResource resource) throws CoreException {
-                                if (resource instanceof IFile && resource.getFullPath().toString().endsWith(trimmedPath)) {
+                                if (resource instanceof IFile && resource.getFullPath().toString().endsWith(p.lastSegment())) {
                                     files.add((IFile) resource);
                                 }
                                 return true;
This page took 0.026719 seconds and 5 git commands to generate.