Unnecessary not null check in Appender.encode()
Brought to you by:
niallg
simple-4.1.8
in org.simpleframework.transport.Appender
public String encode(String encoding) throws IOException {
ByteBuffer segment = buffer.duplicate();
//if(segment != null) {
segment.flip();
//}
return encode(encoding, segment);
}
The check on non-null segment is not mandatory.
Anyway encode(encoding, segment) will throw a NullPointerException if segment is null.
Charset.decode(ByteBuffer) throws a NullPointer exception if the ByteBuffer is null.
Thanks, ill address this.
the method ByteBuffer#duplicate() never returns null