From edd28bef2f7c1a2b22b71bc29ca82fca844905c9 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Tue, 5 Nov 2024 02:55:28 +0100 Subject: [PATCH] Make getArguments return an immutable list --- .../engine/base/utility/information/JvmInformation.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/base/src/main/java/de/staropensource/engine/base/utility/information/JvmInformation.java b/base/src/main/java/de/staropensource/engine/base/utility/information/JvmInformation.java index 9acdbc9..cda209b 100644 --- a/base/src/main/java/de/staropensource/engine/base/utility/information/JvmInformation.java +++ b/base/src/main/java/de/staropensource/engine/base/utility/information/JvmInformation.java @@ -20,6 +20,7 @@ package de.staropensource.engine.base.utility.information; import de.staropensource.engine.base.logging.Logger; +import de.staropensource.engine.base.type.immutable.ImmutableArrayList; import org.jetbrains.annotations.NotNull; import java.lang.management.ManagementFactory; @@ -109,11 +110,11 @@ public final class JvmInformation { * Returns all arguments passed to the JVM. * This excludes all arguments passed to the application. * - * @return JVM arguments + * @return immutable list with all JVM arguments * @since v1-alpha0 */ public static @NotNull List<@NotNull String> getArguments() { - return ManagementFactory.getRuntimeMXBean().getInputArguments(); + return new ImmutableArrayList<>(ManagementFactory.getRuntimeMXBean().getInputArguments()); } /**