flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hsapu...@apache.org
Subject flink git commit: Fix checking null for ternary operator check on Exception#getMessage calls
Date Mon, 09 Mar 2015 16:21:58 GMT
Repository: flink
Updated Branches:
  refs/heads/master f5824499e -> 0b15bc3c5


Fix checking null for ternary operator check on Exception#getMessage calls

Add parentheses on Exception#getMessage calls from pattern of:

"Initializing the input processing failed" + e.getMessage() == null ? "." : ": " + e.getMessage()

to:

"Initializing the input processing failed" + (e.getMessage() == null ? "." : ": " + e.getMessage())

Extra parentheses needed to make sure ternary operator check on e.getMessage scope call.

Author: Henry Saputra <henry.saputra@gmail.com>

Closes #461 from hsaputra/fix_parentheses_exception_getmessage and squashes the following
commits:

1345cbf [Henry Saputra] Fix checking null for Exception#getMessage call from pattern of:


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

Branch: refs/heads/master
Commit: 0b15bc3c5ca67e5b091caf72722588b22bccb07f
Parents: f582449
Author: Henry Saputra <henry.saputra@gmail.com>
Authored: Mon Mar 9 09:21:54 2015 -0700
Committer: Henry Saputra <henry.saputra@gmail.com>
Committed: Mon Mar 9 09:21:54 2015 -0700

----------------------------------------------------------------------
 .../java/org/apache/flink/compiler/dag/OptimizerNode.java    | 3 ++-
 .../org/apache/flink/runtime/operators/DataSinkTask.java     | 4 ++--
 .../org/apache/flink/runtime/operators/RegularPactTask.java  | 8 ++++----
 3 files changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/0b15bc3c/flink-compiler/src/main/java/org/apache/flink/compiler/dag/OptimizerNode.java
----------------------------------------------------------------------
diff --git a/flink-compiler/src/main/java/org/apache/flink/compiler/dag/OptimizerNode.java
b/flink-compiler/src/main/java/org/apache/flink/compiler/dag/OptimizerNode.java
index b717560..55df592 100644
--- a/flink-compiler/src/main/java/org/apache/flink/compiler/dag/OptimizerNode.java
+++ b/flink-compiler/src/main/java/org/apache/flink/compiler/dag/OptimizerNode.java
@@ -1151,7 +1151,8 @@ public abstract class OptimizerNode implements Visitable<OptimizerNode>,
Estimat
 
 		int i = 1; 
 		for (PactConnection conn : getIncomingConnections()) {
-			bld.append('(').append(i++).append(":").append(conn.getShipStrategy() == null ? "null"
: conn.getShipStrategy().name()).append(')');
+			String shipStrategyName = conn.getShipStrategy() == null ? "null" : conn.getShipStrategy().name();
+			bld.append('(').append(i++).append(":").append(shipStrategyName).append(')');
 		}
 
 		return bld.toString();

http://git-wip-us.apache.org/repos/asf/flink/blob/0b15bc3c/flink-runtime/src/main/java/org/apache/flink/runtime/operators/DataSinkTask.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/operators/DataSinkTask.java
b/flink-runtime/src/main/java/org/apache/flink/runtime/operators/DataSinkTask.java
index a5df414..d405d60 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/operators/DataSinkTask.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/operators/DataSinkTask.java
@@ -92,7 +92,7 @@ public class DataSinkTask<IT> extends AbstractInvokable {
 			initInputReaders();
 		} catch (Exception e) {
 			throw new RuntimeException("Initializing the input streams failed" +
-				e.getMessage() == null ? "." : ": " + e.getMessage(), e);
+					(e.getMessage() == null ? "." : ": " + e.getMessage()), e);
 		}
 
 		if (LOG.isDebugEnabled()) {
@@ -156,7 +156,7 @@ public class DataSinkTask<IT> extends AbstractInvokable {
 					input1 = sorter.getIterator();
 				} catch (Exception e) {
 					throw new RuntimeException("Initializing the input processing failed" +
-						e.getMessage() == null ? "." : ": " + e.getMessage(), e);
+							(e.getMessage() == null ? "." : ": " + e.getMessage()), e);
 				}
 				break;
 			default:

http://git-wip-us.apache.org/repos/asf/flink/blob/0b15bc3c/flink-runtime/src/main/java/org/apache/flink/runtime/operators/RegularPactTask.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/operators/RegularPactTask.java
b/flink-runtime/src/main/java/org/apache/flink/runtime/operators/RegularPactTask.java
index 3deac6f..465acb8 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/operators/RegularPactTask.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/operators/RegularPactTask.java
@@ -254,7 +254,7 @@ public class RegularPactTask<S extends Function, OT> extends AbstractInvokable
i
 			initOutputs();
 		} catch (Exception e) {
 			throw new RuntimeException("Initializing the output handlers failed" +
-				e.getMessage() == null ? "." : ": " + e.getMessage(), e);
+					(e.getMessage() == null ? "." : ": " + e.getMessage()), e);
 		}
 
 		if (LOG.isDebugEnabled()) {
@@ -339,7 +339,7 @@ public class RegularPactTask<S extends Function, OT> extends AbstractInvokable
i
 			}
 			catch (Exception e) {
 				throw new RuntimeException("Initializing the input processing failed" +
-					e.getMessage() == null ? "." : ": " + e.getMessage(), e);
+						(e.getMessage() == null ? "." : ": " + e.getMessage()), e);
 			}
 
 			if (!this.running) {
@@ -420,7 +420,7 @@ public class RegularPactTask<S extends Function, OT> extends AbstractInvokable
i
 			}
 		} catch (Exception e) {
 			throw new RuntimeException("Initializing the UDF" +
-				e.getMessage() == null ? "." : ": " + e.getMessage(), e);
+					(e.getMessage() == null ? "." : ": " + e.getMessage()), e);
 		}
 	}
 	
@@ -1002,7 +1002,7 @@ public class RegularPactTask<S extends Function, OT> extends AbstractInvokable
i
 					localStub = initStub(userCodeFunctionType);
 				} catch (Exception e) {
 					throw new RuntimeException("Initializing the user code and the configuration failed"
+
-						e.getMessage() == null ? "." : ": " + e.getMessage(), e);
+							(e.getMessage() == null ? "." : ": " + e.getMessage()), e);
 				}
 				
 				if (!(localStub instanceof FlatCombineFunction)) {


Mime
View raw message