Attempt to fix intemittent failures in RequestScopeEventMessageDeliveryTest by making certain fields final to prevent possible concurrent write.
@@ -27,8 +27,8 @@ import jakarta.enterprise.context.ApplicationScoped;
@ApplicationScoped
public class Controller {
- private CountDownLatch msgDeliveredLatch = new CountDownLatch(1);
- private CountDownLatch contextDestroyedLatch = new CountDownLatch(1);
+ private final CountDownLatch msgDeliveredLatch = new CountDownLatch(1);
+ private final CountDownLatch contextDestroyedLatch = new CountDownLatch(1);
public CountDownLatch getMsgDeliveredLatch() {
return msgDeliveredLatch;
@@ -37,9 +37,4 @@ public class Controller {
public CountDownLatch getContextDestroyedLatch() {
return contextDestroyedLatch;
}
-
- public void resetLatches() {
- msgDeliveredLatch = new CountDownLatch(1);
- contextDestroyedLatch = new CountDownLatch(1);
- }
}
