flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From greghogan <...@git.apache.org>
Subject [GitHub] flink pull request #3595: [FLINK-6162]Fix bug in ByteArrayOutputStreamWithPo...
Date Wed, 29 Mar 2017 12:56:37 GMT
Github user greghogan commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3595#discussion_r108437565
  
    --- Diff: flink-core/src/main/java/org/apache/flink/core/memory/ByteArrayInputStreamWithPos.java
---
    @@ -118,7 +118,8 @@ public int getPosition() {
     		return position;
     	}
     
    -	public void setPos(int pos) {
    +	public void setPosition(int pos) {
    +		Preconditions.checkArgument(pos < count, "Position out of bounds.");
    --- End diff --
    
    Allow for equality as with `ByteArrayOutputStreamWithPos`? And check for non-negative.
Should we create a matching `getEndPosition()` as in `ByteArrayOutputStreamWithPos`?


---
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 wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message