Skip to content
Permalink
Browse files
This closes #3179
  • Loading branch information
clebertsuconic committed Jun 15, 2020
2 parents 181743f + 95d8b89 commit 3810146dd2b670355ed74bd5860aff132a731b96
Showing 104 changed files with 531 additions and 332 deletions.
@@ -2,6 +2,8 @@ language: java
install: true
jdk:
- openjdk8
- openjdk11
- openjdk14

# clean out Artemis artifacts from the cache
before_install:
@@ -19,5 +21,5 @@ script:
cache:
directories:
- $HOME/.m2
before_cache:
before_cache:
- rm -rf $HOME/.m2/repository/org/apache/activemq/artemis-*
@@ -35,6 +35,10 @@
</properties>

<dependencies>
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
@@ -48,6 +48,10 @@
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
@@ -108,6 +108,10 @@
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
@@ -101,7 +101,7 @@ protected CheckTask[] getCheckTasks() {

if (browse != null) {
if (browse == -1) {
checkTasks.add(new CheckTask(String.format("a consumer can browse the queue",
checkTasks.add(new CheckTask(String.format("a consumer can browse the queue %s",
getName()), this::checkQueueBrowse));
} else if (browse > 0) {
checkTasks.add(new CheckTask(String.format("a consumer can browse %d messages from the queue %s",
@@ -50,6 +50,10 @@
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
</dependency>
<dependency>
<groupId>org.wildfly.common</groupId>
<artifactId>wildfly-common</artifactId>
@@ -19,7 +19,7 @@
/**
* <p>Encodes and decodes to and from Base64 notation.</p>
* <p>Homepage: <a href="http://iharder.net/base64">http://iharder.net/base64</a>.</p>
* <p>The <tt>options</tt> parameter, which appears in a few places, is used to pass
* <p>The <code>options</code> parameter, which appears in a few places, is used to pass
* several pieces of information to the encoder. In the "higher level" methods such as
* encodeBytes( bytes, options ) the options parameter can be used to indicate such
* things as first gzipping the bytes before encoding them, not inserting linefeeds
@@ -66,9 +66,9 @@
* when data that's being decoded is gzip-compressed and will decompress it
* automatically. Generally things are cleaner. You'll probably have to
* change some method calls that you were making to support the new
* options format (<tt>int</tt>s that you "OR" together).</li>
* options format (<code>int</code>s that you "OR" together).</li>
* <li>v1.5.1 - Fixed bug when decompressing and decoding to a
* byte[] using <tt>decode( String s, boolean gzipCompressed )</tt>.
* byte[] using <code>decode( String s, boolean gzipCompressed )</code>.
* Added the ability to "suspend" encoding in the Output Stream so
* you can turn on and off the encoding if you need to embed base64
* data in an otherwise "normal" stream (like an XML file).</li>
@@ -484,7 +484,7 @@ private static byte[] encode3to4(final byte[] source,
* Serializes an object and returns the Base64-encoded
* version of that serialized object. If the object
* cannot be serialized or there is another error,
* the method will return <tt>null</tt>.
* the method will return <code>null</code>.
* The object is not GZip-compressed before being encoded.
*
* @param serializableObject The object to encode
@@ -499,7 +499,7 @@ public static String encodeObject(final java.io.Serializable serializableObject)
* Serializes an object and returns the Base64-encoded
* version of that serialized object. If the object
* cannot be serialized or there is another error,
* the method will return <tt>null</tt>.
* the method will return <code>null</code>.
* <p>
* Valid options:<pre>
* GZIP: gzip-compresses object before encoding it.
@@ -931,7 +931,7 @@ public static byte[] decode(final String s, final int options) {

/**
* Attempts to decode Base64 data and deserialize a Java
* Object within. Returns <tt>null</tt> if there was an error.
* Object within. Returns <code>null</code> if there was an error.
*
* @param encodedObject The Base64 data to decode
* @return The decoded and deserialized object
@@ -972,7 +972,7 @@ public static Object decodeToObject(final String encodedObject) {
*
* @param dataToEncode byte array of data to encode in base64 form
* @param filename Filename for saving encoded data
* @return <tt>true</tt> if successful, <tt>false</tt> otherwise
* @return <code>true</code> if successful, <code>false</code> otherwise
* @since 2.1
*/
public static boolean encodeToFile(final byte[] dataToEncode, final String filename) {
@@ -1000,7 +1000,7 @@ public static boolean encodeToFile(final byte[] dataToEncode, final String filen
*
* @param dataToDecode Base64-encoded data as a string
* @param filename Filename for saving decoded data
* @return <tt>true</tt> if successful, <tt>false</tt> otherwise
* @return <code>true</code> if successful, <code>false</code> otherwise
* @since 2.1
*/
public static boolean decodeToFile(final String dataToDecode, final String filename) {
@@ -1116,7 +1116,7 @@ public static String encodeFromFile(final String filename) {
} // end encodeFromFile

/**
* Reads <tt>infile</tt> and encodes it to <tt>outfile</tt>.
* Reads <code>infile</code> and encodes it to <code>outfile</code>.
*
* @param infile Input file
* @param outfile Output file
@@ -1153,7 +1153,7 @@ public static boolean encodeFileToFile(final String infile, final String outfile
} // end encodeFileToFile

/**
* Reads <tt>infile</tt> and decodes it to <tt>outfile</tt>.
* Reads <code>infile</code> and decodes it to <code>outfile</code>.
*
* @param infile Input file
* @param outfile Output file
@@ -1193,7 +1193,7 @@ public static boolean decodeFileToFile(final String infile, final String outfile

/**
* A {@link Base64.InputStream} will read data from another
* <tt>java.io.InputStream</tt>, given in the constructor,
* <code>java.io.InputStream</code>, given in the constructor,
* and encode/decode to/from Base64 notation on the fly.
*
* @see Base64
@@ -1224,7 +1224,7 @@ public static class InputStream extends java.io.FilterInputStream {
/**
* Constructs a {@link Base64.InputStream} in DECODE mode.
*
* @param in the <tt>java.io.InputStream</tt> from which to read data.
* @param in the <code>java.io.InputStream</code> from which to read data.
* @since 1.3
*/
public InputStream(final java.io.InputStream in) {
@@ -1244,7 +1244,7 @@ public InputStream(final java.io.InputStream in) {
* <p>
* Example: <code>new Base64.InputStream( in, Base64.DECODE )</code>
*
* @param in the <tt>java.io.InputStream</tt> from which to read data.
* @param in the <code>java.io.InputStream</code> from which to read data.
* @param options Specified options
* @see Base64#ENCODE
* @see Base64#DECODE
@@ -1404,7 +1404,7 @@ public int read(final byte[] dest, final int off, final int len) throws java.io.

/**
* A {@link Base64.OutputStream} will write data to another
* <tt>java.io.OutputStream</tt>, given in the constructor,
* <code>java.io.OutputStream</code>, given in the constructor,
* and encode/decode to/from Base64 notation on the fly.
*
* @see Base64
@@ -1437,7 +1437,7 @@ public static class OutputStream extends java.io.FilterOutputStream {
/**
* Constructs a {@link Base64.OutputStream} in ENCODE mode.
*
* @param out the <tt>java.io.OutputStream</tt> to which data will be written.
* @param out the <code>java.io.OutputStream</code> to which data will be written.
* @since 1.3
*/
public OutputStream(final java.io.OutputStream out) {
@@ -1457,7 +1457,7 @@ public OutputStream(final java.io.OutputStream out) {
* <p>
* Example: <code>new Base64.OutputStream( out, Base64.ENCODE )</code>
*
* @param out the <tt>java.io.OutputStream</tt> to which data will be written.
* @param out the <code>java.io.OutputStream</code> to which data will be written.
* @param options Specified options.
* @see Base64#ENCODE
* @see Base64#DECODE
@@ -44,21 +44,21 @@
*
* <p>Examples of IP addresses and their byte representations:
* <ul>
* <li>The IPv4 loopback address, {@code "127.0.0.1"}.<br/>
* <li>The IPv4 loopback address, {@code "127.0.0.1"}.<br>
* {@code 7f 00 00 01}
*
* <li>The IPv6 loopback address, {@code "::1"}.<br/>
* <li>The IPv6 loopback address, {@code "::1"}.<br>
* {@code 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01}
*
* <li>From the IPv6 reserved documentation prefix ({@code 2001:db8::/32}),
* {@code "2001:db8::1"}.<br/>
* {@code "2001:db8::1"}.<br>
* {@code 20 01 0d b8 00 00 00 00 00 00 00 00 00 00 00 01}
*
* <li>An IPv6 "IPv4 compatible" (or "compat") address,
* {@code "::192.168.0.1"}.<br/>
* {@code "::192.168.0.1"}.<br>
* {@code 00 00 00 00 00 00 00 00 00 00 00 00 c0 a8 00 01}
*
* <li>An IPv6 "IPv4 mapped" address, {@code "::ffff:192.168.0.1"}.<br/>
* <li>An IPv6 "IPv4 mapped" address, {@code "::ffff:192.168.0.1"}.<br>
* {@code 00 00 00 00 00 00 00 00 00 00 ff ff c0 a8 00 01}
* </ul>
*
@@ -171,7 +171,7 @@ public static String getClassPath(File libfolder) {
* @param logOutput
* @param logErrorOutput
* @param useLogging
* @param debugPort if <=0 it means no debug
* @param debugPort if &lt;=0 it means no debug
* @param args
* @return
* @throws IOException
@@ -64,7 +64,7 @@
private volatile long cachedLastIndex = 0;

/**
* @throws IllegalArgumentException if {@code chunkSize} is <0 or not a power of 2
* @throws IllegalArgumentException if {@code chunkSize} is &lt;0 or not a power of 2
*/
public ConcurrentAppendOnlyChunkedList(final int chunkSize) {
if (chunkSize <= 0) {
@@ -33,9 +33,9 @@
/**
* Map from long to an Object.
*
* Provides similar methods as a ConcurrentMap<long,Object> with 2 differences:
* Provides similar methods as a {@literal ConcurrentMap<long,Object>} with 2 differences:
* <ol>
* <li>No boxing/unboxing from long -> Long
* <li>No boxing/unboxing from {@literal long -> Long}
* <li>Open hash map with linear probing, no node allocations to store the values
* </ol>
*
@@ -34,7 +34,7 @@
* Provides similar methods as a ConcurrentSet&lt;Long&gt; but since it's an open hash map with linear probing, no node
* allocations are required to store the values.
* <p>
* Items <strong>MUST</strong> be >= 0.
* Items <strong>MUST</strong> be &gt;= 0.
*/
public class ConcurrentLongHashSet {

@@ -28,7 +28,7 @@
import java.util.Set;

/**
* A hash set implementation of {@link Set<Long>} that uses open addressing values.
* A hash set implementation of {@literal Set<Long>} that uses open addressing values.
* To minimize the memory footprint, this class uses open addressing rather than chaining.
* Collisions are resolved using linear probing. Deletions implement compaction, so cost of
* remove can approach O(N) for full maps, which makes a small loadFactor recommended.
@@ -28,7 +28,7 @@
* it's a linked list of arrays/chunks of {@code T}.<br>
* Differently from an {@code UnrolledLinkedList} this list doesn't optimize addition and removal to achieve a balanced
* utilization among chunks ie a chunk is removed only if empty and chunks can't be merged.
* This list has been optimized for small-sized chunks (ideally <= 32 elements): this allow search/removal to
* This list has been optimized for small-sized chunks (ideally &lt;= 32 elements): this allow search/removal to
* be performed with a greedy approach despite a sparse chunk utilization (ie chunks contains few sparse elements).<br>
*
* From the memory footprint's point of view, this list won't remove the last remaining array although empty to optimize
@@ -52,8 +52,6 @@ public void update(ResettableIterator<E> iterator) {
* It is important that on nulling off the changedIterator, we atomically compare and set as the
* changedIterator could be further updated by another thread whilst we are resetting,
* the subsequent update simply would be picked up on the next reset.
*
* @return this (itself).
*/
@Override
public void reset() {
@@ -22,7 +22,7 @@
* You update a long every time you enter a critical path
* you update a different long with a System.nanoTime every time you leave that path.
*
* If the enterCritical > leaveCritical at any point, then you need to measure the timeout.
* If the enterCritical &gt; leaveCritical at any point, then you need to measure the timeout.
* if the system stops responding, then you have something irresponsive at the system.
*/
public interface CriticalComponent {
@@ -247,6 +247,7 @@ public void reducesSizeWhenElementRemoved() {
Assert.assertEquals(1, testSet.size());
}

@SuppressWarnings("CollectionToArraySafeParameter")
@Test(expected = ArrayStoreException.class)
public void toArrayThrowsArrayStoreExceptionForWrongType() {
testSet.toArray(new String[1]);
@@ -44,7 +44,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.0</version>
<version>3.2.3</version>
<executions>
<execution>
<phase>package</phase>
@@ -97,8 +97,8 @@
</transformers>
<relocations>
<relocation>
<pattern>org.apache.activemq</pattern>
<shadedPattern>org.apache.activemq</shadedPattern>
<pattern>org.apache.activemq</pattern>
<shadedPattern>org.apache.activemq</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache.geronimo</pattern>
@@ -56,6 +56,10 @@
<scope>provided</scope>
<optional>true</optional>
</dependency>