Skip to content

Commit

Permalink
refactor: Remove unused java.awt checks in Require/Assert (deephaven#…
Browse files Browse the repository at this point in the history
  • Loading branch information
niloc132 committed Jul 9, 2024
1 parent a301587 commit 5cea9bc
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 53 deletions.
20 changes: 0 additions & 20 deletions Base/src/main/java/io/deephaven/base/verify/Assert.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
//
package io.deephaven.base.verify;

import java.awt.EventQueue;
import java.util.function.Consumer;

// --------------------------------------------------------------------
Expand Down Expand Up @@ -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)

Expand Down
33 changes: 0 additions & 33 deletions Base/src/main/java/io/deephaven/base/verify/Require.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -582,37 +580,6 @@ public static <T> void notInstanceOf(Object o, String name, Class<T> 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)

Expand Down

0 comments on commit 5cea9bc

Please sign in to comment.