[ 
https://issues.apache.org/jira/browse/FLINK-6162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15948441#comment-15948441
 ] 

ASF GitHub Bot commented on FLINK-6162:
---------------------------------------

Github user wenlong88 commented on the issue:

    https://github.com/apache/flink/pull/3595
  
    @greghogan Thanks for the review. I have add non-negative check and update 
the test with ExpectedException. But I don't think we need to call toString in 
the test since we have check the position instead I add a test to verify that 
toString returns the substring with range(0, position) to meet your concern. 
One update about setPosition in outputStream, I think it is better to auto 
extend the buffer when setting a position larger than the buffer size, just 
like the auto extending in write.


> 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)

Reply via email to