From 19d7b5c65dbfdfeba6f31da79f1948d0649b5824 Mon Sep 17 00:00:00 2001 From: Jon Chambers Date: Thu, 19 Oct 2023 19:08:35 -0400 Subject: [PATCH] Drop `Util#wait` --- .../storage/DynamicConfigurationManager.java | 7 ++++++- .../java/org/whispersystems/textsecuregcm/util/Util.java | 8 -------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/storage/DynamicConfigurationManager.java b/service/src/main/java/org/whispersystems/textsecuregcm/storage/DynamicConfigurationManager.java index e9f1b1f0b..4657d53c9 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/storage/DynamicConfigurationManager.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/storage/DynamicConfigurationManager.java @@ -73,7 +73,12 @@ public class DynamicConfigurationManager { public T getConfiguration() { synchronized (this) { while (!initialized) { - Util.wait(this); + try { + this.wait(); + } catch (final InterruptedException e) { + logger.warn("Interrupted while waiting for initial configuration", e); + throw new RuntimeException(e); + } } } return configuration.get(); diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/util/Util.java b/service/src/main/java/org/whispersystems/textsecuregcm/util/Util.java index 25552fbb3..4ddeedce5 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/util/Util.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/util/Util.java @@ -117,14 +117,6 @@ public class Util { } catch (InterruptedException ie) {} } - public static void wait(Object object) { - try { - object.wait(); - } catch (InterruptedException e) { - throw new AssertionError(e); - } - } - public static long todayInMillis() { return todayInMillis(Clock.systemUTC()); }