diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTApexFile.java b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTApexFile.java index 59be67f496..7d14d00264 100644 --- a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTApexFile.java +++ b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTApexFile.java @@ -4,6 +4,8 @@ package net.sourceforge.pmd.lang.apex.ast; +import java.net.URI; +import java.nio.file.Paths; import java.util.List; import java.util.Map; @@ -60,6 +62,11 @@ public final class ASTApexFile extends AbstractApexNode implements Root } public List getGlobalIssues() { - return multifileAnalysis.getFileIssues(getAstInfo().getTextDocument().getPathId()); + String filename = getAstInfo().getTextDocument().getPathId(); + if (filename.length() > 7 && "file://".equalsIgnoreCase(filename.substring(0, 7))) { + URI uri = URI.create(filename); + filename = Paths.get(uri).toString(); + } + return multifileAnalysis.getFileIssues(filename); } }