From 9792a72dae95f9299bf94e54308887ef020fea79 Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Fri, 6 Oct 2017 16:11:45 -0400 Subject: [PATCH] Bug 525438 - Fix file path comparison in AbstractIndexAstChecker.getLineCommentsForLocation() Using IPath.toPortableString() was causing a forward slash vs. backward slash mismtach in the path comparison on Windows. Change-Id: Ib3eb392065fb473f6b6e70cb1dcddceb34ae7240 --- .../cdt/codan/core/cxx/model/AbstractIndexAstChecker.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/model/AbstractIndexAstChecker.java b/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/model/AbstractIndexAstChecker.java index c9ec33b5e00..9fdd4d96a1e 100644 --- a/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/model/AbstractIndexAstChecker.java +++ b/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/model/AbstractIndexAstChecker.java @@ -171,8 +171,7 @@ public abstract class AbstractIndexAstChecker extends AbstractCheckerWithProblem for (IASTComment comm : commentsArray) { IASTFileLocation fileLocation = comm.getFileLocation(); if (fileLocation.getStartingLineNumber() == loc.getLineNumber()) { - //XXX check on windows portable or os? - String problemFile = loc.getFile().getLocation().toPortableString(); + String problemFile = loc.getFile().getLocation().toOSString(); String commentFile = fileLocation.getFileName(); if (problemFile.equals(commentFile)) { lineComments.add(comm);