mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 06:02:11 +02:00
Bug 352407 - Correctly compare resource path to pattern in codan
exclusion filter Change-Id: Ic7f9740fa129bb5e05a6156f077af8a8c0d36e7b Signed-off-by: Nathan Ridge <zeratul976@hotmail.com>
This commit is contained in:
parent
ad308251da
commit
5d2f7bcb56
3 changed files with 5 additions and 5 deletions
|
@ -79,7 +79,7 @@ public abstract class AbstractCheckerWithProblemPreferences extends AbstractChec
|
|||
Collection<IProblem> refProblems = getRuntime().getCheckersRegistry().getRefProblems(this);
|
||||
for (Iterator<IProblem> iterator = refProblems.iterator(); iterator.hasNext();) {
|
||||
IProblem checkerProblem = iterator.next();
|
||||
if (shouldProduceProblem(getProblemById(checkerProblem.getId(), res), res.getLocation()))
|
||||
if (shouldProduceProblem(getProblemById(checkerProblem.getId(), res), res.getFullPath()))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -110,7 +110,7 @@ public abstract class AbstractCheckerWithProblemPreferences extends AbstractChec
|
|||
@Override
|
||||
public void reportProblem(String problemId, IProblemLocation loc, Object... args) {
|
||||
if (shouldProduceProblem(getProblemById(problemId, loc.getFile()),
|
||||
loc.getFile().getLocation())) {
|
||||
loc.getFile().getFullPath())) {
|
||||
super.reportProblem(problemId, loc, args);
|
||||
}
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ public abstract class AbstractCheckerWithProblemPreferences extends AbstractChec
|
|||
* @since 2.0
|
||||
*/
|
||||
public void reportProblem(IProblem pr, IProblemLocation loc, Object... args) {
|
||||
if (shouldProduceProblem(pr, loc.getFile().getLocation()))
|
||||
if (shouldProduceProblem(pr, loc.getFile().getFullPath()))
|
||||
super.reportProblem(pr.getId(), loc, args);
|
||||
}
|
||||
|
||||
|
|
|
@ -258,7 +258,7 @@ public class FileScopeProblemPreference extends AbstractProblemPreference {
|
|||
* @return true if matches with at least one pattern in the array
|
||||
*/
|
||||
public boolean matchesFilter(IPath resourcePath, IPath[] paths) {
|
||||
char[] path = resourcePath.toString().toCharArray();
|
||||
char[] path = resourcePath.makeRelative().toString().toCharArray();
|
||||
for (int i = 0, length = paths.length; i < length; i++) {
|
||||
char[] pattern = paths[i].toString().toCharArray();
|
||||
if (CharOperation.pathMatch(pattern, path, true, '/')) {
|
||||
|
|
|
@ -51,7 +51,7 @@ public class GrepChecker extends AbstractCheckerWithProblemPreferences {
|
|||
for (Iterator<IProblem> iterator = refProblems.iterator(); iterator.hasNext();) {
|
||||
IProblem checkerProblem = iterator.next();
|
||||
IProblem problem = getProblemById(checkerProblem.getId(), file);
|
||||
if (shouldProduceProblem(problem, file.getLocation())) {
|
||||
if (shouldProduceProblem(problem, file.getFullPath())) {
|
||||
// do something
|
||||
Object[] values = (Object[]) getPreference(problem, PARAM_STRING_LIST);
|
||||
if (values.length == 0)
|
||||
|
|
Loading…
Add table
Reference in a new issue