Make getArguments return an immutable list

This commit is contained in:
JeremyStar™ 2024-11-05 02:55:28 +01:00
parent 7c0b7e1e90
commit edd28bef2f
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D

View file

@ -20,6 +20,7 @@
package de.staropensource.engine.base.utility.information; package de.staropensource.engine.base.utility.information;
import de.staropensource.engine.base.logging.Logger; import de.staropensource.engine.base.logging.Logger;
import de.staropensource.engine.base.type.immutable.ImmutableArrayList;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import java.lang.management.ManagementFactory; import java.lang.management.ManagementFactory;
@ -109,11 +110,11 @@ public final class JvmInformation {
* Returns all arguments passed to the JVM. * Returns all arguments passed to the JVM.
* This excludes all arguments passed to the application. * This excludes all arguments passed to the application.
* *
* @return JVM arguments * @return immutable list with all JVM arguments
* @since v1-alpha0 * @since v1-alpha0
*/ */
public static @NotNull List<@NotNull String> getArguments() { public static @NotNull List<@NotNull String> getArguments() {
return ManagementFactory.getRuntimeMXBean().getInputArguments(); return new ImmutableArrayList<>(ManagementFactory.getRuntimeMXBean().getInputArguments());
} }
/** /**