From 0fbf491f949887db9a47b10a4528d041230e4925 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 19 Apr 2021 13:01:44 +0200 Subject: [api] Make env unmodifiable at assignment time --- api/src/main/java/org/openslx/taskmanager/api/Environment.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/main/java/org/openslx/taskmanager/api/Environment.java b/api/src/main/java/org/openslx/taskmanager/api/Environment.java index 3942ec5..2a33a17 100644 --- a/api/src/main/java/org/openslx/taskmanager/api/Environment.java +++ b/api/src/main/java/org/openslx/taskmanager/api/Environment.java @@ -51,7 +51,7 @@ public class Environment bufferedReader.close(); - Environment.env = env; + Environment.env = Collections.unmodifiableMap( env ); log.info( "Loaded " + env.size() + " environment lines." ); } catch ( IOException e ) { log.info( "Could not load environment definition from " + fileName + ". Processes might use the same environment as this thread." ); @@ -62,7 +62,7 @@ public class Environment public static Map get() { - return Collections.unmodifiableMap( env ); + return env; } } -- cgit v1.2.3-55-g7522