activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject [activemq-artemis] branch master updated: ARTEMIS-3033 - fix early visibility on cached simple string parts array
Date Thu, 07 Jan 2021 11:33:03 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
     new c384776  ARTEMIS-3033 - fix early visibility on cached simple string parts array
c384776 is described below

commit c384776d6f9594450ff724214f4f20ede1c444b5
Author: gtully <gary.tully@gmail.com>
AuthorDate: Thu Jan 7 11:32:46 2021 +0000

    ARTEMIS-3033 - fix early visibility on cached simple string parts array
---
 .../main/java/org/apache/activemq/artemis/api/core/SimpleString.java   | 3 +--
 .../activemq/artemis/tests/performance/jmh/AddressMapPerfTest.java     | 1 -
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/SimpleString.java
b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/SimpleString.java
index 1bb9ed6..33b00eb 100644
--- a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/SimpleString.java
+++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/SimpleString.java
@@ -307,8 +307,7 @@ public final class SimpleString implements CharSequence, Serializable,
Comparabl
       }
       pathsList.add(pathAccumulator.toString());
 
-      paths = new String[pathsList.size()];
-      pathsList.toArray(paths);
+      paths = pathsList.toArray(new String[0]);
       return paths;
    }
 
diff --git a/tests/performance-jmh/src/main/java/org/apache/activemq/artemis/tests/performance/jmh/AddressMapPerfTest.java
b/tests/performance-jmh/src/main/java/org/apache/activemq/artemis/tests/performance/jmh/AddressMapPerfTest.java
index 5f4d7f0..f212989 100644
--- a/tests/performance-jmh/src/main/java/org/apache/activemq/artemis/tests/performance/jmh/AddressMapPerfTest.java
+++ b/tests/performance-jmh/src/main/java/org/apache/activemq/artemis/tests/performance/jmh/AddressMapPerfTest.java
@@ -62,7 +62,6 @@ public class AddressMapPerfTest {
       keys = new SimpleString[entries];
       for (int i = 0; i < entries; i++) {
          keys[i] = SimpleString.toSimpleString("topic." + i % entriesLog2 + "." + i);
-         keys[i].getPaths(WILDCARD_CONFIGURATION.getDelimiter()); // getPaths is not thread
safe
       }
    }
 


Mime
View raw message