Skip to content

Commit

Permalink
migrate to pmd rc3 #180
Browse files Browse the repository at this point in the history
  • Loading branch information
Luro02 committed Jun 9, 2023
1 parent 05f8b04 commit 63bcf60
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 18 deletions.
2 changes: 1 addition & 1 deletion autograder-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<properties>
<spoon.version>10.3.0</spoon.version>
<pmd.version>7.0.0-rc2</pmd.version>
<pmd.version>7.0.0-rc3</pmd.version>
<spotbugs.version>6.45.0</spotbugs.version>

<docker.version>3.3.1</docker.version>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class PMDInCodeProblem extends ProblemImpl {
public PMDInCodeProblem(PMDCheck check, RuleViolation violation, Path root) {
super(check,
new CodePosition(
relativize(root, Path.of(violation.getFilename())),
relativize(root, Path.of(violation.getFileId().getAbsolutePath())),
violation.getBeginLine(),
violation.getBeginLine(),
violation.getBeginColumn(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import net.sourceforge.pmd.lang.Language;
import net.sourceforge.pmd.lang.LanguageRegistry;
import net.sourceforge.pmd.lang.document.FileCollector;
import net.sourceforge.pmd.lang.document.FileId;

import javax.tools.JavaFileObject;
import java.io.IOException;
Expand Down Expand Up @@ -53,8 +54,8 @@ public List<Problem> lint(UploadedFile file, List<PMDCheck> checks, ClassLoader
FileCollector collector = pmd.files();
for (JavaFileObject compilationUnit : file.getSource().compilationUnits()) {
collector.addSourceFile(
compilationUnit.getCharContent(false).toString(),
compilationUnit.getName()
FileId.fromPathLikeString(compilationUnit.getName()),
compilationUnit.getCharContent(false).toString()
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public ProblemRenderer(Map<String, PMDCheck> checks, Path root) {
super("Custom renderer", "Creates InCodeProblems");
this.checks = checks;
this.root = root;
super.setWriter(new NullWriter());
super.setWriter(NullWriter.INSTANCE);
}

@Override
Expand Down

0 comments on commit 63bcf60

Please sign in to comment.