I’d like to note a trivial code improvement that can be made to 
StreamExecutionEnvironment.java:1597. Neither is this worthy of its own Jira, 
nor of a pull request. It should probably be incorporated in some general code 
clean-up being done.

 

While the code strictly works as it stands, it is probably better to explicitly 
change the ‘bitwise or’ operator on this line to the ‘logical or’ operator. 
Here’s the Github location:

 

https://github.com/apache/flink/blob/master/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java#L1597

 

and the complete diff of the proposed change:

 

klavi@UGUNS MINGW64 /i/Users/klavi/Src/flink (master)

$ git diff

diff --git 
a/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java
 
b/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java

index 355d2776a0..b6a52d456b 100644

--- 
a/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java

+++ 
b/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java

@@ -1594,7 +1594,7 @@ public abstract class StreamExecutionEnvironment {

                ExecutionEnvironment env = 
ExecutionEnvironment.getExecutionEnvironment();

                if (env instanceof ContextEnvironment) {

                        return new 
StreamContextEnvironment((ContextEnvironment) env);

-               } else if (env instanceof OptimizerPlanEnvironment | env 
instanceof PreviewPlanEnvironment) {

+               } else if (env instanceof OptimizerPlanEnvironment || env 
instanceof PreviewPlanEnvironment) {

                        return new StreamPlanEnvironment(env);

                } else {

                        return createLocalEnvironment();

 

klavi@UGUNS MINGW64 /i/Users/klavi/Src/flink (master)

$

 

Reply via email to