You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by lc...@apache.org on 2018/01/29 23:07:41 UTC

[beam] 01/05: Fixes for sdks/java/core for the eclipse compiler

This is an automated email from the ASF dual-hosted git repository.

lcwik pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git

commit a0ef2a545e24644d5d8cf0fff1303b9bfc70adb3
Author: Daniel Kulp <dk...@apache.org>
AuthorDate: Fri Jan 26 09:04:39 2018 -0500

    Fixes for sdks/java/core for the eclipse compiler
---
 build.gradle                                                       | 2 +-
 build_rules.gradle                                                 | 7 +++++++
 sdks/java/core/src/main/java/org/apache/beam/sdk/Pipeline.java     | 2 +-
 .../src/main/java/org/apache/beam/sdk/coders/CoderRegistry.java    | 3 ++-
 .../main/java/org/apache/beam/sdk/testing/WindowFnTestUtils.java   | 7 ++++---
 5 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/build.gradle b/build.gradle
index a86efa9..6dccd5c 100644
--- a/build.gradle
+++ b/build.gradle
@@ -173,7 +173,7 @@ buildscript {
     maven { url "http://repo.spring.io/plugins-release" }
   }
   dependencies {
-    classpath "net.ltgt.gradle:gradle-apt-plugin:0.12"                                                  // Enable a Java annotation processor
+    classpath "net.ltgt.gradle:gradle-apt-plugin:0.13"                                                  // Enable a Java annotation processor
     classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.1"                                        // Enable proto code generation
     classpath "io.spring.gradle:propdeps-plugin:0.0.9.RELEASE"                                          // Enable provided and optional configurations
     classpath "gradle.plugin.org.nosphere.apache:creadur-rat-gradle:0.3.1"                              // Enable Apache license enforcement
diff --git a/build_rules.gradle b/build_rules.gradle
index 2f9a5d0..fde5668 100644
--- a/build_rules.gradle
+++ b/build_rules.gradle
@@ -222,6 +222,7 @@ ext.applyJavaNature = {
     testApt auto_service
   }
 
+
   // Add the optional and provided configurations for dependencies
   // TODO: Either remove these plugins and find another way to generate the Maven poms
   // with the correct dependency scopes configured.
@@ -433,3 +434,9 @@ ext.applyAvroNature = {
   println "applyAvroNature with " + (it ? "$it" : "default configuration") + " for project $project.name"
   apply plugin: "com.commercehub.gradle.plugin.avro"
 }
+
+// Apply the apt-eclipse plugin so the eclipse import can work
+apply plugin: 'eclipse'
+apply plugin: "net.ltgt.apt-eclipse"
+
+
diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/Pipeline.java b/sdks/java/core/src/main/java/org/apache/beam/sdk/Pipeline.java
index c6028ad..71bac5c 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/Pipeline.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/Pipeline.java
@@ -302,7 +302,7 @@ public class Pipeline {
    * by the options.
    */
   public PipelineResult run(PipelineOptions options) {
-    PipelineRunner runner = PipelineRunner.fromOptions(options);
+    PipelineRunner<? extends PipelineResult> runner = PipelineRunner.fromOptions(options);
     // Ensure all of the nodes are fully specified before a PipelineRunner gets access to the
     // pipeline.
     LOG.debug("Running {} via {}", this, runner);
diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/coders/CoderRegistry.java b/sdks/java/core/src/main/java/org/apache/beam/sdk/coders/CoderRegistry.java
index b867d93..7c84b35 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/coders/CoderRegistry.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/coders/CoderRegistry.java
@@ -564,8 +564,9 @@ public class CoderRegistry {
       }
       for (int i = 0; i < typeArgumentCoders.size(); i++) {
         try {
+          Coder<?> c2 = typeArgumentCoders.get(i);
           verifyCompatible(
-              typeArgumentCoders.get(i),
+              c2,
               candidateDescriptor.resolveType(typeArguments[i]).getType());
         } catch (IncompatibleCoderException exn) {
           throw new IncompatibleCoderException(
diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/testing/WindowFnTestUtils.java b/sdks/java/core/src/main/java/org/apache/beam/sdk/testing/WindowFnTestUtils.java
index c456e7b..532aa5a 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/testing/WindowFnTestUtils.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/testing/WindowFnTestUtils.java
@@ -88,7 +88,8 @@ public class WindowFnTestUtils {
       for (W window : assignedWindowsWithValue(windowFn, element)) {
         windowSet.put(window, timestampValue(element.getTimestamp().getMillis()));
       }
-      windowFn.mergeWindows(new TestMergeContext<>(windowSet, windowFn));
+      TestMergeContext<T, W> tmc = new TestMergeContext<>(windowSet, windowFn);
+      windowFn.mergeWindows(tmc);
     }
     Map<W, Set<String>> actual = new HashMap<>();
     for (W window : windowSet.windows()) {
@@ -112,8 +113,8 @@ public class WindowFnTestUtils {
    */
   public static <T, W extends BoundedWindow> Collection<W> assignedWindowsWithValue(
       WindowFn<T, W> windowFn, TimestampedValue<T> timestampedValue) throws Exception {
-    return windowFn.assignWindows(
-        new TestAssignContext<>(timestampedValue, windowFn));
+    TestAssignContext<T, W> tac = new TestAssignContext<>(timestampedValue, windowFn);
+    return windowFn.assignWindows(tac);
   }
 
   private static String timestampValue(long timestamp) {

-- 
To stop receiving notification emails like this one, please contact
lcwik@apache.org.