[GitHub] flink issue #3595: [FLINK-6162]Fix bug in ByteArrayOutputStreamWithPos#setPo...

2017-04-07 Thread greghogan
Github user greghogan commented on the issue: https://github.com/apache/flink/pull/3595 @wenlong88 thanks for the contribution (and the ping)! Merging ... --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project do

[GitHub] flink issue #3595: [FLINK-6162]Fix bug in ByteArrayOutputStreamWithPos#setPo...

2017-04-06 Thread wenlong88
Github user wenlong88 commented on the issue: https://github.com/apache/flink/pull/3595 hi, @greghogan , do you have any new comment about the changes? --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does

[GitHub] flink issue #3595: [FLINK-6162]Fix bug in ByteArrayOutputStreamWithPos#setPo...

2017-03-31 Thread wenlong88
Github user wenlong88 commented on the issue: https://github.com/apache/flink/pull/3595 @greghogan I come across this bug when we are trying to write some objects to a byte array: at first, I wrote a 0 as initial size and then the serialized object, after that, I seek back to the star

[GitHub] flink issue #3595: [FLINK-6162]Fix bug in ByteArrayOutputStreamWithPos#setPo...

2017-03-31 Thread greghogan
Github user greghogan commented on the issue: https://github.com/apache/flink/pull/3595 @wenlong88 you are right that the position can currently be moved beyond written data. This still feels a bit like feature creep as we've added to the PR. Do you need to expand the array is this ma

[GitHub] flink issue #3595: [FLINK-6162]Fix bug in ByteArrayOutputStreamWithPos#setPo...

2017-03-30 Thread wenlong88
Github user wenlong88 commented on the issue: https://github.com/apache/flink/pull/3595 @greghogan Currently we check the position with the EndPosition which is the size of buffer instead of a max written size , so it is still possible to leave holes when keeping unmodified. Enabling

[GitHub] flink issue #3595: [FLINK-6162]Fix bug in ByteArrayOutputStreamWithPos#setPo...

2017-03-30 Thread greghogan
Github user greghogan commented on the issue: https://github.com/apache/flink/pull/3595 When expanding with `write` the new capacity (up to `position` of course) is filled with data. Expanding with `setPosition` can leave holes in the data and may mask a bug. Since these classes are u

[GitHub] flink issue #3595: [FLINK-6162]Fix bug in ByteArrayOutputStreamWithPos#setPo...

2017-03-29 Thread wenlong88
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 i

[GitHub] flink issue #3595: [FLINK-6162]Fix bug in ByteArrayOutputStreamWithPos#setPo...

2017-03-27 Thread wenlong88
Github user wenlong88 commented on the issue: https://github.com/apache/flink/pull/3595 hi, @StefanRRichter , I have add check in setPosition in ByteArrayInputSteamWithPos, there is no dependency on this method too, so I rename the method from setPos to setPosition for unifying. ---

[GitHub] flink issue #3595: [FLINK-6162]Fix bug in ByteArrayOutputStreamWithPos#setPo...

2017-03-24 Thread StefanRRichter
Github user StefanRRichter commented on the issue: https://github.com/apache/flink/pull/3595 I would suggest to introduce the analogue check also in `ByteArrayInputStreamWithPos`. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub a

[GitHub] flink issue #3595: [FLINK-6162]Fix bug in ByteArrayOutputStreamWithPos#setPo...

2017-03-23 Thread wenlong88
Github user wenlong88 commented on the issue: https://github.com/apache/flink/pull/3595 @greghogan comments addressed --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and

[GitHub] flink issue #3595: [FLINK-6162]Fix bug in ByteArrayOutputStreamWithPos#setPo...

2017-03-22 Thread wenlong88
Github user wenlong88 commented on the issue: https://github.com/apache/flink/pull/3595 @greghogan thanks for the review, I have changed the change test to use explicit buffer size. you are right that currently there is no dependency on this method. We used the ByteArrayOutputStre