You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ro...@apache.org on 2022/06/27 16:54:11 UTC

[activemq-artemis] branch new-logging updated (e9830782f8 -> 468b5bfd66)

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

robbie pushed a change to branch new-logging
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git


    from e9830782f8 restore some bits previously erroneously changed/removed
     new 0edb2b681c get extra-tests module to compile [only]
     new e735a88682 fix log category naming
     new ba4b79e054 get generated log facade to compile with errorprone enabled
     new 468b5bfd66 restore format string to original, previously changed erroneously

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../activemq/artemis/logprocessor/CodeFactory.java |  4 +--
 .../artemis/logprocessor/LogProcessor.java         |  4 ++-
 .../artemis/core/server/impl/QueueImpl.java        |  2 +-
 tests/extra-tests/pom.xml                          | 28 +++-----------------
 .../artemis/tests/extras/ExtrasTestLogger.java     | 30 ----------------------
 .../artemis/tests/extras/jms/xa/XATest.java        | 10 ++++----
 6 files changed, 15 insertions(+), 63 deletions(-)
 delete mode 100644 tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/ExtrasTestLogger.java


[activemq-artemis] 03/04: get generated log facade to compile with errorprone enabled

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit ba4b79e0548985b37520c89acb4bce15f5452bbe
Author: Robbie Gemmell <ro...@apache.org>
AuthorDate: Mon Jun 27 17:32:38 2022 +0100

    get generated log facade to compile with errorprone enabled
---
 .../java/org/apache/activemq/artemis/logprocessor/CodeFactory.java    | 1 +
 .../java/org/apache/activemq/artemis/logprocessor/LogProcessor.java   | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/artemis-log-facade/src/main/java/org/apache/activemq/artemis/logprocessor/CodeFactory.java b/artemis-log-facade/src/main/java/org/apache/activemq/artemis/logprocessor/CodeFactory.java
index 03695d9d85..16c368dee6 100644
--- a/artemis-log-facade/src/main/java/org/apache/activemq/artemis/logprocessor/CodeFactory.java
+++ b/artemis-log-facade/src/main/java/org/apache/activemq/artemis/logprocessor/CodeFactory.java
@@ -30,6 +30,7 @@ public class CodeFactory {
 
    public static <T> T getCodeClass(final Class<T> type, String category) {
       return doPrivileged(new PrivilegedAction<T>() {
+         @Override
          public T run() {
             try {
                String className = type.getName() + "_impl";
diff --git a/artemis-log-processor/src/main/java/org/apache/activemq/artemis/logprocessor/LogProcessor.java b/artemis-log-processor/src/main/java/org/apache/activemq/artemis/logprocessor/LogProcessor.java
index a78fffc747..b772add78b 100644
--- a/artemis-log-processor/src/main/java/org/apache/activemq/artemis/logprocessor/LogProcessor.java
+++ b/artemis-log-processor/src/main/java/org/apache/activemq/artemis/logprocessor/LogProcessor.java
@@ -217,6 +217,7 @@ public class LogProcessor extends AbstractProcessor {
       // This is really a debug output
       writerOutput.println("   // " + encodeSpecialChars(messageAnnotation.toString()));
 
+      writerOutput.println("   @Override");
       writerOutput.write("   public " + executableMember.getReturnType() + " " + executableMember.getSimpleName() + "(");
 
       Iterator<? extends VariableElement> parameters = executableMember.getParameters().iterator();
@@ -335,6 +336,7 @@ public class LogProcessor extends AbstractProcessor {
 
       // This is really a debug output
       writerOutput.println("   // " + loggerAnnotation.toString());
+      writerOutput.println("   @Override");
       writerOutput.println("   public Logger " + executableMember.getSimpleName() + "() { return logger; }");
       writerOutput.println();
    }
@@ -356,7 +358,7 @@ public class LogProcessor extends AbstractProcessor {
 
       // This is really a debug output
       writerOutput.println("   // " + encodeSpecialChars(messageAnnotation.toString()));
-
+      writerOutput.println("   @Override");
       writerOutput.write("   public void " + executableMember.getSimpleName() + "(");
 
       Iterator<? extends VariableElement> parameters = executableMember.getParameters().iterator();


[activemq-artemis] 04/04: restore format string to original, previously changed erroneously

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 468b5bfd666a4561652af15b0c155535fd725381
Author: Robbie Gemmell <ro...@apache.org>
AuthorDate: Mon Jun 27 17:40:50 2022 +0100

    restore format string to original, previously changed erroneously
---
 .../java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
index d20c520357..36a87dc1d8 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
@@ -3680,7 +3680,7 @@ public class QueueImpl extends CriticalComponentImpl implements Queue {
       if (isAutoCreate && !getAddress().equals(destinationAddress)) {
          if (destinationAddress != null && destinationAddress.length() != 0) {
             SimpleString destinationQueueName = prefix.concat(getAddress()).concat(suffix);
-            SimpleString filter = new SimpleString(String.format("{} = '{}'", Message.HDR_ORIGINAL_ADDRESS, getAddress()));
+            SimpleString filter = new SimpleString(String.format("%s = '%s'", Message.HDR_ORIGINAL_ADDRESS, getAddress()));
             try {
                server.createQueue(new QueueConfiguration(destinationQueueName).setAddress(destinationAddress).setFilterString(filter).setAutoCreated(true).setAutoCreateAddress(true), true);
             } catch (ActiveMQQueueExistsException e) {


[activemq-artemis] 02/04: fix log category naming

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit e735a88682e1849cc91085afd34ebea78be65870
Author: Robbie Gemmell <ro...@apache.org>
AuthorDate: Mon Jun 27 17:20:42 2022 +0100

    fix log category naming
---
 .../java/org/apache/activemq/artemis/logprocessor/CodeFactory.java     | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/artemis-log-facade/src/main/java/org/apache/activemq/artemis/logprocessor/CodeFactory.java b/artemis-log-facade/src/main/java/org/apache/activemq/artemis/logprocessor/CodeFactory.java
index 6f126c461d..03695d9d85 100644
--- a/artemis-log-facade/src/main/java/org/apache/activemq/artemis/logprocessor/CodeFactory.java
+++ b/artemis-log-facade/src/main/java/org/apache/activemq/artemis/logprocessor/CodeFactory.java
@@ -24,9 +24,8 @@ import static java.security.AccessController.doPrivileged;
 
 public class CodeFactory {
 
-
    public static <T> T getCodeClass(final Class<T> type) {
-      return getCodeClass(type, type.getClass().getName());
+      return getCodeClass(type, type.getName());
    }
 
    public static <T> T getCodeClass(final Class<T> type, String category) {


[activemq-artemis] 01/04: get extra-tests module to compile [only]

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 0edb2b681ce94a48197bf2f83ee294444c209415
Author: Robbie Gemmell <ro...@apache.org>
AuthorDate: Mon Jun 27 17:14:06 2022 +0100

    get extra-tests module to compile [only]
---
 tests/extra-tests/pom.xml                          | 28 +++-----------------
 .../artemis/tests/extras/ExtrasTestLogger.java     | 30 ----------------------
 .../artemis/tests/extras/jms/xa/XATest.java        | 10 ++++----
 3 files changed, 9 insertions(+), 59 deletions(-)

diff --git a/tests/extra-tests/pom.xml b/tests/extra-tests/pom.xml
index d7792d513d..c1e54cd70c 100644
--- a/tests/extra-tests/pom.xml
+++ b/tests/extra-tests/pom.xml
@@ -41,6 +41,10 @@
    </properties>
 
    <dependencies>
+      <dependency>
+         <groupId>org.slf4j</groupId>
+         <artifactId>slf4j-api</artifactId>
+      </dependency>
       <dependency>
          <groupId>org.jboss.byteman</groupId>
          <artifactId>byteman</artifactId>
@@ -137,30 +141,6 @@
          <groupId>jakarta.jms</groupId>
          <artifactId>jakarta.jms-api</artifactId>
       </dependency>
-      <dependency>
-         <groupId>org.jboss.logging</groupId>
-         <artifactId>jboss-logging-processor</artifactId>
-         <scope>provided</scope>
-         <optional>true</optional>
-      </dependency>
-      <dependency>
-         <groupId>org.jboss.logging</groupId>
-         <artifactId>jboss-logging-annotations</artifactId>
-         <scope>provided</scope>
-         <optional>true</optional>
-      </dependency>
-      <dependency>
-         <groupId>org.jboss.logging</groupId>
-         <artifactId>jboss-logging</artifactId>
-      </dependency>
-      <dependency>
-         <groupId>org.jboss.logmanager</groupId>
-         <artifactId>jboss-logmanager</artifactId>
-      </dependency>
-      <dependency>
-          <groupId>org.wildfly.common</groupId>
-          <artifactId>wildfly-common</artifactId>
-      </dependency>
       <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/ExtrasTestLogger.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/ExtrasTestLogger.java
deleted file mode 100644
index abca67aaeb..0000000000
--- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/ExtrasTestLogger.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activemq.artemis.tests.extras;
-
-import org.jboss.logging.BasicLogger;
-import org.jboss.logging.Logger;
-import org.jboss.logging.annotations.MessageLogger;
-
-@MessageLogger(projectCode = "AMQTEST")
-public interface ExtrasTestLogger extends BasicLogger {
-
-   /**
-    * The integration test logger.
-    */
-   ExtrasTestLogger LOGGER = Logger.getMessageLogger(ExtrasTestLogger.class, ExtrasTestLogger.class.getPackage().getName());
-}
diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/xa/XATest.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/xa/XATest.java
index f3f4b2d8cc..8c8eb3630b 100644
--- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/xa/XATest.java
+++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/xa/XATest.java
@@ -38,16 +38,18 @@ import com.arjuna.ats.arjuna.coordinator.TxControl;
 import com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionManagerImple;
 import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
 import org.apache.activemq.artemis.core.client.impl.ClientSessionInternal;
-import org.apache.activemq.artemis.tests.extras.ExtrasTestLogger;
 import org.apache.activemq.artemis.tests.util.JMSTestBase;
 import org.jboss.tm.TxUtils;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class XATest extends JMSTestBase {
 
+   private static final Logger logger = LoggerFactory.getLogger(XATest.class);
 
    protected TransactionManager tm;
 
@@ -89,9 +91,7 @@ public class XATest extends JMSTestBase {
       if (tm.getTransaction() != null) {
          Transaction tx = tm.suspend();
          if (tx != null) {
-            ExtrasTestLogger.LOGGER.warn("Transaction still associated with thread " + tx +
-                                            " at status " +
-                                            TxUtils.getStatusAsString(tx.getStatus()));
+            logger.warn("Transaction still associated with thread {} at status {}", tx, TxUtils.getStatusAsString(tx.getStatus()));
          }
       }
 
@@ -1319,7 +1319,7 @@ public class XATest extends JMSTestBase {
          // rollback will cause an attempt to deliver messages locally to the original consumers.
          // the original consumer has closed, so it will cancelled to the server
          // the server cancel is asynch, so we need to sleep for a bit to make sure it completes
-         ExtrasTestLogger.LOGGER.trace("Forcing failure");
+         logger.trace("Forcing failure");
          try {
             tm.commit();
             Assert.fail("should not get here");