diff --git a/autograder-api/src/main/java/de/firemage/autograder/api/AbstractLinter.java b/autograder-api/src/main/java/de/firemage/autograder/api/AbstractLinter.java index afbf0796..47982e61 100644 --- a/autograder-api/src/main/java/de/firemage/autograder/api/AbstractLinter.java +++ b/autograder-api/src/main/java/de/firemage/autograder/api/AbstractLinter.java @@ -9,7 +9,7 @@ import java.util.function.Consumer; public interface AbstractLinter { - List checkFile(Path file, JavaVersion version, CheckConfiguration checkConfiguration, Consumer statusConsumer) throws LinterException, IOException; + List checkFile(Path file, JavaVersion version, CheckConfiguration checkConfiguration, Consumer statusConsumer) throws LinterException, IOException; String translateMessage(Translatable translatable); FluentBundle getFluentBundle(); diff --git a/autograder-api/src/main/java/de/firemage/autograder/api/Problem.java b/autograder-api/src/main/java/de/firemage/autograder/api/AbstractProblem.java similarity index 87% rename from autograder-api/src/main/java/de/firemage/autograder/api/Problem.java rename to autograder-api/src/main/java/de/firemage/autograder/api/AbstractProblem.java index 324cca04..a4a95a3e 100644 --- a/autograder-api/src/main/java/de/firemage/autograder/api/Problem.java +++ b/autograder-api/src/main/java/de/firemage/autograder/api/AbstractProblem.java @@ -1,6 +1,6 @@ package de.firemage.autograder.api; -public interface Problem { +public interface AbstractProblem { String getCheckName(); Translatable getLinterName(); Translatable getExplanation(); diff --git a/autograder-api/src/main/java/de/firemage/autograder/api/loader/AutograderLoader.java b/autograder-api/src/main/java/de/firemage/autograder/api/loader/AutograderLoader.java index 3d481429..e8ffe702 100644 --- a/autograder-api/src/main/java/de/firemage/autograder/api/loader/AutograderLoader.java +++ b/autograder-api/src/main/java/de/firemage/autograder/api/loader/AutograderLoader.java @@ -65,11 +65,6 @@ public static AbstractTempLocation instantiateTempLocation(Path path) { } public static AbstractTempLocation instantiateTempLocation() { - try { - Class.forName("de.firemage.autograder.core.file.TempLocationImpl", true, autograderClassLoader); - } catch (ClassNotFoundException e) { - throw new RuntimeException(e); - } return new ImplementationBinder<>(AbstractTempLocation.class) .classLoader(autograderClassLoader) .instantiate(); diff --git a/autograder-cmd/src/main/java/de/firemage/autograder/cmd/Application.java b/autograder-cmd/src/main/java/de/firemage/autograder/cmd/Application.java index 4e8e3c66..81cd7d43 100644 --- a/autograder-cmd/src/main/java/de/firemage/autograder/cmd/Application.java +++ b/autograder-cmd/src/main/java/de/firemage/autograder/cmd/Application.java @@ -9,7 +9,7 @@ import de.firemage.autograder.api.AbstractLinter; import de.firemage.autograder.api.LinterConfigurationException; import de.firemage.autograder.api.LinterException; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.AbstractTempLocation; import de.firemage.autograder.api.Translatable; import de.firemage.autograder.api.loader.AutograderLoader; @@ -238,7 +238,7 @@ public Integer call() { return 0; } - private void printProblems(List problems, AbstractLinter linter) { + private void printProblems(List problems, AbstractLinter linter) { if (problems.isEmpty()) { CmdUtil.println("No problems found - good job!"); } else { @@ -247,7 +247,7 @@ private void printProblems(List problems, AbstractLinter lint } } - private void printProblemsAsJson(Collection problems, AbstractLinter linter) { + private void printProblemsAsJson(Collection problems, AbstractLinter linter) { try { ObjectMapper mapper = new ObjectMapper(); String jsonOutput = mapper.writeValueAsString(problems.stream().map(problem -> { @@ -266,7 +266,7 @@ private void printProblemsAsJson(Collection problems, Abstrac } } - private String formatProblem(Problem problem, AbstractLinter linter) { + private String formatProblem(AbstractProblem problem, AbstractLinter linter) { return String.format("%s %s (Source: %s)", problem.getDisplayLocation(), linter.translateMessage(problem.getExplanation()), diff --git a/autograder-core/src/main/java/de/firemage/autograder/core/CodeLinter.java b/autograder-core/src/main/java/de/firemage/autograder/core/CodeLinter.java index fe3ee98b..31fc0aa8 100644 --- a/autograder-core/src/main/java/de/firemage/autograder/core/CodeLinter.java +++ b/autograder-core/src/main/java/de/firemage/autograder/core/CodeLinter.java @@ -23,7 +23,7 @@ public interface CodeLinter { * @return a list of problems found in the submission * @throws IOException if an I/O error occurs */ - List lint( + List lint( UploadedFile submission, AbstractTempLocation tempLocation, ClassLoader classLoader, diff --git a/autograder-core/src/main/java/de/firemage/autograder/core/Linter.java b/autograder-core/src/main/java/de/firemage/autograder/core/Linter.java index 4ae38942..4b4f3bc2 100644 --- a/autograder-core/src/main/java/de/firemage/autograder/core/Linter.java +++ b/autograder-core/src/main/java/de/firemage/autograder/core/Linter.java @@ -3,7 +3,7 @@ import de.firemage.autograder.api.CheckConfiguration; import de.firemage.autograder.api.AbstractLinter; import de.firemage.autograder.api.LinterException; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.api.Translatable; import de.firemage.autograder.core.check.Check; @@ -65,7 +65,7 @@ public Linter( throw new IllegalStateException(e); } - this.tempLocation = builder.getTempLocation() != null ? builder.getTempLocation() : new TempLocation(); + this.tempLocation = builder.getTempLocation() != null ? builder.getTempLocation() : TempLocation.random(); this.threads = builder.getThreads(); this.classLoader = builder.getClassLoader(); this.maxProblemsPerCheck = builder.getMaxProblemsPerCheck(); @@ -76,13 +76,13 @@ public FluentBundle getFluentBundle() { } @Override - public List checkFile(Path file, JavaVersion version, CheckConfiguration checkConfiguration, Consumer statusConsumer) throws LinterException, IOException { + public List checkFile(Path file, JavaVersion version, CheckConfiguration checkConfiguration, Consumer statusConsumer) throws LinterException, IOException { try (var uploadedFile = UploadedFile.build(file, version, this.tempLocation, statusConsumer, this.classLoader)) { return this.checkFile(uploadedFile, checkConfiguration, statusConsumer); } } - public List checkFile( + public List checkFile( UploadedFile file, CheckConfiguration checkConfiguration, Consumer statusConsumer @@ -101,7 +101,7 @@ private static List castUnsafe(Iterable list, Class clazz return result; } - public List checkFile( + public List checkFile( UploadedFile file, CheckConfiguration checkConfiguration, Iterable checks, @@ -178,20 +178,20 @@ public List checkFile( return this.mergeProblems(unreducedProblems); } - private List mergeProblems(Collection unreducedProblems) { + private List mergeProblems(Collection unreducedProblems) { // -1 means no limit (useful for unit tests, where one wants to see all problems) if (this.maxProblemsPerCheck == -1) { return new ArrayList<>(unreducedProblems); } // first group all problems by the check that created them - Map> problems = unreducedProblems.stream() - .collect(Collectors.groupingBy(ProblemImpl::getCheck, LinkedHashMap::new, Collectors.toList())); + Map> problems = unreducedProblems.stream() + .collect(Collectors.groupingBy(Problem::getCheck, LinkedHashMap::new, Collectors.toList())); - List result = new ArrayList<>(); - for (Map.Entry> entry : problems.entrySet()) { + List result = new ArrayList<>(); + for (Map.Entry> entry : problems.entrySet()) { Check check = entry.getKey(); - List problemsForCheck = entry.getValue(); + List problemsForCheck = entry.getValue(); int targetNumberOfProblems = Math.min( this.maxProblemsPerCheck, @@ -202,8 +202,8 @@ private List mergeProblems(Collection unredu if (problemsForCheck.size() > targetNumberOfProblems) { // further partition the problems by their ProblemType // (one does not want to merge different types of problems): - Map> problemsByType = problemsForCheck.stream() - .collect(Collectors.groupingBy(Problem::getProblemType, LinkedHashMap::new, Collectors.toList())); + Map> problemsByType = problemsForCheck.stream() + .collect(Collectors.groupingBy(AbstractProblem::getProblemType, LinkedHashMap::new, Collectors.toList())); problemsForCheck = problemsByType.values() .stream() diff --git a/autograder-core/src/main/java/de/firemage/autograder/core/MultiInCodeProblem.java b/autograder-core/src/main/java/de/firemage/autograder/core/MultiInCodeProblem.java index 6a24d54c..48c0018e 100644 --- a/autograder-core/src/main/java/de/firemage/autograder/core/MultiInCodeProblem.java +++ b/autograder-core/src/main/java/de/firemage/autograder/core/MultiInCodeProblem.java @@ -12,11 +12,11 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -public class MultiInCodeProblem extends ProblemImpl { +public class MultiInCodeProblem extends Problem { public MultiInCodeProblem( - ProblemImpl firstProblem, - Collection otherProblems + Problem firstProblem, + Collection otherProblems ) { super( firstProblem.getCheck(), @@ -26,7 +26,7 @@ public MultiInCodeProblem( ); } - private static Translatable makeExplanation(ProblemImpl first, Collection problems) { + private static Translatable makeExplanation(Problem first, Collection problems) { return bundle -> { String message = first.getExplanation().format(bundle); if (!message.endsWith(".")) { @@ -39,7 +39,7 @@ private static Translatable makeExplanation(ProblemImpl first, Collection merge(List problems, int limit) { + default List merge(List problems, int limit) { // use a dumb algorithm: keep the first limit - 1 problems, and merge the rest into a single problem if (problems.size() <= limit) { return problems; } - List result = new ArrayList<>(problems.subList(0, limit - 1)); - List toMerge = problems.subList(limit - 1, problems.size()); + List result = new ArrayList<>(problems.subList(0, limit - 1)); + List toMerge = problems.subList(limit - 1, problems.size()); result.add(new MultiInCodeProblem(toMerge.get(0), toMerge.subList(1, toMerge.size()))); diff --git a/autograder-core/src/main/java/de/firemage/autograder/core/file/TempLocation.java b/autograder-core/src/main/java/de/firemage/autograder/core/file/TempLocation.java index c3c4e161..9b027df1 100644 --- a/autograder-core/src/main/java/de/firemage/autograder/core/file/TempLocation.java +++ b/autograder-core/src/main/java/de/firemage/autograder/core/file/TempLocation.java @@ -14,6 +14,14 @@ public record TempLocation(File tempLocation) implements AbstractTempLocation { private static final Random RANDOM = new Random(); private static final String TEMPORARY_DIR_FORMAT = "%s%d"; + public static TempLocation random() { + return new TempLocation(); + } + + public static TempLocation of(Path path) { + return new TempLocation(path); + } + public TempLocation(Path path) { this(path.toFile()); } @@ -22,6 +30,9 @@ public TempLocation(String first, String... other) { this(Path.of(first, other).toFile()); } + /** + * Creates a new random temporary location (same as {@link TempLocation#random()}). + */ public TempLocation() { this(tryCreateTempDirectory()); } diff --git a/autograder-core/src/main/java/de/firemage/autograder/core/integrated/IntegratedAnalysis.java b/autograder-core/src/main/java/de/firemage/autograder/core/integrated/IntegratedAnalysis.java index c9df643d..85f114ca 100644 --- a/autograder-core/src/main/java/de/firemage/autograder/core/integrated/IntegratedAnalysis.java +++ b/autograder-core/src/main/java/de/firemage/autograder/core/integrated/IntegratedAnalysis.java @@ -4,7 +4,7 @@ import de.firemage.autograder.core.CodeLinter; import de.firemage.autograder.core.LinterStatus; import de.firemage.autograder.api.AbstractTempLocation; -import de.firemage.autograder.core.ProblemImpl; +import de.firemage.autograder.core.Problem; import de.firemage.autograder.core.file.UploadedFile; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -63,7 +63,7 @@ public Class supportedCheckType() { } @Override - public List lint( + public List lint( UploadedFile submission, AbstractTempLocation tempLocation, ClassLoader classLoader, @@ -77,7 +77,7 @@ public List lint( statusConsumer.accept(LinterStatus.RUNNING_INTEGRATED_CHECKS.getMessage()); - List result = new ArrayList<>(); + List result = new ArrayList<>(); for (IntegratedCheck check : checks) { long beforeTime = System.nanoTime(); result.addAll(check.run( diff --git a/autograder-core/src/main/java/de/firemage/autograder/core/integrated/IntegratedCheck.java b/autograder-core/src/main/java/de/firemage/autograder/core/integrated/IntegratedCheck.java index 5e460c83..2d383778 100644 --- a/autograder-core/src/main/java/de/firemage/autograder/core/integrated/IntegratedCheck.java +++ b/autograder-core/src/main/java/de/firemage/autograder/core/integrated/IntegratedCheck.java @@ -1,7 +1,7 @@ package de.firemage.autograder.core.integrated; import de.firemage.autograder.core.CodePosition; -import de.firemage.autograder.core.ProblemImpl; +import de.firemage.autograder.core.Problem; import de.firemage.autograder.core.LocalizedMessage; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.api.Translatable; @@ -13,7 +13,7 @@ import java.util.List; public abstract class IntegratedCheck implements Check { - private final List problems = new ArrayList<>(); + private final List problems = new ArrayList<>(); private SourceInfo sourceInfo; protected IntegratedCheck() {} @@ -23,10 +23,10 @@ protected void addLocalProblem(CtElement element, Translatable explanation, Prob } protected void addLocalProblem(CodePosition position, Translatable explanation, ProblemType problemType) { - this.problems.add(new ProblemImpl(this, position, explanation, problemType) {}); + this.problems.add(new Problem(this, position, explanation, problemType) {}); } - public List run(StaticAnalysis staticAnalysis, SourceInfo sourceInfo) { + public List run(StaticAnalysis staticAnalysis, SourceInfo sourceInfo) { this.problems.clear(); this.sourceInfo = sourceInfo; this.check(staticAnalysis); diff --git a/autograder-core/src/main/java/de/firemage/autograder/core/integrated/IntegratedInCodeProblem.java b/autograder-core/src/main/java/de/firemage/autograder/core/integrated/IntegratedInCodeProblem.java index b382f657..d31c1bf0 100644 --- a/autograder-core/src/main/java/de/firemage/autograder/core/integrated/IntegratedInCodeProblem.java +++ b/autograder-core/src/main/java/de/firemage/autograder/core/integrated/IntegratedInCodeProblem.java @@ -1,14 +1,14 @@ package de.firemage.autograder.core.integrated; import de.firemage.autograder.core.CodePosition; -import de.firemage.autograder.core.ProblemImpl; +import de.firemage.autograder.core.Problem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.api.Translatable; import de.firemage.autograder.core.check.Check; import de.firemage.autograder.core.file.SourceInfo; import spoon.reflect.declaration.CtElement; -public class IntegratedInCodeProblem extends ProblemImpl { +public class IntegratedInCodeProblem extends Problem { private final CtElement element; public IntegratedInCodeProblem(Check check, CtElement element, Translatable explanation, diff --git a/autograder-core/src/main/java/de/firemage/autograder/core/parallel/AnalysisResult.java b/autograder-core/src/main/java/de/firemage/autograder/core/parallel/AnalysisResult.java index 433668a0..9669acb8 100644 --- a/autograder-core/src/main/java/de/firemage/autograder/core/parallel/AnalysisResult.java +++ b/autograder-core/src/main/java/de/firemage/autograder/core/parallel/AnalysisResult.java @@ -1,13 +1,12 @@ package de.firemage.autograder.core.parallel; -import de.firemage.autograder.api.Problem; -import de.firemage.autograder.core.ProblemImpl; +import de.firemage.autograder.core.Problem; import java.util.List; import java.util.Objects; -public record AnalysisResult(List problems, Exception thrownException) { - public static AnalysisResult forSuccess(List problems) { +public record AnalysisResult(List problems, Exception thrownException) { + public static AnalysisResult forSuccess(List problems) { Objects.requireNonNull(problems); return new AnalysisResult(problems, null); } diff --git a/autograder-core/src/main/java/de/firemage/autograder/core/parallel/AnalysisScheduler.java b/autograder-core/src/main/java/de/firemage/autograder/core/parallel/AnalysisScheduler.java index 6bc0853c..a8f6402d 100644 --- a/autograder-core/src/main/java/de/firemage/autograder/core/parallel/AnalysisScheduler.java +++ b/autograder-core/src/main/java/de/firemage/autograder/core/parallel/AnalysisScheduler.java @@ -1,7 +1,6 @@ package de.firemage.autograder.core.parallel; -import de.firemage.autograder.api.Problem; -import de.firemage.autograder.core.ProblemImpl; +import de.firemage.autograder.core.Problem; import java.util.ArrayDeque; import java.util.ArrayList; @@ -82,7 +81,7 @@ public AnalysisResult collectProblems() { private AnalysisResult collectProblemsFromThreads() { this.completionAllowed = true; - List allProblems = new ArrayList<>(); + List allProblems = new ArrayList<>(); for (var thread : this.analysisThreads) { try { var result = thread.join(); @@ -101,16 +100,16 @@ private AnalysisResult collectProblemsFromThreads() { } private AnalysisResult executeChecksSingleThreaded() { - List allProblems = new ArrayList<>(); + List allProblems = new ArrayList<>(); var reporter = new ProblemReporter() { @Override - public void reportProblem(ProblemImpl problem) { + public void reportProblem(Problem problem) { allProblems.add(problem); } @Override - public void reportProblems(Collection problems) { + public void reportProblems(Collection problems) { allProblems.addAll(problems); } }; diff --git a/autograder-core/src/main/java/de/firemage/autograder/core/parallel/AnalysisThread.java b/autograder-core/src/main/java/de/firemage/autograder/core/parallel/AnalysisThread.java index 4359088f..f18ab505 100644 --- a/autograder-core/src/main/java/de/firemage/autograder/core/parallel/AnalysisThread.java +++ b/autograder-core/src/main/java/de/firemage/autograder/core/parallel/AnalysisThread.java @@ -1,7 +1,6 @@ package de.firemage.autograder.core.parallel; -import de.firemage.autograder.api.Problem; -import de.firemage.autograder.core.ProblemImpl; +import de.firemage.autograder.core.Problem; import java.util.ArrayList; import java.util.Collection; @@ -10,7 +9,7 @@ public class AnalysisThread { private final AnalysisScheduler scheduler; private final Thread thread; - private final List reportedProblems; + private final List reportedProblems; private Exception thrownException; public AnalysisThread(AnalysisScheduler scheduler, int threadIndex) { @@ -26,12 +25,12 @@ private void run() { var reporter = new ProblemReporter() { @Override - public void reportProblem(ProblemImpl problem) { + public void reportProblem(Problem problem) { reportedProblems.add(problem); } @Override - public void reportProblems(Collection problems) { + public void reportProblems(Collection problems) { reportedProblems.addAll(problems); } }; diff --git a/autograder-core/src/main/java/de/firemage/autograder/core/parallel/ProblemReporter.java b/autograder-core/src/main/java/de/firemage/autograder/core/parallel/ProblemReporter.java index 4740c438..015eb713 100644 --- a/autograder-core/src/main/java/de/firemage/autograder/core/parallel/ProblemReporter.java +++ b/autograder-core/src/main/java/de/firemage/autograder/core/parallel/ProblemReporter.java @@ -1,11 +1,10 @@ package de.firemage.autograder.core.parallel; -import de.firemage.autograder.api.Problem; -import de.firemage.autograder.core.ProblemImpl; +import de.firemage.autograder.core.Problem; import java.util.Collection; public interface ProblemReporter { - void reportProblem(ProblemImpl problem); - void reportProblems(Collection problems); + void reportProblem(Problem problem); + void reportProblems(Collection problems); } diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/CheckTest.java b/autograder-core/src/test/java/de/firemage/autograder/core/CheckTest.java index d4a387fc..3a1784db 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/CheckTest.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/CheckTest.java @@ -94,7 +94,7 @@ Stream createCheckTest() throws URISyntaxException, IOException { folders = paths.toList(); } - AbstractTempLocation tempLocation = new TempLocation(); + AbstractTempLocation tempLocation = TempLocation.random(); return DynamicTest.stream( folders.stream().map(TestInput::fromPath) diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/AbstractCheckTest.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/AbstractCheckTest.java index a463f5c8..634603be 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/AbstractCheckTest.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/AbstractCheckTest.java @@ -4,9 +4,9 @@ import de.firemage.autograder.api.AbstractLinter; import de.firemage.autograder.core.Linter; import de.firemage.autograder.api.LinterException; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; -import de.firemage.autograder.core.ProblemImpl; +import de.firemage.autograder.core.Problem; import de.firemage.autograder.core.file.SourceInfo; import de.firemage.autograder.api.AbstractTempLocation; import de.firemage.autograder.core.file.TempLocation; @@ -30,7 +30,7 @@ protected AbstractCheckTest() { } protected AbstractCheckTest(int limit) { - this(new TempLocation(), limit); + this(TempLocation.random(), limit); } private AbstractCheckTest(AbstractTempLocation tempLocation, int limit) { @@ -41,7 +41,7 @@ private AbstractCheckTest(AbstractTempLocation tempLocation, int limit) { .threads(1)); } - protected List check( + protected List check( SourceInfo sourceInfo, List problemTypes ) throws LinterException, IOException { @@ -61,11 +61,11 @@ protected ProblemIterator checkIterator( return new ProblemIterator(this.check(sourceInfo, problemTypes)); } - public static final class ProblemIterator implements Iterator { - private final List problems; + public static final class ProblemIterator implements Iterator { + private final List problems; private int index; - private ProblemIterator(List problems) { + private ProblemIterator(List problems) { this.problems = problems; this.index = 0; } @@ -76,7 +76,7 @@ public boolean hasNext() { } @Override - public Problem next() throws NoSuchElementException { + public AbstractProblem next() throws NoSuchElementException { if (!this.hasNext()) { throw new NoSuchElementException( "Expected at least %d problems, but got %d. Problems: %s".formatted( diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestAvoidStringConcat.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestAvoidStringConcat.java index 297a9a18..333ee7ac 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestAvoidStringConcat.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestAvoidStringConcat.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -19,7 +19,7 @@ class TestAvoidStringConcat extends AbstractCheckTest { private static final String LOCALIZED_MESSAGE_KEY = "common-reimplementation"; private static final List PROBLEM_TYPES = List.of(ProblemType.AVOID_STRING_CONCAT); - private void assertEqualsConcat(Problem problem, String suggestion) { + private void assertEqualsConcat(AbstractProblem problem, String suggestion) { assertEquals( this.linter.translateMessage( new LocalizedMessage( diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestCheckIterableDuplicates.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestCheckIterableDuplicates.java index 8ae92cc3..240e0751 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestCheckIterableDuplicates.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestCheckIterableDuplicates.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -19,7 +19,7 @@ class TestCheckIterableDuplicates extends AbstractCheckTest { private static final String LOCALIZED_MESSAGE_KEY = "common-reimplementation"; private static final List PROBLEM_TYPES = List.of(ProblemType.COMMON_REIMPLEMENTATION_ITERABLE_DUPLICATES); - private void assertReimplementation(Problem problem, String suggestion) { + private void assertReimplementation(AbstractProblem problem, String suggestion) { assertEquals( this.linter.translateMessage( new LocalizedMessage( diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestCollectionAddAll.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestCollectionAddAll.java index c26b7e0f..d97e5e5b 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestCollectionAddAll.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestCollectionAddAll.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -22,7 +22,7 @@ class TestCollectionAddAll extends AbstractCheckTest { ProblemType.COMMON_REIMPLEMENTATION_ADD_ALL ); - private void assertEqualsReimplementation(Problem problem, String suggestion) { + private void assertEqualsReimplementation(AbstractProblem problem, String suggestion) { assertEquals( this.linter.translateMessage( new LocalizedMessage( diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestCollectionsNCopies.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestCollectionsNCopies.java index 2a1eba48..9615d8b2 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestCollectionsNCopies.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestCollectionsNCopies.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -19,7 +19,7 @@ class TestCollectionsNCopies extends AbstractCheckTest { private static final String LOCALIZED_MESSAGE_KEY = "common-reimplementation"; private static final List PROBLEM_TYPES = List.of(ProblemType.COLLECTIONS_N_COPIES); - private void assertReimplementation(Problem problem, String suggestion) { + private void assertReimplementation(AbstractProblem problem, String suggestion) { assertEquals( this.linter.translateMessage( new LocalizedMessage( diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestImplementComparable.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestImplementComparable.java index 343d53a5..4bfe2d15 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestImplementComparable.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestImplementComparable.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -18,7 +18,7 @@ class TestImplementComparable extends AbstractCheckTest { private static final List PROBLEM_TYPES = List.of(ProblemType.IMPLEMENT_COMPARABLE); - void assertImplement(Problem problem, String name) { + void assertImplement(AbstractProblem problem, String name) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "implement-comparable", diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestIsEmptyReimplementationCheck.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestIsEmptyReimplementationCheck.java index 00babec7..90bc776f 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestIsEmptyReimplementationCheck.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestIsEmptyReimplementationCheck.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -23,7 +23,7 @@ class TestIsEmptyReimplementationCheck extends AbstractCheckTest { ProblemType.COLLECTION_IS_EMPTY_REIMPLEMENTED ); - void assertEqualsIsEmpty(String original, String suggestion, Problem problem) { + void assertEqualsIsEmpty(String original, String suggestion, AbstractProblem problem) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "suggest-replacement", diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestMathReimplementation.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestMathReimplementation.java index 5616f50d..032d8e4c 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestMathReimplementation.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestMathReimplementation.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -23,7 +23,7 @@ class TestMathReimplementation extends AbstractCheckTest { ProblemType.COMMON_REIMPLEMENTATION_MAX_MIN ); - private void assertEqualsReimplementation(Problem problem, String suggestion) { + private void assertEqualsReimplementation(AbstractProblem problem, String suggestion) { assertEquals( this.linter.translateMessage( new LocalizedMessage( diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestSimplifyArraysFill.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestSimplifyArraysFill.java index 7306cb2a..cb660b7c 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestSimplifyArraysFill.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestSimplifyArraysFill.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -19,7 +19,7 @@ class TestSimplifyArraysFill extends AbstractCheckTest { private static final String LOCALIZED_MESSAGE_KEY = "common-reimplementation"; private static final List PROBLEM_TYPES = List.of(ProblemType.SIMPLIFY_ARRAYS_FILL); - private void assertReimplementation(Problem problem, String suggestion) { + private void assertReimplementation(AbstractProblem problem, String suggestion) { assertEquals( this.linter.translateMessage( new LocalizedMessage( diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestStringRepeat.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestStringRepeat.java index 5d1f224b..07373db1 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestStringRepeat.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestStringRepeat.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -18,7 +18,7 @@ class TestStringRepeat extends AbstractCheckTest { private static final List PROBLEM_TYPES = List.of(ProblemType.COMMON_REIMPLEMENTATION_STRING_REPEAT); - private void assertReimplementation(Problem problem, String suggestion) { + private void assertReimplementation(AbstractProblem problem, String suggestion) { assertEquals( this.linter.translateMessage( new LocalizedMessage( diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestUseArrayCopy.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestUseArrayCopy.java index ba03bf10..5d7f9b9a 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestUseArrayCopy.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestUseArrayCopy.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -18,7 +18,7 @@ class TestUseArrayCopy extends AbstractCheckTest { private static final List PROBLEM_TYPES = List.of(ProblemType.COMMON_REIMPLEMENTATION_ARRAY_COPY); - private void assertEqualsReimplementation(Problem problem, String suggestion) { + private void assertEqualsReimplementation(AbstractProblem problem, String suggestion) { assertEquals( this.linter.translateMessage( new LocalizedMessage( diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestUseArraysFill.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestUseArraysFill.java index 5779a539..d719464e 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestUseArraysFill.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestUseArraysFill.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -18,7 +18,7 @@ class TestUseArraysFill extends AbstractCheckTest { private static final List PROBLEM_TYPES = List.of(ProblemType.COMMON_REIMPLEMENTATION_ARRAYS_FILL); - private void assertEqualsReimplementation(Problem problem, String suggestion) { + private void assertEqualsReimplementation(AbstractProblem problem, String suggestion) { assertEquals( this.linter.translateMessage( new LocalizedMessage( diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestUseEnumValues.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestUseEnumValues.java index 95b318e3..03c16afe 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestUseEnumValues.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestUseEnumValues.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.file.StringSourceInfo; import de.firemage.autograder.core.check.AbstractCheckTest; @@ -18,7 +18,7 @@ class TestUseEnumValues extends AbstractCheckTest { private static final List PROBLEM_TYPES = List.of(ProblemType.COMMON_REIMPLEMENTATION_ADD_ENUM_VALUES); - private void assertEqualsReimplementation(Problem problem, String suggestion) { + private void assertEqualsReimplementation(AbstractProblem problem, String suggestion) { assertEquals( this.linter.translateMessage( new LocalizedMessage( diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestUseFormatString.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestUseFormatString.java index 009959d1..7e7a2963 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestUseFormatString.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestUseFormatString.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.file.StringSourceInfo; import de.firemage.autograder.core.check.AbstractCheckTest; @@ -19,7 +19,7 @@ class TestUseFormatString extends AbstractCheckTest { private static final String LOCALIZED_MESSAGE_KEY = "use-format-string"; private static final List PROBLEM_TYPES = List.of(ProblemType.USE_FORMAT_STRING); - void assertUseFormatString(String expected, Problem problem) { + void assertUseFormatString(String expected, AbstractProblem problem) { assertEquals(ProblemType.USE_FORMAT_STRING, problem.getProblemType()); assertEquals( this.linter.translateMessage( diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestUseModuloOperator.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestUseModuloOperator.java index 2eba0846..496c1bbe 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestUseModuloOperator.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestUseModuloOperator.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -18,7 +18,7 @@ class TestUseModuloOperator extends AbstractCheckTest { private static final List PROBLEM_TYPES = List.of(ProblemType.USE_MODULO_OPERATOR); - private void assertReimplementation(Problem problem, String suggestion) { + private void assertReimplementation(AbstractProblem problem, String suggestion) { assertEquals( this.linter.translateMessage( new LocalizedMessage( @@ -67,7 +67,7 @@ public static int adjust(int value, int limit) { ); for (String expectedSuggestion : expectedSuggestions) { - Problem problem = problems.next(); + AbstractProblem problem = problems.next(); assertReimplementation(problem, expectedSuggestion); } diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestUseStringFormatted.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestUseStringFormatted.java index 40233834..259d7dcc 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestUseStringFormatted.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestUseStringFormatted.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -18,7 +18,7 @@ class TestUseStringFormatted extends AbstractCheckTest { private static final List PROBLEM_TYPES = List.of(ProblemType.USE_STRING_FORMATTED); - void assertUseFormatString(Problem problem, String suggestion) { + void assertUseFormatString(AbstractProblem problem, String suggestion) { assertEquals( this.linter.translateMessage( new LocalizedMessage( diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestUseSubList.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestUseSubList.java index a1ab4ad1..b24875db 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestUseSubList.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/api/TestUseSubList.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -18,7 +18,7 @@ class TestUseSubList extends AbstractCheckTest { private static final List PROBLEM_TYPES = List.of(ProblemType.COMMON_REIMPLEMENTATION_SUBLIST); - private void assertEqualsReimplementation(Problem problem, String suggestion) { + private void assertEqualsReimplementation(AbstractProblem problem, String suggestion) { assertEquals( this.linter.translateMessage( new LocalizedMessage( diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/comment/TestCommentedOutCodeCheck.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/comment/TestCommentedOutCodeCheck.java index db1a31b0..9b3aafaf 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/comment/TestCommentedOutCodeCheck.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/comment/TestCommentedOutCodeCheck.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -17,7 +17,7 @@ class TestCommentedOutCodeCheck extends AbstractCheckTest { private static final List PROBLEM_TYPES = List.of(ProblemType.COMMENTED_OUT_CODE); - void assertEqualsCode(Problem problem, int startLine, int endLine) { + void assertEqualsCode(AbstractProblem problem, int startLine, int endLine) { assertEquals( this.linter.translateMessage(new LocalizedMessage("commented-out-code")), this.linter.translateMessage(problem.getExplanation()) diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/comment/TestFieldJavadocCheck.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/comment/TestFieldJavadocCheck.java index 01da962a..2db2d07d 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/comment/TestFieldJavadocCheck.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/comment/TestFieldJavadocCheck.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -22,7 +22,7 @@ class TestFieldJavadocCheck extends AbstractCheckTest { private static final List PROBLEM_TYPES = List.of(ProblemType.JAVADOC_UNEXPECTED_TAG); - void assertEqualsUnknownTag(Problem problem, String tag) { + void assertEqualsUnknownTag(AbstractProblem problem, String tag) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "javadoc-unexpected-tag", diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/comment/TestMethodJavadocCheck.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/comment/TestMethodJavadocCheck.java index 24686b36..70d6c810 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/comment/TestMethodJavadocCheck.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/comment/TestMethodJavadocCheck.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -26,7 +26,7 @@ class TestMethodJavadocCheck extends AbstractCheckTest { ProblemType.JAVADOC_UNEXPECTED_TAG ); - void assertEqualsMissing(Problem problem, String param) { + void assertEqualsMissing(AbstractProblem problem, String param) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "javadoc-method-exp-param-missing", @@ -36,7 +36,7 @@ void assertEqualsMissing(Problem problem, String param) { ); } - void assertEqualsUnknownParam(Problem problem, String param) { + void assertEqualsUnknownParam(AbstractProblem problem, String param) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "javadoc-method-exp-param-unknown", @@ -46,7 +46,7 @@ void assertEqualsUnknownParam(Problem problem, String param) { ); } - void assertEqualsUnknownTag(Problem problem, String tag) { + void assertEqualsUnknownTag(AbstractProblem problem, String tag) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "javadoc-unexpected-tag", diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/comment/TestUnnecessaryComment.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/comment/TestUnnecessaryComment.java index e04f8510..a90f6798 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/comment/TestUnnecessaryComment.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/comment/TestUnnecessaryComment.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -17,7 +17,7 @@ class TestUnnecessaryComment extends AbstractCheckTest { private static final List PROBLEM_TYPES = List.of(ProblemType.UNNECESSARY_COMMENT); - void assertEqualsEmpty(Problem problem) { + void assertEqualsEmpty(AbstractProblem problem) { assertEquals( this.linter.translateMessage(new LocalizedMessage("unnecessary-comment-empty")), this.linter.translateMessage(problem.getExplanation()) diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestExtendsObjectCheck.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestExtendsObjectCheck.java index 99d06661..5374d16a 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestExtendsObjectCheck.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestExtendsObjectCheck.java @@ -3,7 +3,7 @@ import de.firemage.autograder.api.JavaVersion; import de.firemage.autograder.api.LinterException; import de.firemage.autograder.api.ProblemType; -import de.firemage.autograder.core.ProblemImpl; +import de.firemage.autograder.core.Problem; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.core.file.StringSourceInfo; import org.junit.jupiter.api.Test; @@ -16,7 +16,7 @@ class TestExtendsObjectCheck extends AbstractCheckTest { @Test void testExtendsObject() throws LinterException, IOException { - List problems = super.check(StringSourceInfo.fromSourceString( + List problems = super.check(StringSourceInfo.fromSourceString( JavaVersion.JAVA_17, "Test", "public class Test extends Object {}" @@ -29,7 +29,7 @@ void testExtendsObject() throws LinterException, IOException { @Test void testNotExtendsObject() throws LinterException, IOException { - List problems = super.check(StringSourceInfo.fromSourceString( + List problems = super.check(StringSourceInfo.fromSourceString( JavaVersion.JAVA_17, "Test", "public class Test {}" diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestRedundantAssignment.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestRedundantAssignment.java index 02df5104..ed44366d 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestRedundantAssignment.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestRedundantAssignment.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -18,7 +18,7 @@ class TestRedundantAssignment extends AbstractCheckTest { private static final List PROBLEM_TYPES = List.of(ProblemType.REDUNDANT_ASSIGNMENT); - void assertEqualsRedundant(Problem problem, String variable) { + void assertEqualsRedundant(AbstractProblem problem, String variable) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "redundant-assignment", diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestRedundantConstructor.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestRedundantConstructor.java index 1f42814b..c851e92c 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestRedundantConstructor.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestRedundantConstructor.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -363,7 +363,7 @@ private void assertRedundant(SourceInfo info, boolean redundant) throws LinterEx problems.assertExhausted(); } - private void assertEqualsRedundant(Problem problem) { + private void assertEqualsRedundant(AbstractProblem problem) { assertEquals( this.linter.translateMessage(new LocalizedMessage("implicit-constructor-exp")), this.linter.translateMessage(problem.getExplanation()) diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestRedundantElse.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestRedundantElse.java index 648f209b..647fb4f1 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestRedundantElse.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestRedundantElse.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -18,7 +18,7 @@ class TestRedundantElse extends AbstractCheckTest { private static final List PROBLEM_TYPES = List.of(ProblemType.REDUNDANT_ELSE); - void assertRedundantElse(Problem problem, String value) { + void assertRedundantElse(AbstractProblem problem, String value) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "redundant-else", @@ -31,7 +31,7 @@ void assertRedundantElse(Problem problem, String value) { ); } - void assertRedundantElseIf(Problem problem, String value) { + void assertRedundantElseIf(AbstractProblem problem, String value) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "redundant-else", diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestRedundantIfForBooleanCheck.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestRedundantIfForBooleanCheck.java index 78468d3a..813c702b 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestRedundantIfForBooleanCheck.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestRedundantIfForBooleanCheck.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -18,7 +18,7 @@ class TestRedundantIfForBooleanCheck extends AbstractCheckTest { private static final List PROBLEM_TYPES = List.of(ProblemType.REDUNDANT_IF_FOR_BOOLEAN); - void assertEqualsRedundant(Problem problem, String suggestion) { + void assertEqualsRedundant(AbstractProblem problem, String suggestion) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "common-reimplementation", diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestRedundantModifier.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestRedundantModifier.java index b325a78b..d191a452 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestRedundantModifier.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestRedundantModifier.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -18,7 +18,7 @@ class TestRedundantModifier extends AbstractCheckTest { private static final List PROBLEM_TYPES = List.of(ProblemType.REDUNDANT_MODIFIER); - void assertEqualsRedundant(Problem problem, String... modifiers) { + void assertEqualsRedundant(AbstractProblem problem, String... modifiers) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "redundant-modifier", diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestRedundantNegationCheck.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestRedundantNegationCheck.java index 52282706..c95c67d6 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestRedundantNegationCheck.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestRedundantNegationCheck.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -20,7 +20,7 @@ class TestRedundantNegationCheck extends AbstractCheckTest { private static final List PROBLEM_TYPES = List.of(ProblemType.REDUNDANT_NEGATION); - void assertEqualsRedundant(Problem problem, String suggestion) { + void assertEqualsRedundant(AbstractProblem problem, String suggestion) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "common-reimplementation", diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestRedundantUninitializedVariable.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestRedundantUninitializedVariable.java index 236fc8f6..91906a1c 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestRedundantUninitializedVariable.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestRedundantUninitializedVariable.java @@ -3,7 +3,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; import de.firemage.autograder.api.ProblemType; -import de.firemage.autograder.core.ProblemImpl; +import de.firemage.autograder.core.Problem; import de.firemage.autograder.core.file.StringSourceInfo; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -20,7 +20,7 @@ class TestRedundantUninitializedVariable extends AbstractCheckTest { @Test void testMessage() throws LinterException, IOException { - List problems = super.check(StringSourceInfo.fromSourceString( + List problems = super.check(StringSourceInfo.fromSourceString( JavaVersion.JAVA_17, "Test", "public class Test { void foo() { final String i; /* some comment */ i = \"hello\"; } }" diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestRedundantVariable.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestRedundantVariable.java index 10b13a3b..96772dd5 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestRedundantVariable.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestRedundantVariable.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -18,7 +18,7 @@ class TestRedundantVariable extends AbstractCheckTest { private static final List PROBLEM_TYPES = List.of(ProblemType.REDUNDANT_VARIABLE); - void assertEqualsRedundant(Problem problem, String name, String suggestion) { + void assertEqualsRedundant(AbstractProblem problem, String name, String suggestion) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "redundant-variable", diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestRepeatedMathOperationCheck.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestRepeatedMathOperationCheck.java index 2ce2a1ff..f7a575bf 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestRepeatedMathOperationCheck.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestRepeatedMathOperationCheck.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -18,7 +18,7 @@ class TestRepeatedMathOperationCheck extends AbstractCheckTest { private static final List PROBLEM_TYPES = List.of(ProblemType.REPEATED_MATH_OPERATION); - void assertEqualsRepeat(String suggestion, Problem problem) { + void assertEqualsRepeat(String suggestion, AbstractProblem problem) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "common-reimplementation", diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestTooManyExceptions.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestTooManyExceptions.java index f0366018..f575e2ed 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestTooManyExceptions.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestTooManyExceptions.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -26,7 +26,7 @@ class TestTooManyExceptions extends AbstractCheckTest { "InvalidPlayerException", "InvalidMoveException", "InvalidPositionException" ); - void assertEqualsTooMany(Problem problem, int count) { + void assertEqualsTooMany(AbstractProblem problem, int count) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "too-many-exceptions", diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestTryCatchComplexity.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestTryCatchComplexity.java index 02193554..d528a2f0 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestTryCatchComplexity.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestTryCatchComplexity.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -17,7 +17,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; class TestTryCatchComplexity extends AbstractCheckTest { - void assertEqualsTryCatchComplexity(Problem problem) { + void assertEqualsTryCatchComplexity(AbstractProblem problem) { assertEquals(ProblemType.TRY_CATCH_COMPLEXITY, problem.getProblemType()); assertEquals( this.linter.translateMessage(new LocalizedMessage( diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestUnnecessaryBoxing.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestUnnecessaryBoxing.java index c95d6721..87630511 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestUnnecessaryBoxing.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestUnnecessaryBoxing.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -18,7 +18,7 @@ class TestUnnecessaryBoxing extends AbstractCheckTest { private static final List PROBLEM_TYPES = List.of(ProblemType.UNNECESSARY_BOXING); - void assertUnnecessary(Problem problem, String original, String suggestion) { + void assertUnnecessary(AbstractProblem problem, String original, String suggestion) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "suggest-replacement", diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestUnusedImport.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestUnusedImport.java index 89201d20..9ec2d0d2 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestUnusedImport.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestUnusedImport.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -21,7 +21,7 @@ class TestUnusedImport extends AbstractCheckTest { private static final List PROBLEM_TYPES = List.of(ProblemType.UNUSED_IMPORT); - void assertUnusedImport(Problem problem, String name) { + void assertUnusedImport(AbstractProblem problem, String name) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "unused-import", diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestWrapperInstantiationCheck.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestWrapperInstantiationCheck.java index 1fb87ca4..5faa3cc3 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestWrapperInstantiationCheck.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/complexity/TestWrapperInstantiationCheck.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -20,7 +20,7 @@ class TestWrapperInstantiationCheck extends AbstractCheckTest { private static final List PROBLEM_TYPES = List.of(ProblemType.PRIMITIVE_WRAPPER_INSTANTIATION); - void assertEqualsInstantiation(Problem problem, String original, String suggestion) { + void assertEqualsInstantiation(AbstractProblem problem, String original, String suggestion) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "suggest-replacement", diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/exceptions/TestCustomExceptionInheritanceCheck.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/exceptions/TestCustomExceptionInheritanceCheck.java index f20b9694..b6325e26 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/exceptions/TestCustomExceptionInheritanceCheck.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/exceptions/TestCustomExceptionInheritanceCheck.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -21,7 +21,7 @@ class TestCustomExceptionInheritanceCheck extends AbstractCheckTest { ProblemType.CUSTOM_EXCEPTION_INHERITS_RUNTIME_EXCEPTION ); - void assertEqualsRuntime(Problem problem, String name) { + void assertEqualsRuntime(AbstractProblem problem, String name) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "custom-exception-inheritance-runtime", @@ -31,7 +31,7 @@ void assertEqualsRuntime(Problem problem, String name) { ); } - void assertEqualsError(Problem problem, String name) { + void assertEqualsError(AbstractProblem problem, String name) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "custom-exception-inheritance-error", diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/exceptions/TestExceptionMessageCheck.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/exceptions/TestExceptionMessageCheck.java index 529eaf2a..cfc470cd 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/exceptions/TestExceptionMessageCheck.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/exceptions/TestExceptionMessageCheck.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -18,7 +18,7 @@ class TestExceptionMessageCheck extends AbstractCheckTest { private static final List PROBLEM_TYPES = List.of(ProblemType.EXCEPTION_WITHOUT_MESSAGE); - void assertMissingMessage(Problem problem) { + void assertMissingMessage(AbstractProblem problem) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "exception-message" diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/exceptions/TestNumberFormatExceptionIgnored.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/exceptions/TestNumberFormatExceptionIgnored.java index 9716cefc..38626eab 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/exceptions/TestNumberFormatExceptionIgnored.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/exceptions/TestNumberFormatExceptionIgnored.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -17,7 +17,7 @@ class TestNumberFormatExceptionIgnored extends AbstractCheckTest { private static final List PROBLEM_TYPES = List.of(ProblemType.NUMBER_FORMAT_EXCEPTION_IGNORED); - void assertEqualsIgnored(Problem problem) { + void assertEqualsIgnored(AbstractProblem problem) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "number-format-exception-ignored" diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestAvoidShadowing.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestAvoidShadowing.java index 99860f0e..6f2e449c 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestAvoidShadowing.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestAvoidShadowing.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -19,7 +19,7 @@ class TestAvoidShadowing extends AbstractCheckTest { private static final String LOCALIZED_MESSAGE_KEY = "avoid-shadowing"; private static final List PROBLEM_TYPES = List.of(ProblemType.AVOID_SHADOWING); - private void assertEqualsHidden(String name, Problem problem) { + private void assertEqualsHidden(String name, AbstractProblem problem) { assertEquals( this.linter.translateMessage( new LocalizedMessage( diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestCompareCharValue.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestCompareCharValue.java index 4adad2fb..c66d1ed0 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestCompareCharValue.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestCompareCharValue.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -19,7 +19,7 @@ class TestCompareCharValue extends AbstractCheckTest { private static final String LOCALIZED_MESSAGE_KEY = "compare-char-value"; private static final List PROBLEM_TYPES = List.of(ProblemType.COMPARE_CHAR_VALUE); - private void assertEqualsCompare(Problem problem, String expression, int intValue, char charValue) { + private void assertEqualsCompare(AbstractProblem problem, String expression, int intValue, char charValue) { assertEquals( this.linter.translateMessage( new LocalizedMessage( diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestFieldShouldBeFinal.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestFieldShouldBeFinal.java index d745d52f..ad349888 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestFieldShouldBeFinal.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestFieldShouldBeFinal.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -19,7 +19,7 @@ class TestFieldShouldBeFinal extends AbstractCheckTest { private static final List PROBLEM_TYPES = List.of(ProblemType.FIELD_SHOULD_BE_FINAL); - void assertFinal(Problem problem, String name) { + void assertFinal(AbstractProblem problem, String name) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "field-should-be-final", diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestForToForEachLoop.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestForToForEachLoop.java index 3b53fdd5..02148c41 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestForToForEachLoop.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestForToForEachLoop.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -18,7 +18,7 @@ class TestForToForEachLoop extends AbstractCheckTest { private static final List PROBLEM_TYPES = List.of(ProblemType.FOR_CAN_BE_FOREACH); - void assertEqualsForEach(Problem problem, String type, String iterable) { + void assertEqualsForEach(AbstractProblem problem, String type, String iterable) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "common-reimplementation", diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestImportTypes.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestImportTypes.java index 29913fec..2f4ae091 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestImportTypes.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestImportTypes.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -18,7 +18,7 @@ class TestImportTypes extends AbstractCheckTest { private static final List PROBLEM_TYPES = List.of(ProblemType.IMPORT_TYPES); - void assertEqualsImport(String typeName, Problem problem) { + void assertEqualsImport(String typeName, AbstractProblem problem) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "import-types", diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestLoopShouldBeDoWhile.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestLoopShouldBeDoWhile.java index a842dbcc..db3aec4f 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestLoopShouldBeDoWhile.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestLoopShouldBeDoWhile.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -23,7 +23,7 @@ private static T debugPrint(T value) { return value; } - void assertEqualsDoWhile(Problem problem, String body, String condition) { + void assertEqualsDoWhile(AbstractProblem problem, String body, String condition) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "loop-should-be-do-while", diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestLoopShouldBeFor.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestLoopShouldBeFor.java index 6f2fd3bd..b1185cdb 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestLoopShouldBeFor.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestLoopShouldBeFor.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -25,7 +25,7 @@ private static T debugPrint(T value) { return value; } - void assertEqualsFor(Problem problem, String init, String condition, String update, String body) { + void assertEqualsFor(AbstractProblem problem, String init, String condition, String update, String body) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "loop-should-be-for", @@ -36,7 +36,7 @@ void assertEqualsFor(Problem problem, String init, String condition, String upda ); } - void assertEqualsFor(Problem problem, String init, String condition, String update, String beforeLoop, String body) { + void assertEqualsFor(AbstractProblem problem, String init, String condition, String update, String beforeLoop, String body) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "loop-should-be-for", diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestMagicString.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestMagicString.java index e4639b21..3e7fc44b 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestMagicString.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestMagicString.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -18,7 +18,7 @@ class TestMagicString extends AbstractCheckTest { private static final List PROBLEM_TYPES = List.of(ProblemType.MAGIC_STRING); - void assertMagicString(Problem problem, String value) { + void assertMagicString(AbstractProblem problem, String value) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "magic-string", diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestObjectDatatype.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestObjectDatatype.java index 922d6e60..9d4b5b61 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestObjectDatatype.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestObjectDatatype.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -18,7 +18,7 @@ class TestObjectDatatype extends AbstractCheckTest { private static final List PROBLEM_TYPES = List.of(ProblemType.OBJECT_DATATYPE); - void assertHasObject(Problem problem, String variable) { + void assertHasObject(AbstractProblem problem, String variable) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "object-datatype", diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestOverrideAnnotationMissing.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestOverrideAnnotationMissing.java index ace83489..098292de 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestOverrideAnnotationMissing.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestOverrideAnnotationMissing.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -18,7 +18,7 @@ class TestOverrideAnnotationMissing extends AbstractCheckTest { private static final List PROBLEM_TYPES = List.of(ProblemType.OVERRIDE_ANNOTATION_MISSING); - void assertMissingOverride(Problem problem, String name) { + void assertMissingOverride(AbstractProblem problem, String name) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "missing-override", diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestReassignedParameterCheck.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestReassignedParameterCheck.java index 0f176289..575735a2 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestReassignedParameterCheck.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestReassignedParameterCheck.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -18,7 +18,7 @@ class TestReassignedParameterCheck extends AbstractCheckTest { private static final List PROBLEM_TYPES = List.of(ProblemType.REASSIGNED_PARAMETER); - void assertEqualsReassigned(Problem problem, String name) { + void assertEqualsReassigned(AbstractProblem problem, String name) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "reassigned-parameter", diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestUseDifferentVisibility.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestUseDifferentVisibility.java index a225ca95..e0711517 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestUseDifferentVisibility.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/general/TestUseDifferentVisibility.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.file.StringSourceInfo; import de.firemage.autograder.core.check.AbstractCheckTest; @@ -23,7 +23,7 @@ class TestUseDifferentVisibility extends AbstractCheckTest { ProblemType.USE_DIFFERENT_VISIBILITY_PUBLIC_FIELD ); - void assertDifferentVisibility(Problem problem, String name, String suggestion) { + void assertDifferentVisibility(AbstractProblem problem, String name, String suggestion) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "use-different-visibility", @@ -33,7 +33,7 @@ void assertDifferentVisibility(Problem problem, String name, String suggestion) ); } - void assertDifferentVisibilityField(Problem problem, String name, String suggestion) { + void assertDifferentVisibilityField(AbstractProblem problem, String name, String suggestion) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "use-different-visibility-field", diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/oop/TestClosedSetOfValues.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/oop/TestClosedSetOfValues.java index 70c02f5e..a5f6d770 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/oop/TestClosedSetOfValues.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/oop/TestClosedSetOfValues.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -18,7 +18,7 @@ class TestClosedSetOfValues extends AbstractCheckTest { private static final List PROBLEM_TYPES = List.of(ProblemType.CLOSED_SET_OF_VALUES); - void assertClosedSetSwitch(Problem problem, String values) { + void assertClosedSetSwitch(AbstractProblem problem, String values) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "closed-set-of-values-switch", @@ -30,7 +30,7 @@ void assertClosedSetSwitch(Problem problem, String values) { ); } - void assertClosedSetListing(Problem problem, String values) { + void assertClosedSetListing(AbstractProblem problem, String values) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "closed-set-of-values-list", @@ -42,7 +42,7 @@ void assertClosedSetListing(Problem problem, String values) { ); } - void assertClosedSetMethod(Problem problem, String values) { + void assertClosedSetMethod(AbstractProblem problem, String values) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "closed-set-of-values-method", diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/oop/TestConcreteCollectionCheck.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/oop/TestConcreteCollectionCheck.java index 69bb82f1..874441a9 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/oop/TestConcreteCollectionCheck.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/oop/TestConcreteCollectionCheck.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -20,7 +20,7 @@ class TestConcreteCollectionCheck extends AbstractCheckTest { private static final List PROBLEM_TYPES = List.of(ProblemType.CONCRETE_COLLECTION_AS_FIELD_OR_RETURN_VALUE); - void assertEqualsConcrete(Problem problem, String type) { + void assertEqualsConcrete(AbstractProblem problem, String type) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "concrete-collection", diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/oop/TestIOUISeparation.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/oop/TestIOUISeparation.java index f0c8daec..fcdada88 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/oop/TestIOUISeparation.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/oop/TestIOUISeparation.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -20,7 +20,7 @@ class TestIOUISeparation extends AbstractCheckTest { private static final List PROBLEM_TYPES = List.of(ProblemType.UI_INPUT_SEPARATION, ProblemType.UI_OUTPUT_SEPARATION); - void assertEqualsInput(Problem problem, String location) { + void assertEqualsInput(AbstractProblem problem, String location) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "ui-input-separation", @@ -32,7 +32,7 @@ void assertEqualsInput(Problem problem, String location) { ); } - void assertEqualsOutput(Problem problem, String location) { + void assertEqualsOutput(AbstractProblem problem, String location) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "ui-output-separation", diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/oop/TestLeakedCollectionCheck.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/oop/TestLeakedCollectionCheck.java index 16a69e8b..505e93c9 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/oop/TestLeakedCollectionCheck.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/oop/TestLeakedCollectionCheck.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -24,7 +24,7 @@ class TestLeakedCollectionCheck extends AbstractCheckTest { ProblemType.LEAKED_COLLECTION_ASSIGN ); - void assertEqualsLeakedReturn(Problem problem, String method, String field) { + void assertEqualsLeakedReturn(AbstractProblem problem, String method, String field) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "leaked-collection-return", @@ -37,7 +37,7 @@ void assertEqualsLeakedReturn(Problem problem, String method, String field) { ); } - void assertEqualsLeakedAssign(Problem problem, String method, String field) { + void assertEqualsLeakedAssign(AbstractProblem problem, String method, String field) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "leaked-collection-assign", @@ -50,7 +50,7 @@ void assertEqualsLeakedAssign(Problem problem, String method, String field) { ); } - void assertEqualsLeakedConstructor(Problem problem, String signature, String field) { + void assertEqualsLeakedConstructor(AbstractProblem problem, String signature, String field) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "leaked-collection-constructor", diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/oop/TestMethodShouldBeStatic.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/oop/TestMethodShouldBeStatic.java index 3bbdb997..a72fb8fa 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/oop/TestMethodShouldBeStatic.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/oop/TestMethodShouldBeStatic.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -21,7 +21,7 @@ class TestMethodShouldBeStatic extends AbstractCheckTest { ProblemType.METHOD_SHOULD_BE_STATIC_NOT_PUBLIC ); - void assertEqualsStatic(Problem problem, String name) { + void assertEqualsStatic(AbstractProblem problem, String name) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "method-should-be-static", diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/oop/TestStaticBlock.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/oop/TestStaticBlock.java index 79b83ed7..1d299ddf 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/oop/TestStaticBlock.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/oop/TestStaticBlock.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -16,7 +16,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; class TestStaticBlock extends AbstractCheckTest { - private void assertEqualsStaticBlock(Problem problem) { + private void assertEqualsStaticBlock(AbstractProblem problem) { assertEquals(ProblemType.AVOID_STATIC_BLOCKS, problem.getProblemType()); assertEquals( this.linter.translateMessage(new LocalizedMessage(CheckStaticBlocks.LOCALIZED_MESSAGE_KEY)), diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/oop/TestStaticFieldShouldBeInstanceCheck.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/oop/TestStaticFieldShouldBeInstanceCheck.java index 78644dd4..a9ce9e69 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/oop/TestStaticFieldShouldBeInstanceCheck.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/oop/TestStaticFieldShouldBeInstanceCheck.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -18,7 +18,7 @@ class TestStaticFieldShouldBeInstanceCheck extends AbstractCheckTest { private static final List PROBLEM_TYPES = List.of(ProblemType.STATIC_FIELD_SHOULD_BE_INSTANCE); - void assertShouldBeInstance(Problem problem, String name) { + void assertShouldBeInstance(AbstractProblem problem, String name) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "static-field-should-be-instance", diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/structure/TestDuplicateCode.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/structure/TestDuplicateCode.java index 99f9f4cd..a16f3692 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/structure/TestDuplicateCode.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/structure/TestDuplicateCode.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -19,7 +19,7 @@ class TestDuplicateCode extends AbstractCheckTest { private static final List PROBLEM_TYPES = List.of(ProblemType.DUPLICATE_CODE); - void assertDuplicateCode(Problem problem, String left, String right) { + void assertDuplicateCode(AbstractProblem problem, String left, String right) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "duplicate-code", diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/structure/TestTooFewPackagesCheck.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/structure/TestTooFewPackagesCheck.java index 749974f3..2f4be1b3 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/structure/TestTooFewPackagesCheck.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/structure/TestTooFewPackagesCheck.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -19,7 +19,7 @@ class TestTooFewPackagesCheck extends AbstractCheckTest { private static final String LOCALIZED_MESSAGE_KEY = "too-few-packages"; - void assertEqualsTooFewPackages(Problem problem) { + void assertEqualsTooFewPackages(AbstractProblem problem) { assertEquals(ProblemType.TOO_FEW_PACKAGES, problem.getProblemType()); assertEquals( this.linter.translateMessage(new LocalizedMessage( diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/check/unnecessary/TestUnusedCodeElementCheck.java b/autograder-core/src/test/java/de/firemage/autograder/core/check/unnecessary/TestUnusedCodeElementCheck.java index 9828d515..f7950e86 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/check/unnecessary/TestUnusedCodeElementCheck.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/check/unnecessary/TestUnusedCodeElementCheck.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -22,7 +22,7 @@ class TestUnusedCodeElementCheck extends AbstractCheckTest { private static final ProblemType PROBLEM_TYPE = ProblemType.UNUSED_CODE_ELEMENT; private static final List PROBLEM_TYPES = List.of(PROBLEM_TYPE, ProblemType.UNUSED_CODE_ELEMENT_PRIVATE); - private void assertEqualsUnused(String name, Problem problem) { + private void assertEqualsUnused(String name, AbstractProblem problem) { assertEquals( this.linter.translateMessage( new LocalizedMessage( diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/file/TestFileSourceInfo.java b/autograder-core/src/test/java/de/firemage/autograder/core/file/TestFileSourceInfo.java index 2114c024..d980faae 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/file/TestFileSourceInfo.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/file/TestFileSourceInfo.java @@ -13,7 +13,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; class TestFileSourceInfo { - private final AbstractTempLocation tempLocation = new TempLocation(); + private final AbstractTempLocation tempLocation = TempLocation.random(); // See https://github.com/Feuermagier/autograder/issues/368 @Test diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/framework/ReportedProblem.java b/autograder-core/src/test/java/de/firemage/autograder/core/framework/ReportedProblem.java index fefcf7c1..c7ef4c1c 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/framework/ReportedProblem.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/framework/ReportedProblem.java @@ -1,6 +1,6 @@ package de.firemage.autograder.core.framework; -import de.firemage.autograder.core.ProblemImpl; +import de.firemage.autograder.core.Problem; -public record ReportedProblem(ProblemImpl problem, String translatedMessage) { +public record ReportedProblem(Problem problem, String translatedMessage) { } diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/framework/TestFramework.java b/autograder-core/src/test/java/de/firemage/autograder/core/framework/TestFramework.java index ea476f80..77964208 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/framework/TestFramework.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/framework/TestFramework.java @@ -47,7 +47,7 @@ Stream createCheckTests() throws URISyntaxException, IOException { folders = paths.toList(); } - try (AbstractTempLocation tempLocation = new TempLocation()) { + try (AbstractTempLocation tempLocation = TempLocation.random()) { return DynamicTest.stream( folders.stream().map(TestInput::new) .filter(testInput -> ONLY_TEST.isEmpty() || ONLY_TEST.contains(testInput.config().checkPath())), diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/integrated/MethodHierarchyTest.java b/autograder-core/src/test/java/de/firemage/autograder/core/integrated/MethodHierarchyTest.java index 1f812b44..ad678c56 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/integrated/MethodHierarchyTest.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/integrated/MethodHierarchyTest.java @@ -21,10 +21,10 @@ class MethodHierarchyTest { - protected final AbstractTempLocation tempLocation; + protected final TempLocation tempLocation; MethodHierarchyTest() { - tempLocation = new TempLocation(); + tempLocation = TempLocation.random(); } @Test diff --git a/autograder-core/src/test/java/de/firemage/autograder/core/integrated/structure/TestStructuralEqualsVisitor.java b/autograder-core/src/test/java/de/firemage/autograder/core/integrated/structure/TestStructuralEqualsVisitor.java index 08d25396..632c5da5 100644 --- a/autograder-core/src/test/java/de/firemage/autograder/core/integrated/structure/TestStructuralEqualsVisitor.java +++ b/autograder-core/src/test/java/de/firemage/autograder/core/integrated/structure/TestStructuralEqualsVisitor.java @@ -28,7 +28,7 @@ private static T createStatement(String statement, Strin file = UploadedFile.build(StringSourceInfo.fromSourceString(JavaVersion.JAVA_17, "Test", "public class Test { void t(%s) { %s; } }".formatted( arguments, statement - )), new TempLocation(), y -> {}, null); + )), TempLocation.random(), y -> {}, null); } catch (Exception e) { throw new IllegalStateException(e); } diff --git a/autograder-extra/src/main/java/de/firemage/autograder/extra/errorprone/ErrorProneLinter.java b/autograder-extra/src/main/java/de/firemage/autograder/extra/errorprone/ErrorProneLinter.java index 95f17522..f673b94f 100644 --- a/autograder-extra/src/main/java/de/firemage/autograder/extra/errorprone/ErrorProneLinter.java +++ b/autograder-extra/src/main/java/de/firemage/autograder/extra/errorprone/ErrorProneLinter.java @@ -3,7 +3,7 @@ import de.firemage.autograder.api.Translatable; import de.firemage.autograder.core.CodeLinter; import de.firemage.autograder.core.LinterStatus; -import de.firemage.autograder.core.ProblemImpl; +import de.firemage.autograder.core.Problem; import de.firemage.autograder.core.file.SourceInfo; import de.firemage.autograder.core.check.Check; import de.firemage.autograder.api.AbstractTempLocation; @@ -23,7 +23,7 @@ public Class supportedCheckType() { return ErrorProneCheck.class; } - public List lint( + public List lint( UploadedFile submission, AbstractTempLocation tempLocation, ClassLoader classLoader, @@ -68,7 +68,7 @@ public List lint( diagnosticMapping.get(lint).add(diagnostic); } - List result = new ArrayList<>(); + List result = new ArrayList<>(); for (var entry : lintsForChecks.entrySet()) { ErrorProneLint lint = entry.getKey(); diff --git a/autograder-extra/src/main/java/de/firemage/autograder/extra/errorprone/Message.java b/autograder-extra/src/main/java/de/firemage/autograder/extra/errorprone/Message.java index d349c3f5..340a345e 100644 --- a/autograder-extra/src/main/java/de/firemage/autograder/extra/errorprone/Message.java +++ b/autograder-extra/src/main/java/de/firemage/autograder/extra/errorprone/Message.java @@ -1,7 +1,7 @@ package de.firemage.autograder.extra.errorprone; import de.firemage.autograder.core.CodePosition; -import de.firemage.autograder.core.ProblemImpl; +import de.firemage.autograder.core.Problem; import de.firemage.autograder.core.LocalizedMessage; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.Check; @@ -19,8 +19,8 @@ public static Message of(ProblemType problemType, LocalizedMessage message) { return new Message(problemType, message); } - ProblemImpl toProblem(Check check, CodePosition position) { - return new ProblemImpl(check, position, this.message, this.problemType) { + Problem toProblem(Check check, CodePosition position) { + return new Problem(check, position, this.message, this.problemType) { }; } } diff --git a/autograder-extra/src/main/java/de/firemage/autograder/extra/pmd/PMDInCodeProblem.java b/autograder-extra/src/main/java/de/firemage/autograder/extra/pmd/PMDInCodeProblem.java index 593a344f..126d67ab 100644 --- a/autograder-extra/src/main/java/de/firemage/autograder/extra/pmd/PMDInCodeProblem.java +++ b/autograder-extra/src/main/java/de/firemage/autograder/extra/pmd/PMDInCodeProblem.java @@ -1,14 +1,14 @@ package de.firemage.autograder.extra.pmd; import de.firemage.autograder.core.CodePosition; -import de.firemage.autograder.core.ProblemImpl; +import de.firemage.autograder.core.Problem; import de.firemage.autograder.core.LocalizedMessage; import de.firemage.autograder.core.file.SourceInfo; import net.sourceforge.pmd.RuleViolation; import java.nio.file.Path; -public class PMDInCodeProblem extends ProblemImpl { +public class PMDInCodeProblem extends Problem { public PMDInCodeProblem(PMDCheck check, RuleViolation violation, SourceInfo sourceInfo) { super(check, diff --git a/autograder-extra/src/main/java/de/firemage/autograder/extra/pmd/PMDLinter.java b/autograder-extra/src/main/java/de/firemage/autograder/extra/pmd/PMDLinter.java index 1018e619..2cb8641f 100644 --- a/autograder-extra/src/main/java/de/firemage/autograder/extra/pmd/PMDLinter.java +++ b/autograder-extra/src/main/java/de/firemage/autograder/extra/pmd/PMDLinter.java @@ -3,7 +3,7 @@ import de.firemage.autograder.api.Translatable; import de.firemage.autograder.core.CodeLinter; import de.firemage.autograder.core.LinterStatus; -import de.firemage.autograder.core.ProblemImpl; +import de.firemage.autograder.core.Problem; import de.firemage.autograder.core.file.CompilationUnit; import de.firemage.autograder.api.AbstractTempLocation; import de.firemage.autograder.core.file.UploadedFile; @@ -33,7 +33,7 @@ public Class supportedCheckType() { } @Override - public List lint( + public List lint( UploadedFile submission, AbstractTempLocation tempLocation, ClassLoader classLoader, diff --git a/autograder-extra/src/main/java/de/firemage/autograder/extra/pmd/ProblemRenderer.java b/autograder-extra/src/main/java/de/firemage/autograder/extra/pmd/ProblemRenderer.java index ab682895..42feb429 100644 --- a/autograder-extra/src/main/java/de/firemage/autograder/extra/pmd/ProblemRenderer.java +++ b/autograder-extra/src/main/java/de/firemage/autograder/extra/pmd/ProblemRenderer.java @@ -1,6 +1,6 @@ package de.firemage.autograder.extra.pmd; -import de.firemage.autograder.core.ProblemImpl; +import de.firemage.autograder.core.Problem; import de.firemage.autograder.core.file.FileSourceInfo; import de.firemage.autograder.core.file.SourceInfo; import net.sourceforge.pmd.Report; @@ -21,7 +21,7 @@ public class ProblemRenderer extends AbstractIncrementingRenderer { private final SourceInfo sourceInfo; private final Map checks; - private final List problems = new ArrayList<>(); + private final List problems = new ArrayList<>(); public ProblemRenderer(Map checks, SourceInfo sourceInfo) { super("Custom renderer", "Creates InCodeProblems"); @@ -69,7 +69,7 @@ public void flush() { // Do nothing for this renderer } - public List getProblems() { + public List getProblems() { return Collections.unmodifiableList(this.problems); } } diff --git a/autograder-extra/src/test/java/de/firemage/autograder/extra/check/api/TestProblematicEqualsHashCodeComparable.java b/autograder-extra/src/test/java/de/firemage/autograder/extra/check/api/TestProblematicEqualsHashCodeComparable.java index 989db1fd..80afb026 100644 --- a/autograder-extra/src/test/java/de/firemage/autograder/extra/check/api/TestProblematicEqualsHashCodeComparable.java +++ b/autograder-extra/src/test/java/de/firemage/autograder/extra/check/api/TestProblematicEqualsHashCodeComparable.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -30,7 +30,7 @@ class TestProblematicEqualsHashCodeComparable extends AbstractCheckTest { ProblemType.ARRAY_AS_KEY_OF_SET_OR_MAP ); - void assertCompareToZero(Problem problem) { + void assertCompareToZero(AbstractProblem problem) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "compare-to-zero" @@ -39,7 +39,7 @@ void assertCompareToZero(Problem problem) { ); } - void assertEqualsUsingHashCode(Problem problem) { + void assertEqualsUsingHashCode(AbstractProblem problem) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "equals-using-hashcode" @@ -48,7 +48,7 @@ void assertEqualsUsingHashCode(Problem problem) { ); } - void assertEqualsUnsafeCast(Problem problem) { + void assertEqualsUnsafeCast(AbstractProblem problem) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "equals-unsafe-cast" @@ -57,7 +57,7 @@ void assertEqualsUnsafeCast(Problem problem) { ); } - void assertEqualsIncompatibleType(Problem problem) { + void assertEqualsIncompatibleType(AbstractProblem problem) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "equals-incompatible-type" @@ -66,7 +66,7 @@ void assertEqualsIncompatibleType(Problem problem) { ); } - void assertInconsistentHashCode(Problem problem) { + void assertInconsistentHashCode(AbstractProblem problem) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "inconsistent-hashcode" @@ -75,7 +75,7 @@ void assertInconsistentHashCode(Problem problem) { ); } - void assertUndefinedEquals(Problem problem) { + void assertUndefinedEquals(AbstractProblem problem) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "undefined-equals" @@ -84,7 +84,7 @@ void assertUndefinedEquals(Problem problem) { ); } - void assertNonOverridingEquals(Problem problem) { + void assertNonOverridingEquals(AbstractProblem problem) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "non-overriding-equals" @@ -93,7 +93,7 @@ void assertNonOverridingEquals(Problem problem) { ); } - void assertEqualsBrokenForNull(Problem problem) { + void assertEqualsBrokenForNull(AbstractProblem problem) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "equals-broken-for-null" @@ -102,7 +102,7 @@ void assertEqualsBrokenForNull(Problem problem) { ); } - void assertArrayHashCode(Problem problem) { + void assertArrayHashCode(AbstractProblem problem) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "array-hash-code" @@ -111,7 +111,7 @@ void assertArrayHashCode(Problem problem) { ); } - void assertEqualsReference(Problem problem) { + void assertEqualsReference(AbstractProblem problem) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "equals-reference" @@ -120,7 +120,7 @@ void assertEqualsReference(Problem problem) { ); } - void assertArraysAsKeyOfSetOrMap(Problem problem) { + void assertArraysAsKeyOfSetOrMap(AbstractProblem problem) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "array-as-key-of-set-or-map" diff --git a/autograder-extra/src/test/java/de/firemage/autograder/extra/check/complexity/TestDiamondOperatorCheck.java b/autograder-extra/src/test/java/de/firemage/autograder/extra/check/complexity/TestDiamondOperatorCheck.java index 74f9a33f..d1fac369 100644 --- a/autograder-extra/src/test/java/de/firemage/autograder/extra/check/complexity/TestDiamondOperatorCheck.java +++ b/autograder-extra/src/test/java/de/firemage/autograder/extra/check/complexity/TestDiamondOperatorCheck.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -20,7 +20,7 @@ class TestDiamondOperatorCheck extends AbstractCheckTest { ProblemType.UNUSED_DIAMOND_OPERATOR ); - void assertRedundantDiamondOperator(Problem problem) { + void assertRedundantDiamondOperator(AbstractProblem problem) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "use-diamond-operator" diff --git a/autograder-extra/src/test/java/de/firemage/autograder/extra/check/complexity/TestRedundantReturnCheck.java b/autograder-extra/src/test/java/de/firemage/autograder/extra/check/complexity/TestRedundantReturnCheck.java index 094da6c8..6787fb24 100644 --- a/autograder-extra/src/test/java/de/firemage/autograder/extra/check/complexity/TestRedundantReturnCheck.java +++ b/autograder-extra/src/test/java/de/firemage/autograder/extra/check/complexity/TestRedundantReturnCheck.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -20,7 +20,7 @@ class TestRedundantReturnCheck extends AbstractCheckTest { ProblemType.REDUNDANT_VOID_RETURN ); - void assertRedundantReturn(Problem problem) { + void assertRedundantReturn(AbstractProblem problem) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "redundant-return-exp" diff --git a/autograder-extra/src/test/java/de/firemage/autograder/extra/check/complexity/TestRegexCheck.java b/autograder-extra/src/test/java/de/firemage/autograder/extra/check/complexity/TestRegexCheck.java index 47d32264..5a00610b 100644 --- a/autograder-extra/src/test/java/de/firemage/autograder/extra/check/complexity/TestRegexCheck.java +++ b/autograder-extra/src/test/java/de/firemage/autograder/extra/check/complexity/TestRegexCheck.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -20,7 +20,7 @@ class TestRegexCheck extends AbstractCheckTest { ProblemType.COMPLEX_REGEX ); - void assertComplex(Problem problem, double score) { + void assertComplex(AbstractProblem problem, double score) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "complex-regex", Map.of("score", Double.toString(score), "max", RegexCheck.MAX_ALLOWED_SCORE) diff --git a/autograder-extra/src/test/java/de/firemage/autograder/extra/check/general/TestConstantNamingAndQualifierCheck.java b/autograder-extra/src/test/java/de/firemage/autograder/extra/check/general/TestConstantNamingAndQualifierCheck.java index 5a0387b4..bcf09435 100644 --- a/autograder-extra/src/test/java/de/firemage/autograder/extra/check/general/TestConstantNamingAndQualifierCheck.java +++ b/autograder-extra/src/test/java/de/firemage/autograder/extra/check/general/TestConstantNamingAndQualifierCheck.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.file.StringSourceInfo; import de.firemage.autograder.core.check.AbstractCheckTest; @@ -21,7 +21,7 @@ class TestConstantNamingAndQualifierCheck extends AbstractCheckTest { ProblemType.LOCAL_VARIABLE_SHOULD_BE_CONSTANT ); - private void assertProblem(Problem problem, String variable, String suggestion) { + private void assertProblem(AbstractProblem problem, String variable, String suggestion) { assertEquals( this.linter.translateMessage( new LocalizedMessage( diff --git a/autograder-extra/src/test/java/de/firemage/autograder/extra/check/general/TestDoubleBraceInitializationCheck.java b/autograder-extra/src/test/java/de/firemage/autograder/extra/check/general/TestDoubleBraceInitializationCheck.java index 5cacb082..eb337c9b 100644 --- a/autograder-extra/src/test/java/de/firemage/autograder/extra/check/general/TestDoubleBraceInitializationCheck.java +++ b/autograder-extra/src/test/java/de/firemage/autograder/extra/check/general/TestDoubleBraceInitializationCheck.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -20,7 +20,7 @@ class TestDoubleBraceInitializationCheck extends AbstractCheckTest { ProblemType.DOUBLE_BRACE_INITIALIZATION ); - void assertDoubleBraceInit(Problem problem) { + void assertDoubleBraceInit(AbstractProblem problem) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "double-brace-init" diff --git a/autograder-extra/src/test/java/de/firemage/autograder/extra/check/general/TestUseDifferentVisibility.java b/autograder-extra/src/test/java/de/firemage/autograder/extra/check/general/TestUseDifferentVisibility.java index 21a73b8a..0432edb4 100644 --- a/autograder-extra/src/test/java/de/firemage/autograder/extra/check/general/TestUseDifferentVisibility.java +++ b/autograder-extra/src/test/java/de/firemage/autograder/extra/check/general/TestUseDifferentVisibility.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -22,7 +22,7 @@ class TestUseDifferentVisibility extends AbstractCheckTest { ProblemType.USE_DIFFERENT_VISIBILITY_PUBLIC_FIELD ); - void assertDifferentVisibility(Problem problem, String name, String suggestion) { + void assertDifferentVisibility(AbstractProblem problem, String name, String suggestion) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "use-different-visibility", @@ -67,7 +67,7 @@ public class Child extends Parent { ) ), PROBLEM_TYPES); - Problem problem = problems.next(); + AbstractProblem problem = problems.next(); assertDifferentVisibility(problem, "Parent", "protected"); assertEquals(ProblemType.USE_DIFFERENT_VISIBILITY_PEDANTIC, problem.getProblemType()); diff --git a/autograder-extra/src/test/java/de/firemage/autograder/extra/check/naming/TestLinguisticNamingCheck.java b/autograder-extra/src/test/java/de/firemage/autograder/extra/check/naming/TestLinguisticNamingCheck.java index eeff1694..eac678c3 100644 --- a/autograder-extra/src/test/java/de/firemage/autograder/extra/check/naming/TestLinguisticNamingCheck.java +++ b/autograder-extra/src/test/java/de/firemage/autograder/extra/check/naming/TestLinguisticNamingCheck.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -18,7 +18,7 @@ class TestLinguisticNamingCheck extends AbstractCheckTest { private static final List PROBLEM_TYPES = List.of(ProblemType.CONFUSING_IDENTIFIER); - void assertEqualsBoolean(String name, String type, Problem problem) { + void assertEqualsBoolean(String name, String type, AbstractProblem problem) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "linguistic-naming-boolean", @@ -28,7 +28,7 @@ void assertEqualsBoolean(String name, String type, Problem problem) { ); } - void assertEqualsGetter(String name, Problem problem) { + void assertEqualsGetter(String name, AbstractProblem problem) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "linguistic-naming-getter", @@ -38,7 +38,7 @@ void assertEqualsGetter(String name, Problem problem) { ); } - void assertEqualsSetter(String name, Problem problem) { + void assertEqualsSetter(String name, AbstractProblem problem) { assertEquals( this.linter.translateMessage(new LocalizedMessage( "linguistic-naming-setter", diff --git a/autograder-extra/src/test/java/de/firemage/autograder/extra/check/naming/TestVariablesHaveDescriptiveNamesCheck.java b/autograder-extra/src/test/java/de/firemage/autograder/extra/check/naming/TestVariablesHaveDescriptiveNamesCheck.java index 69350ca0..15820740 100644 --- a/autograder-extra/src/test/java/de/firemage/autograder/extra/check/naming/TestVariablesHaveDescriptiveNamesCheck.java +++ b/autograder-extra/src/test/java/de/firemage/autograder/extra/check/naming/TestVariablesHaveDescriptiveNamesCheck.java @@ -2,7 +2,7 @@ import de.firemage.autograder.api.LinterException; import de.firemage.autograder.core.LocalizedMessage; -import de.firemage.autograder.api.Problem; +import de.firemage.autograder.api.AbstractProblem; import de.firemage.autograder.api.ProblemType; import de.firemage.autograder.core.check.AbstractCheckTest; import de.firemage.autograder.api.JavaVersion; @@ -24,7 +24,7 @@ class TestVariablesHaveDescriptiveNamesCheck extends AbstractCheckTest { ProblemType.IDENTIFIER_REDUNDANT_NUMBER_SUFFIX ); - private void assertInternal(Problem problem, String key, String name) { + private void assertInternal(AbstractProblem problem, String key, String name) { assertEquals( this.linter.translateMessage( new LocalizedMessage( @@ -44,23 +44,23 @@ private void assertInternal(Problem problem, String key, String name) { // "variable-redundant-number-suffix" // "similar-identifier" - private void assertSingleLetter(Problem problem, String name) { + private void assertSingleLetter(AbstractProblem problem, String name) { assertInternal(problem, "variable-name-single-letter", name); } - private void assertAbbreviation(Problem problem, String name) { + private void assertAbbreviation(AbstractProblem problem, String name) { assertInternal(problem, "variable-is-abbreviation", name); } - private void assertTypeInName(Problem problem, String name) { + private void assertTypeInName(AbstractProblem problem, String name) { assertInternal(problem, "variable-name-type-in-name", name); } - private void assertRedundantNumberSuffix(Problem problem, String name) { + private void assertRedundantNumberSuffix(AbstractProblem problem, String name) { assertInternal(problem, "variable-redundant-number-suffix", name); } - private void assertSimilarIdentifier(Problem problem, String left, String right) { + private void assertSimilarIdentifier(AbstractProblem problem, String left, String right) { assertEquals( this.linter.translateMessage( new LocalizedMessage(