Rename EventBus#printExecutionOrder(Class) to debugExecutionOrder

The method doesn't print anything, but rather returns a string
containing the debug information.
This commit is contained in:
Kai S. K. Engelbart 2021-11-25 14:34:13 +01:00
parent 39ffb5c82a
commit 5a6d8bcf35
Signed by: kske
GPG Key ID: 8BEB13EC5DF7EF13
3 changed files with 4 additions and 4 deletions

View File

@ -204,7 +204,7 @@ In more complex setups, taking a look at the event handler execution order can b
Event Bus offers a method for this purpose which can be used as follows: Event Bus offers a method for this purpose which can be used as follows:
```java ```java
System.out.println(EventBus.getInstance().printExecutionOrder(SimpleEvent.class)); System.out.println(EventBus.getInstance().debugExecutionOrder(SimpleEvent.class));
``` ```
Then, the execution order can be inspected in the console. Then, the execution order can be inspected in the console.

View File

@ -381,7 +381,7 @@ public final class EventBus {
* @return a human-readable event handler list suitable for debugging purposes * @return a human-readable event handler list suitable for debugging purposes
* @since 1.2.0 * @since 1.2.0
*/ */
public String printExecutionOrder(Class<?> eventType) { public String debugExecutionOrder(Class<?> eventType) {
var handlers = getHandlersFor(eventType); var handlers = getHandlersFor(eventType);
var sj = new StringJoiner("\n"); var sj = new StringJoiner("\n");

View File

@ -45,13 +45,13 @@ class DispatchTest {
} }
/** /**
* Tests {@link EventBus#printExecutionOrder(Class)} based on the currently registered handlers. * Tests {@link EventBus#debugExecutionOrder(Class)} based on the currently registered handlers.
* *
* @since 1.2.0 * @since 1.2.0
*/ */
@Test @Test
void testPrintExecutionOrder() { void testPrintExecutionOrder() {
String executionOrder = bus.printExecutionOrder(SimpleEvent.class); String executionOrder = bus.debugExecutionOrder(SimpleEvent.class);
System.out.println(executionOrder); System.out.println(executionOrder);
assertEquals( assertEquals(
"Event handler execution order for class dev.kske.eventbus.core.SimpleEvent (3 handler(s)):\n" "Event handler execution order for class dev.kske.eventbus.core.SimpleEvent (3 handler(s)):\n"