beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject [2/2] incubator-beam git commit: Fix findbugs errors and re-enable for runners-core
Date Wed, 09 Nov 2016 22:53:57 GMT
Fix findbugs errors and re-enable for runners-core


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

Branch: refs/heads/master
Commit: 047911d392dc2def547c318aecaf716abe3199b8
Parents: f802919
Author: Kenneth Knowles <klk@google.com>
Authored: Tue Nov 8 14:49:09 2016 -0800
Committer: Kenneth Knowles <klk@google.com>
Committed: Wed Nov 9 14:47:23 2016 -0800

----------------------------------------------------------------------
 runners/core-java/pom.xml                           | 12 ------------
 .../apache/beam/runners/core/SplittableParDo.java   |  1 -
 .../core/UnboundedReadFromBoundedSource.java        |  3 ++-
 .../runners/core/triggers/TriggerStateMachines.java | 16 +++++++++++++++-
 4 files changed, 17 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/047911d3/runners/core-java/pom.xml
----------------------------------------------------------------------
diff --git a/runners/core-java/pom.xml b/runners/core-java/pom.xml
index aa5f145..40ebf58 100644
--- a/runners/core-java/pom.xml
+++ b/runners/core-java/pom.xml
@@ -33,18 +33,6 @@
   <packaging>jar</packaging>
 
   <build>
-    <pluginManagement>
-      <plugins>
-        <!-- BEAM-922 -->
-        <plugin>
-          <groupId>org.codehaus.mojo</groupId>
-          <artifactId>findbugs-maven-plugin</artifactId>
-          <configuration>
-            <skip>true</skip>
-          </configuration>
-        </plugin>
-      </plugins>
-    </pluginManagement>
     <plugins>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/047911d3/runners/core-java/src/main/java/org/apache/beam/runners/core/SplittableParDo.java
----------------------------------------------------------------------
diff --git a/runners/core-java/src/main/java/org/apache/beam/runners/core/SplittableParDo.java
b/runners/core-java/src/main/java/org/apache/beam/runners/core/SplittableParDo.java
index d8ee1d5..cea75b3 100644
--- a/runners/core-java/src/main/java/org/apache/beam/runners/core/SplittableParDo.java
+++ b/runners/core-java/src/main/java/org/apache/beam/runners/core/SplittableParDo.java
@@ -241,7 +241,6 @@ public class SplittableParDo<
       this.windowCoder = windowCoder;
       elementTag =
           StateTags.value("element", WindowedValue.getFullCoder(elementCoder, this.windowCoder));
-      DoFnInvoker<InputT, OutputT> invoker = DoFnInvokers.INSTANCE.newByteBuddyInvoker(fn);
       restrictionTag = StateTags.value("restriction", restrictionCoder);
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/047911d3/runners/core-java/src/main/java/org/apache/beam/runners/core/UnboundedReadFromBoundedSource.java
----------------------------------------------------------------------
diff --git a/runners/core-java/src/main/java/org/apache/beam/runners/core/UnboundedReadFromBoundedSource.java
b/runners/core-java/src/main/java/org/apache/beam/runners/core/UnboundedReadFromBoundedSource.java
index 2afdcf2..29dc57e 100644
--- a/runners/core-java/src/main/java/org/apache/beam/runners/core/UnboundedReadFromBoundedSource.java
+++ b/runners/core-java/src/main/java/org/apache/beam/runners/core/UnboundedReadFromBoundedSource.java
@@ -469,7 +469,8 @@ public class UnboundedReadFromBoundedSource<T> extends PTransform<PBegin,
PColle
       }
 
       private boolean advance() throws IOException {
-        if (reader == null && !closed) {
+        checkArgument(!closed, "advance() call on closed %s", getClass().getName());
+        if (reader == null) {
           reader = residualSource.createReader(options);
           return reader.start();
         } else {

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/047911d3/runners/core-java/src/main/java/org/apache/beam/runners/core/triggers/TriggerStateMachines.java
----------------------------------------------------------------------
diff --git a/runners/core-java/src/main/java/org/apache/beam/runners/core/triggers/TriggerStateMachines.java
b/runners/core-java/src/main/java/org/apache/beam/runners/core/triggers/TriggerStateMachines.java
index f19f3cf..1973f92 100644
--- a/runners/core-java/src/main/java/org/apache/beam/runners/core/triggers/TriggerStateMachines.java
+++ b/runners/core-java/src/main/java/org/apache/beam/runners/core/triggers/TriggerStateMachines.java
@@ -19,6 +19,7 @@ package org.apache.beam.runners.core.triggers;
 
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.collect.Lists;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.util.List;
@@ -86,7 +87,6 @@ public class TriggerStateMachines {
     }
 
     private Method getEvaluationMethod(Class<?> clazz) {
-      Method evaluationMethod;
       try {
         return getClass().getDeclaredMethod("evaluateSpecific", clazz);
       } catch (NoSuchMethodException exc) {
@@ -97,26 +97,32 @@ public class TriggerStateMachines {
       }
     }
 
+    @SuppressFBWarnings("UPM_UNCALLED_PRIVATE_METHOD")
     private TriggerStateMachine evaluateSpecific(DefaultTrigger v) {
       return DefaultTriggerStateMachine.of();
     }
 
+    @SuppressFBWarnings("UPM_UNCALLED_PRIVATE_METHOD")
     private TriggerStateMachine evaluateSpecific(ReshuffleTrigger v) {
       return new ReshuffleTriggerStateMachine();
     }
 
+    @SuppressFBWarnings("UPM_UNCALLED_PRIVATE_METHOD")
     private OnceTriggerStateMachine evaluateSpecific(AfterWatermark.FromEndOfWindow v) {
       return AfterWatermarkStateMachine.pastEndOfWindow();
     }
 
+    @SuppressFBWarnings("UPM_UNCALLED_PRIVATE_METHOD")
     private OnceTriggerStateMachine evaluateSpecific(NeverTrigger v) {
       return NeverStateMachine.ever();
     }
 
+    @SuppressFBWarnings("UPM_UNCALLED_PRIVATE_METHOD")
     private OnceTriggerStateMachine evaluateSpecific(AfterSynchronizedProcessingTime v) {
       return new AfterSynchronizedProcessingTimeStateMachine();
     }
 
+    @SuppressFBWarnings("UPM_UNCALLED_PRIVATE_METHOD")
     private OnceTriggerStateMachine evaluateSpecific(AfterFirst v) {
       List<OnceTriggerStateMachine> subStateMachines =
           Lists.newArrayListWithCapacity(v.subTriggers().size());
@@ -126,6 +132,7 @@ public class TriggerStateMachines {
       return AfterFirstStateMachine.of(subStateMachines);
     }
 
+    @SuppressFBWarnings("UPM_UNCALLED_PRIVATE_METHOD")
     private OnceTriggerStateMachine evaluateSpecific(AfterAll v) {
       List<OnceTriggerStateMachine> subStateMachines =
           Lists.newArrayListWithCapacity(v.subTriggers().size());
@@ -135,10 +142,12 @@ public class TriggerStateMachines {
       return AfterAllStateMachine.of(subStateMachines);
     }
 
+    @SuppressFBWarnings("UPM_UNCALLED_PRIVATE_METHOD")
     private OnceTriggerStateMachine evaluateSpecific(AfterPane v) {
       return AfterPaneStateMachine.elementCountAtLeast(v.getElementCount());
     }
 
+    @SuppressFBWarnings("UPM_UNCALLED_PRIVATE_METHOD")
     private TriggerStateMachine evaluateSpecific(AfterWatermark.AfterWatermarkEarlyAndLate
v) {
       AfterWatermarkStateMachine.AfterWatermarkEarlyAndLate machine =
           AfterWatermarkStateMachine.pastEndOfWindow()
@@ -150,6 +159,7 @@ public class TriggerStateMachines {
       return machine;
     }
 
+    @SuppressFBWarnings("UPM_UNCALLED_PRIVATE_METHOD")
     private TriggerStateMachine evaluateSpecific(AfterEach v) {
       List<TriggerStateMachine> subStateMachines =
           Lists.newArrayListWithCapacity(v.subTriggers().size());
@@ -161,20 +171,24 @@ public class TriggerStateMachines {
       return AfterEachStateMachine.inOrder(subStateMachines);
     }
 
+    @SuppressFBWarnings("UPM_UNCALLED_PRIVATE_METHOD")
     private TriggerStateMachine evaluateSpecific(Repeatedly v) {
       return RepeatedlyStateMachine.forever(stateMachineForTrigger(v.getRepeatedTrigger()));
     }
 
+    @SuppressFBWarnings("UPM_UNCALLED_PRIVATE_METHOD")
     private TriggerStateMachine evaluateSpecific(OrFinallyTrigger v) {
       return new OrFinallyStateMachine(
           stateMachineForTrigger(v.getMainTrigger()),
           stateMachineForOnceTrigger(v.getUntilTrigger()));
     }
 
+    @SuppressFBWarnings("UPM_UNCALLED_PRIVATE_METHOD")
     private OnceTriggerStateMachine evaluateSpecific(AfterProcessingTime v) {
       return evaluateSpecific((AfterDelayFromFirstElement) v);
     }
 
+    @SuppressFBWarnings("UPM_UNCALLED_PRIVATE_METHOD")
     private OnceTriggerStateMachine evaluateSpecific(final AfterDelayFromFirstElement v)
{
       return new AfterDelayFromFirstElementStateMachineAdapter(v);
     }


Mime
View raw message