mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 06:02:11 +02:00
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
This commit is contained in:
parent
e96d2f92c8
commit
acd931e2b6
1 changed files with 3 additions and 5 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue