[ https://issues.apache.org/jira/browse/FLINK-6162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15947058#comment-15947058 ]
ASF GitHub Bot commented on FLINK-6162: --------------------------------------- Github user greghogan commented on a diff in the pull request: https://github.com/apache/flink/pull/3595#discussion_r108437640 --- Diff: flink-core/src/main/java/org/apache/flink/core/memory/ByteArrayOutputStreamWithPos.java --- @@ -110,7 +110,7 @@ public int getPosition() { } public void setPosition(int position) { - Preconditions.checkArgument(position < getEndPosition(), "Position out of bounds."); + Preconditions.checkArgument(position <= getEndPosition(), "Position out of bounds."); --- End diff -- Check for non-negative. > Fix bug in ByteArrayOutputStreamWithPos#setPosition > --------------------------------------------------- > > Key: FLINK-6162 > URL: https://issues.apache.org/jira/browse/FLINK-6162 > Project: Flink > Issue Type: Bug > Components: Core > Reporter: Wenlong Lyu > Assignee: Wenlong Lyu > > Currently the precondition check in setPosition will fail when the buffer is > full: > {{Preconditions.checkArgument(position < getEndPosition(), "Position out of > bounds.");}} > We should allow the expected position to be the end position -- This message was sent by Atlassian JIRA (v6.3.15#6346)