flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uce <...@git.apache.org>
Subject [GitHub] incubator-flink pull request: [FLINK-1040] Make type() call in pro...
Date Wed, 19 Nov 2014 11:24:25 GMT
Github user uce commented on a diff in the pull request:

    --- Diff: flink-java/src/main/java/org/apache/flink/api/java/operators/CrossOperator.java
    @@ -356,7 +381,7 @@ public CrossProjection(DataSet<I1> ds1, DataSet<I2> ds2,
int[] firstFieldIndexes
     				// check field indexes and adapt to position in tuple
     				int maxFieldIndex = firstInput ? numFieldsDs1 : numFieldsDs2;
     				for(int i=0; i<this.fieldIndexes.length; i++) {
    -					if(this.fieldIndexes[i] > maxFieldIndex - 1) {
    +					if(this.fieldIndexes[i] > maxFieldIndex - 1 || this.fieldIndexes[i] < 0) {
    --- End diff --
    minor: I think we should replace these checks with [Preconditions.checkElementIndex](http://docs.guava-libraries.googlecode.com/git-history/release/javadoc/com/google/common/base/Preconditions.html#checkElementIndex%28int,%20int%29),
which is more concise and throws the respective Exception for you (it might be a matter of
taste though :P).

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.

View raw message