package io.luna.util;

import static com.google.common.base.Preconditions.checkState;

/**
 * A static-utility class that contains functions for manipulating threads.
 *
 * @author lare96 <http://github.org/lare96>
 */
public final class ThreadUtils {

    /**
     * Throws an {@link IllegalStateException} if the current thread is not an initialization thread.
     */
    public static void ensureInitThread() {
        String threadName = Thread.currentThread().getName();
        checkState(threadName.equals("LunaInitializationThread"), "can only be done during initialization");
    }
}

@@ -420,25 +420,28 @@
     
-String t
+Thread currentT
 hread
-Name
  = T
@@ -465,49 +465,64 @@
 ad()
-.getName();%0A        checkState(t
+;%0A        boolean isInitThread = currentT
 hread
+.get
 Name
+()
 .equ
@@ -556,50 +556,114 @@
 ad%22)
-, %22can only be done during initialization%22
+;%0A        checkState(isInitThread, String.format(%22thread%5B%25s%5D not an initialization thread%22, currentThread)
 );%0A 

Print which thread is invalid in ThreadUtils for ensureInitThread