Skip to content

Commit

Permalink
Removing some null checks, where we already know that the variable in…
Browse files Browse the repository at this point in the history
… question is non-null
  • Loading branch information
coheigea committed Jun 21, 2018
1 parent 85b9fb5 commit 7a87a5f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,8 @@ private ProcessBuilder prepareBuilder(ProcessBuilder builder, SubProcessCommandL
builder.command().add(1, outPutFiles.resultFile.toString());

// Shift commands by 2 ordinal positions and load into the builder
if (commands != null) {
for (SubProcessCommandLineArgs.Command s : commands.getParameters()) {
builder.command().add(s.ordinalPosition + 2, s.value);
}
for (SubProcessCommandLineArgs.Command s : commands.getParameters()) {
builder.command().add(s.ordinalPosition + 2, s.value);
}

builder.redirectError(Redirect.appendTo(outPutFiles.errFile.toFile()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,10 @@ private void recordMerge(Collection<W> toBeMerged, W mergeResult) throws Excepti
checkState(otherStateAddressWindows != null,
"Window %s is not ACTIVE or NEW", other);

if (otherStateAddressWindows != null) {
for (W otherStateAddressWindow : otherStateAddressWindows) {
// Since otherTarget equiv other AND other equiv mergeResult
// THEN otherTarget equiv mergeResult.
newStateAddressWindows.add(otherStateAddressWindow);
}
for (W otherStateAddressWindow : otherStateAddressWindows) {
// Since otherTarget equiv other AND other equiv mergeResult
// THEN otherTarget equiv mergeResult.
newStateAddressWindows.add(otherStateAddressWindow);
}
activeWindowToStateAddressWindows.remove(other);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ static BeamSqlExpression buildExpression(RexNode rexNode) {
String.format("%s is not supported yet", rexNode.getClass().toString()));
}

if (ret != null && !ret.accept()) {
if (!ret.accept()) {
throw new IllegalStateException(
ret.getClass().getSimpleName() + " does not accept the operands.(" + rexNode + ")");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ public void onMatch(RelOptRuleCall call) {
final Aggregate aggregate = call.rel(0);
final Project project = call.rel(1);
RelNode x = updateWindow(call, aggregate, project);
if (x != null) {
call.transformTo(x);
}
call.transformTo(x);
}

private static RelNode updateWindow(RelOptRuleCall call, Aggregate aggregate, Project project) {
Expand Down

0 comments on commit 7a87a5f

Please sign in to comment.