From 4c454e8abda2da77f8827810e7ac7367dde24aff Mon Sep 17 00:00:00 2001 From: Justin Bertram Date: Wed, 19 Jun 2024 12:16:09 -0500 Subject: [PATCH] ARTEMIS-4747 remove unreachable code --- .../CompressedLargeMessageControllerImpl.java | 26 +++++++------------ 1 file changed, 9 insertions(+), 17 deletions(-) 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 e2e16231e1..76dd273bff 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 @@ -35,7 +35,7 @@ import org.apache.activemq.artemis.utils.UTF8Util; final class CompressedLargeMessageControllerImpl implements LargeMessageController { - private static final String OPERATION_NOT_SUPPORTED = "Operation not supported"; + private static final String OPERATION_NOT_SUPPORTED = "Operation not supported over compressed large messages"; private final LargeMessageController bufferDelegate; @@ -114,10 +114,6 @@ final class CompressedLargeMessageControllerImpl implements LargeMessageControll return dataInput; } - private void positioningNotSupported() { - throw new IllegalStateException("Position not supported over compressed large messages"); - } - @Override public byte readByte() { try { @@ -129,41 +125,37 @@ final class CompressedLargeMessageControllerImpl implements LargeMessageControll @Override public byte getByte(final int index) { - positioningNotSupported(); - return 0; + throw new IllegalStateException(OPERATION_NOT_SUPPORTED); } @Override public void getBytes(final int index, final ActiveMQBuffer dst, final int dstIndex, final int length) { - positioningNotSupported(); + throw new IllegalStateException(OPERATION_NOT_SUPPORTED); } @Override public void getBytes(final int index, final byte[] dst, final int dstIndex, final int length) { - positioningNotSupported(); + throw new IllegalStateException(OPERATION_NOT_SUPPORTED); } @Override public void getBytes(final int index, final ByteBuffer dst) { - positioningNotSupported(); + throw new IllegalStateException(OPERATION_NOT_SUPPORTED); } @Override public int getInt(final int index) { - positioningNotSupported(); - return 0; + throw new IllegalStateException(OPERATION_NOT_SUPPORTED); } @Override public long getLong(final int index) { - positioningNotSupported(); - return 0; + throw new IllegalStateException(OPERATION_NOT_SUPPORTED); } @Override public short getShort(final int index) { - positioningNotSupported(); - return 0; + throw new IllegalStateException(OPERATION_NOT_SUPPORTED); } @Override @@ -239,7 +231,7 @@ final class CompressedLargeMessageControllerImpl implements LargeMessageControll @Override public void setIndex(final int readerIndex, final int writerIndex) { - positioningNotSupported(); + throw new IllegalStateException(OPERATION_NOT_SUPPORTED); } @Override