Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/codan
diff options
context:
space:
mode:
authorNathan Ridge2017-10-20 04:34:24 +0000
committerNathan Ridge2017-10-26 18:05:51 +0000
commitacd931e2b62a24eac00b0b82eb4ad57653644c7c (patch)
tree46d8813b7a6ab343fd399dfa64582d1e65cf989d /codan
parente96d2f92c88742e5cb2c670accbb441429f0dc46 (diff)
downloadorg.eclipse.cdt-acd931e2b62a24eac00b0b82eb4ad57653644c7c.tar.gz
org.eclipse.cdt-acd931e2b62a24eac00b0b82eb4ad57653644c7c.tar.xz
org.eclipse.cdt-acd931e2b62a24eac00b0b82eb4ad57653644c7c.zip
Bug 525953 - Simplify the implementation of AbstractCodanCMarkerResolution.getProblem()
In the process, the (problematic) assumption the function previously made that a marker's resource will be a file, has been removed. Change-Id: I657e1e99d9b06921558ca13960b4fd3ad554911d
Diffstat (limited to 'codan')
-rw-r--r--codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/ui/AbstractCodanCMarkerResolution.java8
1 files changed, 3 insertions, 5 deletions
diff --git a/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/ui/AbstractCodanCMarkerResolution.java b/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/ui/AbstractCodanCMarkerResolution.java
index 95ebf60049b..430cd68f7b9 100644
--- a/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/ui/AbstractCodanCMarkerResolution.java
+++ b/codan/org.eclipse.cdt.codan.ui.cxx/src/org/eclipse/cdt/codan/ui/AbstractCodanCMarkerResolution.java
@@ -29,6 +29,7 @@ import org.eclipse.cdt.ui.CDTUITools;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
@@ -273,11 +274,8 @@ public abstract class AbstractCodanCMarkerResolution implements ICodanMarkerReso
}
public IProblem getProblem(IMarker marker) {
- IPath path = marker.getResource().getFullPath();
- IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
- if (file == null)
- return null;
- IProblemProfile profile = CodanRuntime.getInstance().getCheckersRegistry().getResourceProfile(file);
+ IResource resource = marker.getResource();
+ IProblemProfile profile = CodanRuntime.getInstance().getCheckersRegistry().getResourceProfile(resource);
String id = getProblemId(marker);
return profile.findProblem(id);
}

Back to the top