beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dhalp...@apache.org
Subject [1/2] beam git commit: Simplify ToString#element()
Date Wed, 18 Jan 2017 23:56:49 GMT
Repository: beam
Updated Branches:
  refs/heads/master e78eb945f -> 603f4fb04


Simplify ToString#element()


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

Branch: refs/heads/master
Commit: d992fd1b77723758cd9c940c111cbf4e72793db9
Parents: e78eb94
Author: Dan Halperin <dhalperi@google.com>
Authored: Fri Dec 30 04:08:58 2016 -0800
Committer: Dan Halperin <dhalperi@google.com>
Committed: Wed Jan 18 15:56:17 2017 -0800

----------------------------------------------------------------------
 .../java/org/apache/beam/sdk/transforms/ToString.java | 14 +++++++-------
 .../test/java/org/apache/beam/sdk/io/WriteTest.java   |  2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/beam/blob/d992fd1b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/ToString.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/ToString.java b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/ToString.java
index dfaad94..ef49267 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/ToString.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/ToString.java
@@ -37,25 +37,25 @@ import org.apache.beam.sdk.values.PCollection;
 public final class ToString {
 
   /**
-   * Returns a {@code PTransform<PCollection<T>, PCollection<String>>}
which transforms each
+   * Returns a {@code PTransform<PCollection, PCollection<String>>} which transforms
each
    * element of the input {@link PCollection} to a {@link String} using the
    * {@link Object#toString} method.
    */
-  public static <T> PTransform<PCollection<T>, PCollection<String>>
element() {
-    return new Default<>();
+  public static PTransform<PCollection<?>, PCollection<String>> element()
{
+    return new Default();
   }
 
   private ToString() {
   }
 
   /**
-   * A {@link PTransform} that converts a {@code PCollection<T>} to a {@code PCollection<String>}
+   * A {@link PTransform} that converts a {@code PCollection} to a {@code PCollection<String>}
    * using the {@link  Object#toString} method.
    */
-  private static final class Default<T> extends PTransform<PCollection<T>,
PCollection<String>> {
+  private static final class Default extends PTransform<PCollection<?>, PCollection<String>>
{
     @Override
-    public PCollection<String> expand(PCollection<T> input) {
-      return input.apply(MapElements.via(new ToStringFunction<T>()));
+    public PCollection<String> expand(PCollection<?> input) {
+      return input.apply(MapElements.via(new ToStringFunction<>()));
     }
 
     private static class ToStringFunction<T> extends SimpleFunction<T, String>
{

http://git-wip-us.apache.org/repos/asf/beam/blob/d992fd1b/sdks/java/core/src/test/java/org/apache/beam/sdk/io/WriteTest.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/test/java/org/apache/beam/sdk/io/WriteTest.java b/sdks/java/core/src/test/java/org/apache/beam/sdk/io/WriteTest.java
index 2cea72c..9772b9b 100644
--- a/sdks/java/core/src/test/java/org/apache/beam/sdk/io/WriteTest.java
+++ b/sdks/java/core/src/test/java/org/apache/beam/sdk/io/WriteTest.java
@@ -297,7 +297,7 @@ public class WriteTest {
   @Test
   public void testWriteUnbounded() {
     PCollection<String> unbounded = p.apply(CountingInput.unbounded())
-        .apply(ToString.<Long>element());
+        .apply(ToString.element());
 
     TestSink sink = new TestSink();
     thrown.expect(IllegalArgumentException.class);


Mime
View raw message