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 e2e16231e1d..76dd273bff3 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 @@ 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 @@ private DataInputStream getStream() { return dataInput; } - private void positioningNotSupported() { - throw new IllegalStateException("Position not supported over compressed large messages"); - } - @Override public byte readByte() { try { @@ -129,41 +125,37 @@ public byte readByte() { @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 @@ public void writerIndex(final int writerIndex) { @Override public void setIndex(final int readerIndex, final int writerIndex) { - positioningNotSupported(); + throw new IllegalStateException(OPERATION_NOT_SUPPORTED); } @Override