This is an automated email from the ASF dual-hosted git repository.

clebertsuconic pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git


The following commit(s) were added to refs/heads/main by this push:
     new 99348ee672 ARTEMIS-4569 Removing delegate usage and keep it as 
checkAtomic
99348ee672 is described below

commit 99348ee672fa5d5bc56734d2414a23e32ecec045
Author: Clebert Suconic <clebertsuco...@apache.org>
AuthorDate: Wed Jan 17 15:45:49 2024 -0500

    ARTEMIS-4569 Removing delegate usage and keep it as checkAtomic
---
 .../org/apache/activemq/artemis/utils/runnables/AtomicRunnable.java   | 4 ----
 .../activemq/artemis/core/protocol/openwire/amq/AMQSession.java       | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git 
a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/runnables/AtomicRunnable.java
 
b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/runnables/AtomicRunnable.java
index aa2b7c1dea..e9e5c5e5a5 100644
--- 
a/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/runnables/AtomicRunnable.java
+++ 
b/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/runnables/AtomicRunnable.java
@@ -22,10 +22,6 @@ import java.util.function.Consumer;
 
 public abstract class AtomicRunnable implements Runnable {
 
-   public static AtomicRunnable delegate(Runnable runnable) {
-      return new AtomicRunnableWithDelegate(runnable);
-   }
-
    public static AtomicRunnable checkAtomic(Runnable run) {
       if (run instanceof AtomicRunnable) {
          return (AtomicRunnable)run;
diff --git 
a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQSession.java
 
b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQSession.java
index 1e267d27c8..f1f7c749e1 100644
--- 
a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQSession.java
+++ 
b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQSession.java
@@ -416,7 +416,7 @@ public class AMQSession implements SessionCallback {
             sendShouldBlockProducer(producerInfo, messageSend, 
sendProducerAck, store, dest, count, coreMsg, address);
          } else {
             if (store != null) {
-               if (!store.checkMemory(true, 
AtomicRunnable.delegate(this::restoreAutoRead), 
AtomicRunnable.delegate(this::blockConnection), this.blockedRunnables::add)) {
+               if (!store.checkMemory(true, this::restoreAutoRead, 
this::blockConnection, this.blockedRunnables::add)) {
                   restoreAutoRead();
                   throw new ResourceAllocationException("Queue is full " + 
address);
                }

Reply via email to