From 17887d038fc2e1fc9f8f5451e2fc2c259d88ac2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Wa=C5=9Bko?= Date: Mon, 11 Dec 2023 17:17:07 +0100 Subject: [PATCH] remove old way of overriding env var which is now deprecated --- .../java/org/enso/base/Environment_Utils.java | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/std-bits/base/src/main/java/org/enso/base/Environment_Utils.java b/std-bits/base/src/main/java/org/enso/base/Environment_Utils.java index 255e7e4792112..268a4b6f9b881 100644 --- a/std-bits/base/src/main/java/org/enso/base/Environment_Utils.java +++ b/std-bits/base/src/main/java/org/enso/base/Environment_Utils.java @@ -14,32 +14,6 @@ public static String get_environment_variable(String name) { } } - /** - * Calls `action` with the provided environment variable. - * - *

The override is not persisted (its only visible from within the action called by this - * method) and it is only visible by the Enso `Environment.get` method (backed by {@code - * get_environment_variable}). - * - *

This is an internal function that should be used very carefully and only for testing. - */ - public static T with_environment_variable_override( - String name, String value, Function action) { - String oldValue = overrides.put(name, value); - boolean was_set = oldValue != null; - try { - // Giving 0 here as an argument, as using null would lead to incorrect behaviour, due to some - // weird Truffle peculiarity. - return action.apply(0); - } finally { - if (was_set) { - overrides.put(name, oldValue); - } else { - overrides.remove(name); - } - } - } - public static void setOverride(String name, String value) { overrides.put(name, value); }