From 5cea9bc247c29166ed47df4a191489e4b9b9c572 Mon Sep 17 00:00:00 2001 From: Colin Alworth Date: Mon, 8 Jul 2024 19:29:05 -0500 Subject: [PATCH] refactor: Remove unused java.awt checks in Require/Assert (#5733) Partial #188 --- .../java/io/deephaven/base/verify/Assert.java | 20 ----------- .../io/deephaven/base/verify/Require.java | 33 ------------------- 2 files changed, 53 deletions(-) diff --git a/Base/src/main/java/io/deephaven/base/verify/Assert.java b/Base/src/main/java/io/deephaven/base/verify/Assert.java index 4e01086ae14..394eac6260b 100644 --- a/Base/src/main/java/io/deephaven/base/verify/Assert.java +++ b/Base/src/main/java/io/deephaven/base/verify/Assert.java @@ -3,7 +3,6 @@ // package io.deephaven.base.verify; -import java.awt.EventQueue; import java.util.function.Consumer; // -------------------------------------------------------------------- @@ -359,25 +358,6 @@ public static void notInstanceOf(Object o, String name, Class type) { } } - // ################################################################ - // isAWTThread, isNotAWTThread - - // ---------------------------------------------------------------- - /** assert (current thread is AWT Event Dispatch Thread) */ - public static void isAWTThread() { - if (!EventQueue.isDispatchThread()) { - fail("\"" + Thread.currentThread().getName() + "\".isAWTThread()"); - } - } - - // ---------------------------------------------------------------- - /** assert (current thread is AWT Event Dispatch Thread) */ - public static void isNotAWTThread() { - if (EventQueue.isDispatchThread()) { - fail("!\"" + Thread.currentThread().getName() + "\".isAWTThread()"); - } - } - // ################################################################ // eq (primitiveValue == primitiveValue) diff --git a/Base/src/main/java/io/deephaven/base/verify/Require.java b/Base/src/main/java/io/deephaven/base/verify/Require.java index 8b5dbef0961..81259b73d10 100644 --- a/Base/src/main/java/io/deephaven/base/verify/Require.java +++ b/Base/src/main/java/io/deephaven/base/verify/Require.java @@ -5,9 +5,7 @@ import org.jetbrains.annotations.NotNull; -import java.awt.EventQueue; import java.util.Collection; -import java.util.Collections; import java.util.Map; import java.util.Objects; import java.util.function.Consumer; @@ -582,37 +580,6 @@ public static void notInstanceOf(Object o, String name, Class type) { notInstanceOf(o, name, type, 1); } - // ################################################################ - // isAWTThread, isNotAWTThread - - // ---------------------------------------------------------------- - /** - * require (current thread is AWT Event Dispatch Thread) - */ - public static void isAWTThread() { - isAWTThread(1); - } - - public static void isAWTThread(int numCallsBelowRequirer) { - if (!EventQueue.isDispatchThread()) { - fail("\"" + Thread.currentThread().getName() + "\".isAWTThread()", numCallsBelowRequirer + 1); - } - } - - // ---------------------------------------------------------------- - /** - * require (current thread is AWT Event Dispatch Thread) - */ - public static void isNotAWTThread() { - isNotAWTThread(1); - } - - public static void isNotAWTThread(int numCallsBelowRequirer) { - if (EventQueue.isDispatchThread()) { - fail("!\"" + Thread.currentThread().getName() + "\".isAWTThread()", numCallsBelowRequirer + 1); - } - } - // ################################################################ // eq (primitiveValue == primitiveValue)