Skip to content

Commit 5e2b332

Browse files
author
Markus Paulsen
committed
fix: align utility-class constructors and unbreak the build
The Copilot Autofix commit gave ClassMemberAccessor a throwing constructor but left it unformatted, so spotless:check (the first Build step) failed and every downstream job skipped. It also used a fully qualified Messages reference rather than the imported short form the rest of the code base uses. This reformats ClassMemberAccessor to the convention (import Messages, literal class name) and applies the same convention to the two utility classes Copilot flagged, Phobos and Localisation, which still threw a generic IllegalStateException with a hard-coded English message. All three now throw a SecurityException with Messages.localized("security.general.utility.initialization", <ClassName>), matching FileHandlerConstants and the other utility classes, so the failure type and message are consistent and locale-independent.
1 parent 373d47e commit 5e2b332

3 files changed

Lines changed: 217 additions & 214 deletions

File tree

src/main/java/de/tum/cit/ase/ares/api/localization/Localisation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
public final class Localisation {
1515

1616
private Localisation() {
17-
throw new IllegalStateException("Utility class should not be instantiated");
17+
throw new SecurityException(Messages.localized("security.general.utility.initialization", "Localisation"));
1818
}
1919

2020
public static List<Path> filesToCopy() {

src/main/java/de/tum/cit/ase/ares/api/phobos/Phobos.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import com.opencsv.exceptions.CsvException;
1212

1313
import de.tum.cit.ase.ares.api.aop.java.javaAOPModeData.JavaCSVFileLoader;
14+
import de.tum.cit.ase.ares.api.localization.Messages;
1415
import de.tum.cit.ase.ares.api.phobos.java.JavaPhobosTestCaseSupported;
1516
import de.tum.cit.ase.ares.api.policy.policySubComponents.FilePermission;
1617
import de.tum.cit.ase.ares.api.policy.policySubComponents.NetworkPermission;
@@ -35,7 +36,7 @@
3536
public final class Phobos {
3637

3738
private Phobos() {
38-
throw new IllegalStateException("Utility class should not be instantiated");
39+
throw new SecurityException(Messages.localized("security.general.utility.initialization", "Phobos"));
3940
}
4041

4142
/**

0 commit comments

Comments
 (0)