[FLINK-4608] Use short-circuit AND in Max/Min AggregationFunction

This closes #2489.


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/9046374c
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/9046374c
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/9046374c

Branch: refs/heads/master
Commit: 9046374c6b5b35589d90416725c1e8eb09843bea
Parents: f06930b
Author: Alexander Pivovarov <apivova...@gmail.com>
Authored: Fri Sep 9 21:52:36 2016 -0700
Committer: zentol <ches...@apache.org>
Committed: Fri Sep 16 12:34:34 2016 +0200

----------------------------------------------------------------------
 .../apache/flink/api/java/aggregation/MaxAggregationFunction.java  | 2 +-
 .../apache/flink/api/java/aggregation/MinAggregationFunction.java  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/9046374c/flink-java/src/main/java/org/apache/flink/api/java/aggregation/MaxAggregationFunction.java
----------------------------------------------------------------------
diff --git 
a/flink-java/src/main/java/org/apache/flink/api/java/aggregation/MaxAggregationFunction.java
 
b/flink-java/src/main/java/org/apache/flink/api/java/aggregation/MaxAggregationFunction.java
index d1edbe2..69715c3 100644
--- 
a/flink-java/src/main/java/org/apache/flink/api/java/aggregation/MaxAggregationFunction.java
+++ 
b/flink-java/src/main/java/org/apache/flink/api/java/aggregation/MaxAggregationFunction.java
@@ -98,7 +98,7 @@ public abstract class MaxAggregationFunction<T extends 
Comparable<T>> extends Ag
                @Override
                public <T> AggregationFunction<T> 
createAggregationFunction(Class<T> type) {
                        if (Comparable.class.isAssignableFrom(type)) {
-                               if 
(ResettableValue.class.isAssignableFrom(type) & 
CopyableValue.class.isAssignableFrom(type)) {
+                               if 
(ResettableValue.class.isAssignableFrom(type) && 
CopyableValue.class.isAssignableFrom(type)) {
                                        return (AggregationFunction<T>) new 
MutableMaxAgg();
                                } else {
                                        return (AggregationFunction<T>) new 
ImmutableMaxAgg();

http://git-wip-us.apache.org/repos/asf/flink/blob/9046374c/flink-java/src/main/java/org/apache/flink/api/java/aggregation/MinAggregationFunction.java
----------------------------------------------------------------------
diff --git 
a/flink-java/src/main/java/org/apache/flink/api/java/aggregation/MinAggregationFunction.java
 
b/flink-java/src/main/java/org/apache/flink/api/java/aggregation/MinAggregationFunction.java
index a4a9e0e..c7ebcc5 100644
--- 
a/flink-java/src/main/java/org/apache/flink/api/java/aggregation/MinAggregationFunction.java
+++ 
b/flink-java/src/main/java/org/apache/flink/api/java/aggregation/MinAggregationFunction.java
@@ -98,7 +98,7 @@ public abstract class MinAggregationFunction<T extends 
Comparable<T>> extends Ag
                @Override
                public <T> AggregationFunction<T> 
createAggregationFunction(Class<T> type) {
                        if (Comparable.class.isAssignableFrom(type)) {
-                               if 
(ResettableValue.class.isAssignableFrom(type) & 
CopyableValue.class.isAssignableFrom(type)) {
+                               if 
(ResettableValue.class.isAssignableFrom(type) && 
CopyableValue.class.isAssignableFrom(type)) {
                                        return (AggregationFunction<T>) new 
MutableMinAgg();
                                } else {
                                        return (AggregationFunction<T>) new 
ImmutableMinAgg();

Reply via email to