From 08b1fc5f3ac2dad58bd8515829abec9198ac0082 Mon Sep 17 00:00:00 2001 From: Luro02 <24826124+Luro02@users.noreply.github.com> Date: Sat, 13 Jul 2024 13:33:34 +0200 Subject: [PATCH] fix `AvoidStringConcat` --- .../autograder/core/check/api/AvoidStringConcat.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/autograder-core/src/main/java/de/firemage/autograder/core/check/api/AvoidStringConcat.java b/autograder-core/src/main/java/de/firemage/autograder/core/check/api/AvoidStringConcat.java index 85f60273..f438dbf6 100644 --- a/autograder-core/src/main/java/de/firemage/autograder/core/check/api/AvoidStringConcat.java +++ b/autograder-core/src/main/java/de/firemage/autograder/core/check/api/AvoidStringConcat.java @@ -1,16 +1,22 @@ package de.firemage.autograder.core.check.api; +import de.firemage.autograder.core.LocalizedMessage; import de.firemage.autograder.core.ProblemType; import de.firemage.autograder.core.check.ExecutableCheck; import de.firemage.autograder.core.integrated.IntegratedCheck; +import de.firemage.autograder.core.integrated.MethodUtil; import de.firemage.autograder.core.integrated.StaticAnalysis; +import spoon.processing.AbstractProcessor; +import spoon.reflect.code.CtInvocation; + +import java.util.Map; @ExecutableCheck(reportedProblems = { ProblemType.AVOID_STRING_CONCAT }) public class AvoidStringConcat extends IntegratedCheck { @Override protected void check(StaticAnalysis staticAnalysis) { - /*staticAnalysis.processWith(new AbstractProcessor>() { + staticAnalysis.processWith(new AbstractProcessor>() { @Override public void process(CtInvocation ctInvocation) { if (ctInvocation.isImplicit() @@ -38,7 +44,6 @@ public void process(CtInvocation ctInvocation) { ProblemType.AVOID_STRING_CONCAT ); } - });*/ - throw new IllegalStateException("Called from the core"); + }); } }