Skip to content

Commit 41dbc54

Browse files
committed
Squash SpotBugs warning
1 parent 89dd0e9 commit 41dbc54

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/main/java/com/rabbitmq/stream/codec/QpidProtonCodec.java

+10-8
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import com.rabbitmq.stream.Message;
1919
import com.rabbitmq.stream.MessageBuilder;
2020
import com.rabbitmq.stream.Properties;
21+
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
2122
import java.nio.ByteBuffer;
2223
import java.util.*;
2324
import java.util.function.Function;
@@ -637,28 +638,29 @@ public Message copy() {
637638

638639
// from
639640
// https://github.com/apache/activemq/blob/master/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/message/AmqpWritableBuffer.java
640-
protected static class ByteArrayWritableBuffer implements WritableBuffer {
641+
static class ByteArrayWritableBuffer implements WritableBuffer {
641642

642-
public static final int DEFAULT_CAPACITY = 4 * 1024;
643+
static final int DEFAULT_CAPACITY = 4 * 1024;
643644

644-
byte[] buffer;
645-
int position;
645+
private byte[] buffer;
646+
private int position;
646647

647648
/** Creates a new WritableBuffer with default capacity. */
648-
public ByteArrayWritableBuffer() {
649+
ByteArrayWritableBuffer() {
649650
this(DEFAULT_CAPACITY);
650651
}
651652

652653
/** Create a new WritableBuffer with the given capacity. */
653-
public ByteArrayWritableBuffer(int capacity) {
654+
ByteArrayWritableBuffer(int capacity) {
654655
this.buffer = new byte[capacity];
655656
}
656657

657-
public byte[] getArray() {
658+
@SuppressFBWarnings("EI_EXPOSE_REP")
659+
byte[] getArray() {
658660
return buffer;
659661
}
660662

661-
public int getArrayLength() {
663+
int getArrayLength() {
662664
return position;
663665
}
664666

0 commit comments

Comments
 (0)