Make Trigger#subTriggers public and non-null

Project: http://git-wip-us.apache.org/repos/asf/incubator-beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-beam/commit/87c7811a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-beam/tree/87c7811a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-beam/diff/87c7811a

Branch: refs/heads/master
Commit: 87c7811a3bab6bf4bc0b8b9181127fe074579898
Parents: 3c73170
Author: Kenneth Knowles <k...@google.com>
Authored: Thu Oct 13 20:08:53 2016 -0700
Committer: Kenneth Knowles <k...@google.com>
Committed: Mon Oct 17 19:56:35 2016 -0700

----------------------------------------------------------------------
 .../beam/sdk/transforms/windowing/DefaultTrigger.java       | 2 +-
 .../org/apache/beam/sdk/transforms/windowing/Trigger.java   | 9 ++++++---
 .../java/org/apache/beam/sdk/util/ReshuffleTrigger.java     | 2 +-
 3 files changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/87c7811a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/windowing/DefaultTrigger.java
----------------------------------------------------------------------
diff --git 
a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/windowing/DefaultTrigger.java
 
b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/windowing/DefaultTrigger.java
index d6b72ef..fee7cdf 100644
--- 
a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/windowing/DefaultTrigger.java
+++ 
b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/windowing/DefaultTrigger.java
@@ -30,7 +30,7 @@ import org.joda.time.Instant;
 public class DefaultTrigger extends Trigger{
 
   private DefaultTrigger() {
-    super(null);
+    super();
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/87c7811a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/windowing/Trigger.java
----------------------------------------------------------------------
diff --git 
a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/windowing/Trigger.java
 
b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/windowing/Trigger.java
index a960aa4..cfabb8b 100644
--- 
a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/windowing/Trigger.java
+++ 
b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/windowing/Trigger.java
@@ -20,6 +20,7 @@ package org.apache.beam.sdk.transforms.windowing;
 import com.google.common.base.Joiner;
 import java.io.Serializable;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 import java.util.Objects;
 import javax.annotation.Nullable;
@@ -263,13 +264,15 @@ public abstract class Trigger implements Serializable {
     public abstract MergingTriggerInfo trigger();
   }
 
-  @Nullable
   protected final List<Trigger> subTriggers;
 
-  protected Trigger(@Nullable List<Trigger> subTriggers) {
+  protected Trigger(List<Trigger> subTriggers) {
     this.subTriggers = subTriggers;
   }
 
+  protected Trigger() {
+    this(Collections.EMPTY_LIST);
+  }
 
   /**
    * Called every time an element is incorporated into a window.
@@ -370,7 +373,7 @@ public abstract class Trigger implements Serializable {
     }
   }
 
-  public Iterable<Trigger> subTriggers() {
+  public List<Trigger> subTriggers() {
     return subTriggers;
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/87c7811a/sdks/java/core/src/main/java/org/apache/beam/sdk/util/ReshuffleTrigger.java
----------------------------------------------------------------------
diff --git 
a/sdks/java/core/src/main/java/org/apache/beam/sdk/util/ReshuffleTrigger.java 
b/sdks/java/core/src/main/java/org/apache/beam/sdk/util/ReshuffleTrigger.java
index 9e2c27d..437f14a 100644
--- 
a/sdks/java/core/src/main/java/org/apache/beam/sdk/util/ReshuffleTrigger.java
+++ 
b/sdks/java/core/src/main/java/org/apache/beam/sdk/util/ReshuffleTrigger.java
@@ -31,7 +31,7 @@ import org.joda.time.Instant;
 public class ReshuffleTrigger<W extends BoundedWindow> extends Trigger {
 
   public ReshuffleTrigger() {
-    super(null);
+    super();
   }
 
   @Override

Reply via email to