This is an automated email from the ASF dual-hosted git repository.
ahuber pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/causeway.git
The following commit(s) were added to refs/heads/main by this push:
new bb6a6766e7e CAUSEWAY-3972: simplifies test; comments
bb6a6766e7e is described below
commit bb6a6766e7e5cebec6f9f3a2c8b134a1679d3748
Author: andi-huber <[email protected]>
AuthorDate: Wed Mar 4 16:48:28 2026 +0100
CAUSEWAY-3972: simplifies test; comments
---
.../apache/causeway/commons/internal/base/_OneshotTest.java | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git
a/commons/src/test/java/org/apache/causeway/commons/internal/base/_OneshotTest.java
b/commons/src/test/java/org/apache/causeway/commons/internal/base/_OneshotTest.java
index 12ecfa93522..a5ef79e95d3 100644
---
a/commons/src/test/java/org/apache/causeway/commons/internal/base/_OneshotTest.java
+++
b/commons/src/test/java/org/apache/causeway/commons/internal/base/_OneshotTest.java
@@ -28,12 +28,12 @@
class _OneshotTest {
- final _Oneshot a = new _Oneshot();
+ final _Oneshot oneshot = new _Oneshot();
final LongAdder counter = new LongAdder();
@Test
void test() {
- a.trigger(this::sayHelloOnce);
+ oneshot.trigger(this::sayHelloOnce);
}
@SneakyThrows
@@ -44,13 +44,11 @@ void sayHelloOnce() {
counter.increment();
- var thread = new Thread(this::doMoreWork);
+ // calling 'sayHelloOnce' from a different thread, while still
executing in the main thread,
+ // must not lead to a recursions
+ var thread = new Thread(this::sayHelloOnce);
thread.start();
thread.join();
}
- void doMoreWork() {
- a.trigger(this::sayHelloOnce);
- }
-
}