From ab98ba772b690dd84dbb260f3b1b22d0cd932439 Mon Sep 17 00:00:00 2001 From: Florian Seligmann Date: Fri, 19 Apr 2024 12:33:22 +0200 Subject: [PATCH] remove lombok --- .../core/check/general/CopyPasteCheck.java | 6 ++++-- .../core/compiler/CompilationFailureException.java | 6 ++++-- .../autograder/core/integrated/graph/Usage.java | 12 +++++++++--- .../core/integrated/graph/UsageAccessField.java | 7 +++++-- .../core/integrated/graph/UsageCallMethod.java | 7 +++++-- .../core/integrated/graph/UsageCreateInstance.java | 7 +++++-- .../core/integrated/graph/UsageField.java | 13 +++++++++---- .../autograder/core/pmd/ProblemRenderer.java | 10 +++++++--- pom.xml | 7 ------- 9 files changed, 48 insertions(+), 27 deletions(-) diff --git a/autograder-core/src/main/java/de/firemage/autograder/core/check/general/CopyPasteCheck.java b/autograder-core/src/main/java/de/firemage/autograder/core/check/general/CopyPasteCheck.java index e1bc9b2e..fd547e4c 100644 --- a/autograder-core/src/main/java/de/firemage/autograder/core/check/general/CopyPasteCheck.java +++ b/autograder-core/src/main/java/de/firemage/autograder/core/check/general/CopyPasteCheck.java @@ -2,11 +2,9 @@ import de.firemage.autograder.core.LocalizedMessage; import de.firemage.autograder.core.check.Check; -import lombok.Getter; // TODO add executable check annotation and problem type public class CopyPasteCheck implements Check { - @Getter private final int tokenCount; public CopyPasteCheck(int tokenCount) { @@ -17,4 +15,8 @@ public CopyPasteCheck(int tokenCount) { public LocalizedMessage getLinter() { return new LocalizedMessage("linter-cpd"); } + + public int getTokenCount() { + return tokenCount; + } } diff --git a/autograder-core/src/main/java/de/firemage/autograder/core/compiler/CompilationFailureException.java b/autograder-core/src/main/java/de/firemage/autograder/core/compiler/CompilationFailureException.java index 7c33078f..c574a478 100644 --- a/autograder-core/src/main/java/de/firemage/autograder/core/compiler/CompilationFailureException.java +++ b/autograder-core/src/main/java/de/firemage/autograder/core/compiler/CompilationFailureException.java @@ -1,16 +1,18 @@ package de.firemage.autograder.core.compiler; import de.firemage.autograder.core.LinterException; -import lombok.Getter; import java.util.List; public class CompilationFailureException extends LinterException { - @Getter private final List diagnostics; CompilationFailureException(List diagnostics) { super(CompilationDiagnostic.formatMultiple(diagnostics)); this.diagnostics = diagnostics; } + + public List getDiagnostics() { + return diagnostics; + } } diff --git a/autograder-core/src/main/java/de/firemage/autograder/core/integrated/graph/Usage.java b/autograder-core/src/main/java/de/firemage/autograder/core/integrated/graph/Usage.java index 39d7a5a9..d282f4b7 100644 --- a/autograder-core/src/main/java/de/firemage/autograder/core/integrated/graph/Usage.java +++ b/autograder-core/src/main/java/de/firemage/autograder/core/integrated/graph/Usage.java @@ -1,14 +1,12 @@ package de.firemage.autograder.core.integrated.graph; -import lombok.Getter; import spoon.reflect.reference.CtTypeReference; import java.util.Objects; public sealed class Usage permits UsageAccessField, UsageCallMethod, UsageCreateInstance, UsageField { - @Getter + private final CtTypeReference start; - @Getter private final CtTypeReference end; public Usage(CtTypeReference start, CtTypeReference end) { @@ -16,6 +14,14 @@ public Usage(CtTypeReference start, CtTypeReference end) { this.end = end; } + public CtTypeReference getStart() { + return start; + } + + public CtTypeReference getEnd() { + return end; + } + @Override public boolean equals(Object o) { if (this == o) return true; diff --git a/autograder-core/src/main/java/de/firemage/autograder/core/integrated/graph/UsageAccessField.java b/autograder-core/src/main/java/de/firemage/autograder/core/integrated/graph/UsageAccessField.java index 1b8c3649..adaf49e4 100644 --- a/autograder-core/src/main/java/de/firemage/autograder/core/integrated/graph/UsageAccessField.java +++ b/autograder-core/src/main/java/de/firemage/autograder/core/integrated/graph/UsageAccessField.java @@ -1,13 +1,12 @@ package de.firemage.autograder.core.integrated.graph; -import lombok.Getter; import spoon.reflect.declaration.CtField; import spoon.reflect.reference.CtTypeReference; import java.util.Objects; public final class UsageAccessField extends Usage { - @Getter + private final CtField field; public UsageAccessField(CtTypeReference start, CtTypeReference end, CtField field) { @@ -15,6 +14,10 @@ public UsageAccessField(CtTypeReference start, CtTypeReference end, CtFiel this.field = field; } + public CtField getField() { + return field; + } + @Override public boolean equals(Object o) { if (this == o) return true; diff --git a/autograder-core/src/main/java/de/firemage/autograder/core/integrated/graph/UsageCallMethod.java b/autograder-core/src/main/java/de/firemage/autograder/core/integrated/graph/UsageCallMethod.java index 72981c8e..edf2fa13 100644 --- a/autograder-core/src/main/java/de/firemage/autograder/core/integrated/graph/UsageCallMethod.java +++ b/autograder-core/src/main/java/de/firemage/autograder/core/integrated/graph/UsageCallMethod.java @@ -1,13 +1,12 @@ package de.firemage.autograder.core.integrated.graph; -import lombok.Getter; import spoon.reflect.declaration.CtMethod; import spoon.reflect.reference.CtTypeReference; import java.util.Objects; public final class UsageCallMethod extends Usage { - @Getter + private final CtMethod method; public UsageCallMethod(CtTypeReference start, CtTypeReference end, CtMethod method) { @@ -15,6 +14,10 @@ public UsageCallMethod(CtTypeReference start, CtTypeReference end, CtMetho this.method = method; } + public CtMethod getMethod() { + return method; + } + @Override public boolean equals(Object o) { if (this == o) return true; diff --git a/autograder-core/src/main/java/de/firemage/autograder/core/integrated/graph/UsageCreateInstance.java b/autograder-core/src/main/java/de/firemage/autograder/core/integrated/graph/UsageCreateInstance.java index 88a7340e..18ae1158 100644 --- a/autograder-core/src/main/java/de/firemage/autograder/core/integrated/graph/UsageCreateInstance.java +++ b/autograder-core/src/main/java/de/firemage/autograder/core/integrated/graph/UsageCreateInstance.java @@ -1,13 +1,12 @@ package de.firemage.autograder.core.integrated.graph; -import lombok.Getter; import spoon.reflect.declaration.CtConstructor; import spoon.reflect.reference.CtTypeReference; import java.util.Objects; public final class UsageCreateInstance extends Usage { - @Getter + private final CtConstructor constructor; public UsageCreateInstance(CtTypeReference start, CtTypeReference end, CtConstructor constructor) { @@ -15,6 +14,10 @@ public UsageCreateInstance(CtTypeReference start, CtTypeReference end, CtC this.constructor = constructor; } + public CtConstructor getConstructor() { + return constructor; + } + @Override public boolean equals(Object o) { if (this == o) return true; diff --git a/autograder-core/src/main/java/de/firemage/autograder/core/integrated/graph/UsageField.java b/autograder-core/src/main/java/de/firemage/autograder/core/integrated/graph/UsageField.java index b158abc1..2f0dc779 100644 --- a/autograder-core/src/main/java/de/firemage/autograder/core/integrated/graph/UsageField.java +++ b/autograder-core/src/main/java/de/firemage/autograder/core/integrated/graph/UsageField.java @@ -1,16 +1,13 @@ package de.firemage.autograder.core.integrated.graph; -import lombok.Getter; import spoon.reflect.declaration.CtField; import spoon.reflect.reference.CtTypeReference; import java.util.Objects; public final class UsageField extends Usage { - @Getter + private final CtField field; - - @Getter private final int typeParameterIndex; public UsageField(CtTypeReference start, CtTypeReference end, CtField field, int typeParameterIndex) { @@ -19,6 +16,14 @@ public UsageField(CtTypeReference start, CtTypeReference end, CtField f this.typeParameterIndex = typeParameterIndex; } + public CtField getField() { + return field; + } + + public int getTypeParameterIndex() { + return typeParameterIndex; + } + @Override public boolean equals(Object o) { if (this == o) return true; diff --git a/autograder-core/src/main/java/de/firemage/autograder/core/pmd/ProblemRenderer.java b/autograder-core/src/main/java/de/firemage/autograder/core/pmd/ProblemRenderer.java index 41d194f3..25339044 100644 --- a/autograder-core/src/main/java/de/firemage/autograder/core/pmd/ProblemRenderer.java +++ b/autograder-core/src/main/java/de/firemage/autograder/core/pmd/ProblemRenderer.java @@ -1,20 +1,24 @@ package de.firemage.autograder.core.pmd; import de.firemage.autograder.core.Problem; +import de.firemage.autograder.core.file.FileSourceInfo; import de.firemage.autograder.core.file.SourceInfo; -import lombok.extern.slf4j.Slf4j; import net.sourceforge.pmd.Report; import net.sourceforge.pmd.RuleViolation; import net.sourceforge.pmd.renderers.AbstractIncrementingRenderer; import org.apache.commons.io.output.NullWriter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.Map; -@Slf4j public class ProblemRenderer extends AbstractIncrementingRenderer { + private static final Logger LOG = LoggerFactory.getLogger(FileSourceInfo.class); + private final SourceInfo sourceInfo; private final Map checks; private final List problems = new ArrayList<>(); @@ -51,7 +55,7 @@ public void end() { //TODO Don't ignore processing errors (via Report.ProcessingError) for (Report.ConfigurationError error : configErrors) { - log.error("PMD config error: " + error.issue()); + LOG.error("PMD config error: " + error.issue()); } } diff --git a/pom.xml b/pom.xml index b96279d0..885d90c2 100644 --- a/pom.xml +++ b/pom.xml @@ -51,13 +51,6 @@ - - - org.projectlombok - lombok - 1.18.32 - provided - org.junit.jupiter junit-jupiter-engine