This is an automated email from the ASF dual-hosted git repository. clebertsuconic pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git
commit 99c819b77657119a2940c6b79dfab1c301e81456 Author: Francesco Nigro <[email protected]> AuthorDate: Fri May 29 18:43:21 2020 +0200 ARTEMIS-2785 removed unused and leak-prone readBytes method --- .../apache/activemq/artemis/api/core/ActiveMQBuffer.java | 13 ------------- .../artemis/core/buffers/impl/ChannelBufferWrapper.java | 5 ----- .../client/impl/CompressedLargeMessageControllerImpl.java | 8 -------- .../core/client/impl/LargeMessageControllerImpl.java | 9 --------- 4 files changed, 35 deletions(-) diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQBuffer.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQBuffer.java index e9cd68b..1b42d48 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQBuffer.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/ActiveMQBuffer.java @@ -800,19 +800,6 @@ public interface ActiveMQBuffer extends DataInput { String readUTF(); /** - * Transfers this buffer's data to a newly created buffer starting at - * the current {@code readerIndex} and increases the {@code readerIndex} - * by the number of the transferred bytes (= {@code length}). - * The returned buffer's {@code readerIndex} and {@code writerIndex} are - * {@code 0} and {@code length} respectively. - * - * @param length the number of bytes to transfer - * @return the newly created buffer which contains the transferred bytes - * @throws IndexOutOfBoundsException if {@code length} is greater than {@code this.readableBytes} - */ - ActiveMQBuffer readBytes(int length); - - /** * Returns a new slice of this buffer's sub-region starting at the current * {@code readerIndex} and increases the {@code readerIndex} by the size * of the new slice (= {@code length}). diff --git a/artemis-commons/src/main/java/org/apache/activemq/artemis/core/buffers/impl/ChannelBufferWrapper.java b/artemis-commons/src/main/java/org/apache/activemq/artemis/core/buffers/impl/ChannelBufferWrapper.java index a6a5b80..e1848bf 100644 --- a/artemis-commons/src/main/java/org/apache/activemq/artemis/core/buffers/impl/ChannelBufferWrapper.java +++ b/artemis-commons/src/main/java/org/apache/activemq/artemis/core/buffers/impl/ChannelBufferWrapper.java @@ -331,11 +331,6 @@ public class ChannelBufferWrapper implements ActiveMQBuffer { } @Override - public ActiveMQBuffer readBytes(final int length) { - return new ChannelBufferWrapper(buffer.readBytes(length), releasable); - } - - @Override public char readChar() { return (char) buffer.readShort(); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/CompressedLargeMessageControllerImpl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/CompressedLargeMessageControllerImpl.java index 5c33faf..58c3511 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/CompressedLargeMessageControllerImpl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/CompressedLargeMessageControllerImpl.java @@ -24,7 +24,6 @@ import java.nio.ByteBuffer; import io.netty.buffer.ByteBuf; import org.apache.activemq.artemis.api.core.ActiveMQBuffer; -import org.apache.activemq.artemis.api.core.ActiveMQBuffers; import org.apache.activemq.artemis.api.core.ActiveMQException; import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.core.client.ActiveMQClientLogger; @@ -593,13 +592,6 @@ final class CompressedLargeMessageControllerImpl implements LargeMessageControll } @Override - public ActiveMQBuffer readBytes(final int length) { - byte[] bytesToGet = new byte[length]; - readBytes(bytesToGet); - return ActiveMQBuffers.wrappedBuffer(bytesToGet); - } - - @Override public double readDouble() { return Double.longBitsToDouble(readLong()); } diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/LargeMessageControllerImpl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/LargeMessageControllerImpl.java index f08e2b8..008b21f 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/LargeMessageControllerImpl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/LargeMessageControllerImpl.java @@ -31,7 +31,6 @@ import java.util.concurrent.TimeUnit; import io.netty.buffer.ByteBuf; import org.apache.activemq.artemis.api.core.ActiveMQBuffer; -import org.apache.activemq.artemis.api.core.ActiveMQBuffers; import org.apache.activemq.artemis.api.core.ActiveMQException; import org.apache.activemq.artemis.api.core.ActiveMQExceptionType; import org.apache.activemq.artemis.api.core.ActiveMQInterruptedException; @@ -976,14 +975,6 @@ public class LargeMessageControllerImpl implements LargeMessageController { } @Override - public ActiveMQBuffer readBytes(final int length) { - byte[] bytesToGet = new byte[length]; - getBytes(readerIndex, bytesToGet); - readerIndex += length; - return ActiveMQBuffers.wrappedBuffer(bytesToGet); - } - - @Override public double readDouble() { return Double.longBitsToDouble(readLong()); }
