beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dhalp...@apache.org
Subject [2/2] incubator-beam git commit: checkstyle.xml: enforce where line breaks happen
Date Tue, 17 May 2016 06:25:37 GMT
checkstyle.xml: enforce where line breaks happen

We should do it consistently throughout the SDK. Only a few
fixups.

Ported from: https://github.com/checkstyle/checkstyle/blob/ccdc3c09c500ccd31d56e4d6ed9c2d86edf2e9f1/src/main/resources/google_checks.xml#L167


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

Branch: refs/heads/master
Commit: 99f19257c1634325c4d6ff162f1f999399e0d692
Parents: 638cc20
Author: Dan Halperin <dhalperi@google.com>
Authored: Mon May 16 14:30:02 2016 -0700
Committer: Dan Halperin <dhalperi@google.com>
Committed: Mon May 16 23:25:14 2016 -0700

----------------------------------------------------------------------
 .../examples/complete/game/injector/Injector.java    | 10 +++++-----
 .../runners/direct/InProcessEvaluationContext.java   |  6 +++---
 .../beam/runners/direct/TransformExecutorTest.java   |  6 +++---
 .../runners/dataflow/DataflowPipelineRunner.java     |  4 ++--
 .../dataflow/testing/TestDataflowPipelineRunner.java |  4 ++--
 .../runners/dataflow/util/DataflowTransport.java     |  4 ++--
 .../beam/runners/spark/SparkPipelineRunner.java      | 10 +++++-----
 .../runners/spark/SparkStreamingPipelineOptions.java |  4 ++--
 .../spark/translation/SparkContextFactory.java       |  4 ++--
 .../spark/translation/SparkProcessContext.java       |  8 ++++----
 .../streaming/StreamingWindowPipelineDetector.java   |  4 ++--
 .../src/main/resources/beam/checkstyle.xml           | 10 ++++++++++
 .../org/apache/beam/sdk/coders/CoderFactories.java   | 10 +++++-----
 .../main/java/org/apache/beam/sdk/io/BigQueryIO.java |  6 +++---
 .../java/org/apache/beam/sdk/io/FileBasedSource.java |  3 +--
 .../beam/sdk/runners/DirectPipelineRunner.java       | 15 +++++++--------
 .../org/apache/beam/sdk/transforms/Partition.java    |  4 ++--
 .../apache/beam/sdk/transforms/join/CoGbkResult.java |  8 ++++----
 .../apache/beam/sdk/transforms/join/UnionCoder.java  |  4 ++--
 .../apache/beam/sdk/util/BigQueryTableInserter.java  |  8 ++++----
 .../org/apache/beam/sdk/util/InstanceBuilder.java    |  6 +++---
 .../java/org/apache/beam/sdk/util/StringUtils.java   |  4 ++--
 .../java/org/apache/beam/sdk/util/Transport.java     |  4 ++--
 .../org/apache/beam/sdk/values/PCollectionList.java  |  4 ++--
 .../sdk/transforms/display/DisplayDataMatchers.java  |  4 ++--
 .../apache/beam/sdk/values/PCollectionListTest.java  |  4 ++--
 .../java/org/apache/beam/sdk/io/kafka/KafkaIO.java   |  8 ++++----
 27 files changed, 87 insertions(+), 79 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/99f19257/examples/java8/src/main/java/org/apache/beam/examples/complete/game/injector/Injector.java
----------------------------------------------------------------------
diff --git a/examples/java8/src/main/java/org/apache/beam/examples/complete/game/injector/Injector.java
b/examples/java8/src/main/java/org/apache/beam/examples/complete/game/injector/Injector.java
index f8c3e33..034a186 100644
--- a/examples/java8/src/main/java/org/apache/beam/examples/complete/game/injector/Injector.java
+++ b/examples/java8/src/main/java/org/apache/beam/examples/complete/game/injector/Injector.java
@@ -151,8 +151,8 @@ class Injector {
       this.teamName = teamName;
       this.startTimeInMillis = startTimeInMillis;
       // How long until this team is dissolved.
-      this.expirationPeriod = random.nextInt(TEAM_EXPIRATION_TIME_IN_MINS) +
-        BASE_TEAM_EXPIRATION_TIME_IN_MINS;
+      this.expirationPeriod = random.nextInt(TEAM_EXPIRATION_TIME_IN_MINS)
+        + BASE_TEAM_EXPIRATION_TIME_IN_MINS;
       this.robot = robot;
       // Determine the number of team members.
       numMembers = random.nextInt(MEMBERS_PER_TEAM) + BASE_MEMBERS_PER_TEAM;
@@ -204,9 +204,9 @@ class Injector {
     long currTime = System.currentTimeMillis();
     if ((team.getEndTimeInMillis() < currTime) || team.numMembers() == 0) {
       System.out.println("\nteam " + team + " is too old; replacing.");
-      System.out.println("start time: " + team.getStartTimeInMillis() +
-        ", end time: " + team.getEndTimeInMillis() +
-        ", current time:" + currTime);
+      System.out.println("start time: " + team.getStartTimeInMillis()
+        + ", end time: " + team.getEndTimeInMillis()
+        + ", current time:" + currTime);
       removeTeam(index);
       // Add a new team in its stead.
       return (addLiveTeam());

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/99f19257/runners/direct-java/src/main/java/org/apache/beam/runners/direct/InProcessEvaluationContext.java
----------------------------------------------------------------------
diff --git a/runners/direct-java/src/main/java/org/apache/beam/runners/direct/InProcessEvaluationContext.java
b/runners/direct-java/src/main/java/org/apache/beam/runners/direct/InProcessEvaluationContext.java
index 9eeafbb..e8eaf98 100644
--- a/runners/direct-java/src/main/java/org/apache/beam/runners/direct/InProcessEvaluationContext.java
+++ b/runners/direct-java/src/main/java/org/apache/beam/runners/direct/InProcessEvaluationContext.java
@@ -156,9 +156,9 @@ class InProcessEvaluationContext {
         commitBundles(result.getOutputBundles());
     // Update watermarks and timers
     CommittedResult committedResult = CommittedResult.create(result,
-        completedBundle == null ?
-            null :
-            completedBundle.withElements((Iterable) result.getUnprocessedElements()),
+        completedBundle == null
+            ? null
+            : completedBundle.withElements((Iterable) result.getUnprocessedElements()),
         committedBundles);
     watermarkManager.updateWatermarks(
         completedBundle,

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/99f19257/runners/direct-java/src/test/java/org/apache/beam/runners/direct/TransformExecutorTest.java
----------------------------------------------------------------------
diff --git a/runners/direct-java/src/test/java/org/apache/beam/runners/direct/TransformExecutorTest.java
b/runners/direct-java/src/test/java/org/apache/beam/runners/direct/TransformExecutorTest.java
index d230950..0345662 100644
--- a/runners/direct-java/src/test/java/org/apache/beam/runners/direct/TransformExecutorTest.java
+++ b/runners/direct-java/src/test/java/org/apache/beam/runners/direct/TransformExecutorTest.java
@@ -484,9 +484,9 @@ public class TransformExecutorTest {
       handledResult = result;
       onMethod.countDown();
       @SuppressWarnings("rawtypes") Iterable unprocessedElements =
-          result.getUnprocessedElements() == null ?
-              Collections.emptyList() :
-              result.getUnprocessedElements();
+          result.getUnprocessedElements() == null
+              ? Collections.emptyList()
+              : result.getUnprocessedElements();
 
       CommittedBundle<?> unprocessedBundle =
           inputBundle == null ? null : inputBundle.withElements(unprocessedElements);

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/99f19257/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/DataflowPipelineRunner.java
----------------------------------------------------------------------
diff --git a/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/DataflowPipelineRunner.java
b/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/DataflowPipelineRunner.java
index 3d3c0ec..8801896 100644
--- a/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/DataflowPipelineRunner.java
+++ b/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/DataflowPipelineRunner.java
@@ -481,8 +481,8 @@ public class DataflowPipelineRunner extends PipelineRunner<DataflowPipelineJob>
           debuggerClient.controller().debuggees().register(registerReq).execute();
       Debuggee debuggee = registerResponse.getDebuggee();
       if (debuggee.getStatus() != null && debuggee.getStatus().getIsError()) {
-        throw new RuntimeException("Unable to register with the debugger: " +
-            debuggee.getStatus().getDescription().getFormat());
+        throw new RuntimeException("Unable to register with the debugger: "
+            + debuggee.getStatus().getDescription().getFormat());
       }
 
       return debuggee;

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/99f19257/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/testing/TestDataflowPipelineRunner.java
----------------------------------------------------------------------
diff --git a/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/testing/TestDataflowPipelineRunner.java
b/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/testing/TestDataflowPipelineRunner.java
index 2b53a65..3e8d903 100644
--- a/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/testing/TestDataflowPipelineRunner.java
+++ b/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/testing/TestDataflowPipelineRunner.java
@@ -144,8 +144,8 @@ public class TestDataflowPipelineRunner extends PipelineRunner<DataflowPipelineJ
         throw new IllegalStateException(
             "The dataflow did not output a success or failure metric.");
       } else if (!result.get()) {
-        throw new AssertionError(messageHandler.getErrorMessage() == null ?
-            "The dataflow did not return a failure reason."
+        throw new AssertionError(messageHandler.getErrorMessage() == null
+            ? "The dataflow did not return a failure reason."
             : messageHandler.getErrorMessage());
       } else {
         assertThat(job, testPipelineOptions.getOnSuccessMatcher());

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/99f19257/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/util/DataflowTransport.java
----------------------------------------------------------------------
diff --git a/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/util/DataflowTransport.java
b/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/util/DataflowTransport.java
index 0199657..09fca94 100644
--- a/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/util/DataflowTransport.java
+++ b/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/util/DataflowTransport.java
@@ -52,8 +52,8 @@ public class DataflowTransport {
   private static ApiComponents apiComponentsFromUrl(String urlString) {
     try {
       URL url = new URL(urlString);
-      String rootUrl = url.getProtocol() + "://" + url.getHost() +
-          (url.getPort() > 0 ? ":" + url.getPort() : "");
+      String rootUrl = url.getProtocol() + "://" + url.getHost()
+          + (url.getPort() > 0 ? ":" + url.getPort() : "");
       return new ApiComponents(rootUrl, url.getPath());
     } catch (MalformedURLException e) {
       throw new RuntimeException("Invalid URL: " + urlString);

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/99f19257/runners/spark/src/main/java/org/apache/beam/runners/spark/SparkPipelineRunner.java
----------------------------------------------------------------------
diff --git a/runners/spark/src/main/java/org/apache/beam/runners/spark/SparkPipelineRunner.java
b/runners/spark/src/main/java/org/apache/beam/runners/spark/SparkPipelineRunner.java
index af5acf1..90404dd 100644
--- a/runners/spark/src/main/java/org/apache/beam/runners/spark/SparkPipelineRunner.java
+++ b/runners/spark/src/main/java/org/apache/beam/runners/spark/SparkPipelineRunner.java
@@ -148,9 +148,9 @@ public final class SparkPipelineRunner extends PipelineRunner<EvaluationResult>
     try {
       // validate streaming configuration
       if (mOptions.isStreaming() && !(mOptions instanceof SparkStreamingPipelineOptions))
{
-        throw new RuntimeException("A streaming job must be configured with " +
-            SparkStreamingPipelineOptions.class.getSimpleName() + ", found " +
-            mOptions.getClass().getSimpleName());
+        throw new RuntimeException("A streaming job must be configured with "
+            + SparkStreamingPipelineOptions.class.getSimpleName() + ", found "
+            + mOptions.getClass().getSimpleName());
       }
       LOG.info("Executing pipeline using the SparkPipelineRunner.");
       JavaSparkContext jsc = SparkContextFactory.getSparkContext(mOptions
@@ -195,8 +195,8 @@ public final class SparkPipelineRunner extends PipelineRunner<EvaluationResult>
       // Then we find the cause by seeing if it's a user exception (wrapped by our
       // SparkProcessException), or just use the SparkException cause.
       if (e instanceof SparkException && e.getCause() != null) {
-        if (e.getCause() instanceof SparkProcessContext.SparkProcessException &&
-                e.getCause().getCause() != null) {
+        if (e.getCause() instanceof SparkProcessContext.SparkProcessException
+            && e.getCause().getCause() != null) {
           throw new RuntimeException(e.getCause().getCause());
         } else {
           throw new RuntimeException(e.getCause());

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/99f19257/runners/spark/src/main/java/org/apache/beam/runners/spark/SparkStreamingPipelineOptions.java
----------------------------------------------------------------------
diff --git a/runners/spark/src/main/java/org/apache/beam/runners/spark/SparkStreamingPipelineOptions.java
b/runners/spark/src/main/java/org/apache/beam/runners/spark/SparkStreamingPipelineOptions.java
index 091d0de..c789447 100644
--- a/runners/spark/src/main/java/org/apache/beam/runners/spark/SparkStreamingPipelineOptions.java
+++ b/runners/spark/src/main/java/org/apache/beam/runners/spark/SparkStreamingPipelineOptions.java
@@ -24,8 +24,8 @@ import org.apache.beam.sdk.options.Description;
  * Options used to configure Spark streaming.
  */
 public interface SparkStreamingPipelineOptions extends SparkPipelineOptions {
-  @Description("Timeout to wait (in msec) for the streaming execution so stop, -1 runs until
" +
-          "execution is stopped")
+  @Description("Timeout to wait (in msec) for the streaming execution so stop, -1 runs until
"
+          + "execution is stopped")
   @Default.Long(-1)
   Long getTimeout();
 

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/99f19257/runners/spark/src/main/java/org/apache/beam/runners/spark/translation/SparkContextFactory.java
----------------------------------------------------------------------
diff --git a/runners/spark/src/main/java/org/apache/beam/runners/spark/translation/SparkContextFactory.java
b/runners/spark/src/main/java/org/apache/beam/runners/spark/translation/SparkContextFactory.java
index 225afb8..c58e1dd 100644
--- a/runners/spark/src/main/java/org/apache/beam/runners/spark/translation/SparkContextFactory.java
+++ b/runners/spark/src/main/java/org/apache/beam/runners/spark/translation/SparkContextFactory.java
@@ -46,8 +46,8 @@ public final class SparkContextFactory {
         sparkContext = createSparkContext(master, appName);
         sparkMaster = master;
       } else if (!master.equals(sparkMaster)) {
-        throw new IllegalArgumentException(String.format("Cannot reuse spark context " +
-                "with different spark master URL. Existing: %s, requested: %s.",
+        throw new IllegalArgumentException(String.format("Cannot reuse spark context "
+                + "with different spark master URL. Existing: %s, requested: %s.",
             sparkMaster, master));
       }
       return sparkContext;

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/99f19257/runners/spark/src/main/java/org/apache/beam/runners/spark/translation/SparkProcessContext.java
----------------------------------------------------------------------
diff --git a/runners/spark/src/main/java/org/apache/beam/runners/spark/translation/SparkProcessContext.java
b/runners/spark/src/main/java/org/apache/beam/runners/spark/translation/SparkProcessContext.java
index 4f90a12..779a83e 100644
--- a/runners/spark/src/main/java/org/apache/beam/runners/spark/translation/SparkProcessContext.java
+++ b/runners/spark/src/main/java/org/apache/beam/runners/spark/translation/SparkProcessContext.java
@@ -94,8 +94,8 @@ public abstract class SparkProcessContext<InputT, OutputT, ValueT>
 
   @Override
   public <T> void sideOutput(TupleTag<T> tupleTag, T t) {
-    String message = "sideOutput is an unsupported operation for doFunctions, use a " +
-        "MultiDoFunction instead.";
+    String message = "sideOutput is an unsupported operation for doFunctions, use a "
+        + "MultiDoFunction instead.";
     LOG.warn(message);
     throw new UnsupportedOperationException(message);
   }
@@ -103,8 +103,8 @@ public abstract class SparkProcessContext<InputT, OutputT, ValueT>
   @Override
   public <T> void sideOutputWithTimestamp(TupleTag<T> tupleTag, T t, Instant
instant) {
     String message =
-        "sideOutputWithTimestamp is an unsupported operation for doFunctions, use a " +
-            "MultiDoFunction instead.";
+        "sideOutputWithTimestamp is an unsupported operation for doFunctions, use a "
+            + "MultiDoFunction instead.";
     LOG.warn(message);
     throw new UnsupportedOperationException(message);
   }

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/99f19257/runners/spark/src/main/java/org/apache/beam/runners/spark/translation/streaming/StreamingWindowPipelineDetector.java
----------------------------------------------------------------------
diff --git a/runners/spark/src/main/java/org/apache/beam/runners/spark/translation/streaming/StreamingWindowPipelineDetector.java
b/runners/spark/src/main/java/org/apache/beam/runners/spark/translation/streaming/StreamingWindowPipelineDetector.java
index 6e36102..f6f3029 100644
--- a/runners/spark/src/main/java/org/apache/beam/runners/spark/translation/streaming/StreamingWindowPipelineDetector.java
+++ b/runners/spark/src/main/java/org/apache/beam/runners/spark/translation/streaming/StreamingWindowPipelineDetector.java
@@ -81,8 +81,8 @@ public final class StreamingWindowPipelineDetector extends SparkPipelineRunner.E
     Long durationMillis = duration.getMillis();
     // validate window size
     if (durationMillis < SPARK_MIN_WINDOW.milliseconds()) {
-      throw new IllegalArgumentException("Windowing of size " + durationMillis +
-          "msec is not supported!");
+      throw new IllegalArgumentException("Windowing of size " + durationMillis
+          + "msec is not supported!");
     }
     // choose the smallest duration to be Spark's batch duration, larger ones will be handled
     // as window functions  over the batched-stream

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/99f19257/sdks/java/build-tools/src/main/resources/beam/checkstyle.xml
----------------------------------------------------------------------
diff --git a/sdks/java/build-tools/src/main/resources/beam/checkstyle.xml b/sdks/java/build-tools/src/main/resources/beam/checkstyle.xml
index 30eddcc..44897d3 100644
--- a/sdks/java/build-tools/src/main/resources/beam/checkstyle.xml
+++ b/sdks/java/build-tools/src/main/resources/beam/checkstyle.xml
@@ -389,6 +389,16 @@ page at http://checkstyle.sourceforge.net/config.html -->
       <property name="severity" value="error"/>
     </module>
 
+    <module name="OperatorWrap">
+      <!-- Checks that operators like + and ? appear at newlines rather than
+           at the end of the previous line.
+      -->
+      <property name="option" value="NL"/>
+      <property name="tokens" value="BAND, BOR, BSR, BXOR, DIV, EQUAL,
+        GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD,
+        NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR "/>
+    </module>
+
     <module name="ParenPad">
       <!-- Checks that there is no whitespace before close parens or after
            open parens.

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/99f19257/sdks/java/core/src/main/java/org/apache/beam/sdk/coders/CoderFactories.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/coders/CoderFactories.java b/sdks/java/core/src/main/java/org/apache/beam/sdk/coders/CoderFactories.java
index 5bb56b8..480f424 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/coders/CoderFactories.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/coders/CoderFactories.java
@@ -96,11 +96,11 @@ public final class CoderFactories {
       try {
         return (Coder) factoryMethod.invoke(
             null /* static */, componentCoders.toArray());
-      } catch (IllegalAccessException |
-               IllegalArgumentException |
-               InvocationTargetException |
-               NullPointerException |
-               ExceptionInInitializerError exn) {
+      } catch (IllegalAccessException
+           | IllegalArgumentException
+           | InvocationTargetException
+           | NullPointerException
+           | ExceptionInInitializerError exn) {
         throw new IllegalStateException(
             "error when invoking Coder factory method " + factoryMethod,
             exn);

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/99f19257/sdks/java/core/src/main/java/org/apache/beam/sdk/io/BigQueryIO.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/io/BigQueryIO.java b/sdks/java/core/src/main/java/org/apache/beam/sdk/io/BigQueryIO.java
index f8a05e9..e4a306a 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/io/BigQueryIO.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/io/BigQueryIO.java
@@ -1241,9 +1241,9 @@ public class BigQueryIO {
     JobStatistics jobStats = extractJob.getStatistics();
     List<Long> counts = jobStats.getExtract().getDestinationUriFileCounts();
     if (counts.size() != 1) {
-      String errorMessage = (counts.size() == 0 ?
-          "No destination uri file count received." :
-          String.format("More than one destination uri file count received. First two are
%s, %s",
+      String errorMessage = (counts.size() == 0
+          ? "No destination uri file count received."
+          : String.format("More than one destination uri file count received. First two are
%s, %s",
               counts.get(0), counts.get(1)));
       throw new RuntimeException(errorMessage);
     }

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/99f19257/sdks/java/core/src/main/java/org/apache/beam/sdk/io/FileBasedSource.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/io/FileBasedSource.java b/sdks/java/core/src/main/java/org/apache/beam/sdk/io/FileBasedSource.java
index e42c92c..96aeda5 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/io/FileBasedSource.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/io/FileBasedSource.java
@@ -326,8 +326,7 @@ public abstract class FileBasedSource<T> extends OffsetBasedSource<T>
{
     } else {
       if (isSplittable()) {
         List<FileBasedSource<T>> splitResults = new ArrayList<>();
-        for (OffsetBasedSource<T> split :
-            super.splitIntoBundles(desiredBundleSizeBytes, options)) {
+        for (OffsetBasedSource<T> split : super.splitIntoBundles(desiredBundleSizeBytes,
options)) {
           splitResults.add((FileBasedSource<T>) split);
         }
         return splitResults;

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/99f19257/sdks/java/core/src/main/java/org/apache/beam/sdk/runners/DirectPipelineRunner.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/runners/DirectPipelineRunner.java
b/sdks/java/core/src/main/java/org/apache/beam/sdk/runners/DirectPipelineRunner.java
index 590ce6f..1eb25c5 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/runners/DirectPipelineRunner.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/runners/DirectPipelineRunner.java
@@ -902,8 +902,7 @@ public class DirectPipelineRunner
       LOG.debug("Checking evaluation of {}", value);
       if (value.getProducingTransformInternal() == null) {
         throw new RuntimeException(
-            "internal error: expecting a PValue " +
-            "to have a producingTransform");
+            "internal error: expecting a PValue to have a producingTransform");
       }
       if (!producer.isCompositeNode()) {
         // Verify that primitive transform outputs are already computed.
@@ -918,8 +917,8 @@ public class DirectPipelineRunner
     void setPValue(PValue pvalue, Object contents) {
       if (store.containsKey(pvalue)) {
         throw new IllegalStateException(
-            "internal error: setting the value of " + pvalue +
-            " more than once");
+            "internal error: setting the value of " + pvalue
+            + " more than once");
       }
       store.put(pvalue, contents);
     }
@@ -931,8 +930,8 @@ public class DirectPipelineRunner
     Object getPValue(PValue pvalue) {
       if (!store.containsKey(pvalue)) {
         throw new IllegalStateException(
-            "internal error: getting the value of " + pvalue +
-            " before it has been computed");
+            "internal error: getting the value of " + pvalue
+            + " before it has been computed");
       }
       return store.get(pvalue);
     }
@@ -1247,8 +1246,8 @@ public class DirectPipelineRunner
         // TODO: Put in better element printing:
         // truncate if too long.
         throw new IllegalArgumentException(
-            "unable to encode key " + key + " of input to " + transform +
-            " using " + keyCoder,
+            "unable to encode key " + key + " of input to " + transform
+            + " using " + keyCoder,
             exn);
       }
       GroupingKey<K> groupingKey =

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/99f19257/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Partition.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Partition.java b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Partition.java
index c5aa82c..6281b30 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Partition.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Partition.java
@@ -173,8 +173,8 @@ public class Partition<T> extends PTransform<PCollection<T>,
PCollectionList<T>>
         c.sideOutput(typedTag, input);
       } else {
         throw new IndexOutOfBoundsException(
-            "Partition function returned out of bounds index: " +
-            partition + " not in [0.." + numPartitions + ")");
+            "Partition function returned out of bounds index: "
+            + partition + " not in [0.." + numPartitions + ")");
       }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/99f19257/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/join/CoGbkResult.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/join/CoGbkResult.java
b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/join/CoGbkResult.java
index 3732bec..f868b9c 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/join/CoGbkResult.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/join/CoGbkResult.java
@@ -106,8 +106,8 @@ public class CoGbkResult {
       // schema.
       int unionTag = value.getUnionTag();
       if (schema.size() <= unionTag) {
-        throw new IllegalStateException("union tag " + unionTag +
-            " has no corresponding tuple tag in the result schema");
+        throw new IllegalStateException("union tag " + unionTag
+            + " has no corresponding tuple tag in the result schema");
       }
       List<Object> valueList = (List<Object>) valueMap.get(unionTag);
       valueList.add(value.getValue());
@@ -181,8 +181,8 @@ public class CoGbkResult {
   public <V> Iterable<V> getAll(TupleTag<V> tag) {
     int index = schema.getIndex(tag);
     if (index < 0) {
-      throw new IllegalArgumentException("TupleTag " + tag +
-          " is not in the schema");
+      throw new IllegalArgumentException("TupleTag " + tag
+          + " is not in the schema");
     }
     @SuppressWarnings("unchecked")
     Iterable<V> unions = (Iterable<V>) valueMap.get(index);

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/99f19257/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/join/UnionCoder.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/join/UnionCoder.java
b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/join/UnionCoder.java
index 43f1adf..2ca7014 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/join/UnionCoder.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/join/UnionCoder.java
@@ -60,8 +60,8 @@ class UnionCoder extends StandardCoder<RawUnionValue> {
     int index = union.getUnionTag();
     if (index < 0 || index >= elementCoders.size()) {
       throw new IllegalArgumentException(
-          "union value index " + index + " not in range [0.." +
-          (elementCoders.size() - 1) + "]");
+          "union value index " + index + " not in range [0.."
+          + (elementCoders.size() - 1) + "]");
     }
     return index;
   }

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/99f19257/sdks/java/core/src/main/java/org/apache/beam/sdk/util/BigQueryTableInserter.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/util/BigQueryTableInserter.java
b/sdks/java/core/src/main/java/org/apache/beam/sdk/util/BigQueryTableInserter.java
index 0493f1c..bcb4137 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/util/BigQueryTableInserter.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/util/BigQueryTableInserter.java
@@ -207,8 +207,8 @@ public class BigQueryTableInserter {
         rows.add(out);
 
         dataSize += row.toString().length();
-        if (dataSize >= UPLOAD_BATCH_SIZE_BYTES || rows.size() >= maxRowsPerBatch ||
-            i == rowsToPublish.size() - 1) {
+        if (dataSize >= UPLOAD_BATCH_SIZE_BYTES || rows.size() >= maxRowsPerBatch
+            || i == rowsToPublish.size() - 1) {
           TableDataInsertAllRequest content = new TableDataInsertAllRequest();
           content.setRows(rows);
 
@@ -328,8 +328,8 @@ public class BigQueryTableInserter {
       table = get.execute();
     } catch (IOException e) {
       ApiErrorExtractor errorExtractor = new ApiErrorExtractor();
-      if (!errorExtractor.itemNotFound(e) ||
-          createDisposition != CreateDisposition.CREATE_IF_NEEDED) {
+      if (!errorExtractor.itemNotFound(e)
+          || createDisposition != CreateDisposition.CREATE_IF_NEEDED) {
         // Rethrow.
         throw e;
       }

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/99f19257/sdks/java/core/src/main/java/org/apache/beam/sdk/util/InstanceBuilder.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/util/InstanceBuilder.java b/sdks/java/core/src/main/java/org/apache/beam/sdk/util/InstanceBuilder.java
index 04ee7b4..e5d9916 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/util/InstanceBuilder.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/util/InstanceBuilder.java
@@ -261,9 +261,9 @@ public class InstanceBuilder<T> {
       throw new RuntimeException("Unable to find constructor for "
           + factoryClass.getName());
 
-    } catch (InvocationTargetException |
-        InstantiationException |
-        IllegalAccessException e) {
+    } catch (InvocationTargetException
+        | InstantiationException
+        | IllegalAccessException e) {
       throw new RuntimeException("Failed to construct instance from "
           + "constructor " + factoryClass.getName(), e);
     }

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/99f19257/sdks/java/core/src/main/java/org/apache/beam/sdk/util/StringUtils.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/util/StringUtils.java b/sdks/java/core/src/main/java/org/apache/beam/sdk/util/StringUtils.java
index fbe54fa..428b350 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/util/StringUtils.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/util/StringUtils.java
@@ -75,8 +75,8 @@ public class StringUtils {
           b = (byte) Integer.parseInt(string.substring(i + 1, i + 3), 16);
         } catch (IndexOutOfBoundsException | NumberFormatException exn) {
           throw new IllegalArgumentException(
-              "not in legal encoded format; " +
-              "substring [" + i + ".." + (i + 2) + "] not in format \"%xx\"",
+              "not in legal encoded format; "
+              + "substring [" + i + ".." + (i + 2) + "] not in format \"%xx\"",
               exn);
         }
         i += 3;

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/99f19257/sdks/java/core/src/main/java/org/apache/beam/sdk/util/Transport.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/util/Transport.java b/sdks/java/core/src/main/java/org/apache/beam/sdk/util/Transport.java
index 6daecdb..2c68dfc 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/util/Transport.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/util/Transport.java
@@ -81,8 +81,8 @@ public class Transport {
   private static ApiComponents apiComponentsFromUrl(String urlString) {
     try {
       URL url = new URL(urlString);
-      String rootUrl = url.getProtocol() + "://" + url.getHost() +
-          (url.getPort() > 0 ? ":" + url.getPort() : "");
+      String rootUrl = url.getProtocol() + "://" + url.getHost()
+          + (url.getPort() > 0 ? ":" + url.getPort() : "");
       return new ApiComponents(rootUrl, url.getPath());
     } catch (MalformedURLException e) {
       throw new RuntimeException("Invalid URL: " + urlString);

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/99f19257/sdks/java/core/src/main/java/org/apache/beam/sdk/values/PCollectionList.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/values/PCollectionList.java
b/sdks/java/core/src/main/java/org/apache/beam/sdk/values/PCollectionList.java
index 96af69b..0cf4f49 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/values/PCollectionList.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/values/PCollectionList.java
@@ -98,8 +98,8 @@ public class PCollectionList<T> implements PInput, POutput {
     Iterator<PCollection<T>> pcsIter = pcs.iterator();
     if (!pcsIter.hasNext()) {
       throw new IllegalArgumentException(
-          "must either have a non-empty list of PCollections, " +
-          "or must first call empty(Pipeline)");
+          "must either have a non-empty list of PCollections, "
+          + "or must first call empty(Pipeline)");
     }
     return new PCollectionList<T>(pcsIter.next().getPipeline()).and(pcs);
   }

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/99f19257/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/display/DisplayDataMatchers.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/display/DisplayDataMatchers.java
b/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/display/DisplayDataMatchers.java
index 4207624..23cffd4 100644
--- a/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/display/DisplayDataMatchers.java
+++ b/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/display/DisplayDataMatchers.java
@@ -185,8 +185,8 @@ public class DisplayDataMatchers {
       protected boolean matchesSafely(DisplayData displayData) {
         DisplayData subComponentData = subComponentData();
         if (subComponentData.items().size() == 0) {
-          throw new UnsupportedOperationException("subComponent contains no display data;
" +
-              "cannot verify whether it is included");
+          throw new UnsupportedOperationException("subComponent contains no display data;
"
+              + "cannot verify whether it is included");
         }
 
         DisplayDataComparison comparison = checkSubset(displayData, subComponentData);

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/99f19257/sdks/java/core/src/test/java/org/apache/beam/sdk/values/PCollectionListTest.java
----------------------------------------------------------------------
diff --git a/sdks/java/core/src/test/java/org/apache/beam/sdk/values/PCollectionListTest.java
b/sdks/java/core/src/test/java/org/apache/beam/sdk/values/PCollectionListTest.java
index 956bdb1..af2c14c 100644
--- a/sdks/java/core/src/test/java/org/apache/beam/sdk/values/PCollectionListTest.java
+++ b/sdks/java/core/src/test/java/org/apache/beam/sdk/values/PCollectionListTest.java
@@ -41,8 +41,8 @@ public class PCollectionListTest {
       assertThat(
           exn.toString(),
           containsString(
-              "must either have a non-empty list of PCollections, " +
-              "or must first call empty(Pipeline)"));
+              "must either have a non-empty list of PCollections, "
+              + "or must first call empty(Pipeline)"));
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/99f19257/sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/KafkaIO.java
----------------------------------------------------------------------
diff --git a/sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/KafkaIO.java b/sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/KafkaIO.java
index 3d22824..7fff641 100644
--- a/sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/KafkaIO.java
+++ b/sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/KafkaIO.java
@@ -941,8 +941,8 @@ public class KafkaIO {
           curTimestamp = source.timestampFn.apply(record);
           curRecord = record;
 
-          int recordSize = (rawRecord.key() == null ? 0 : rawRecord.key().length) +
-              (rawRecord.value() == null ? 0 : rawRecord.value().length);
+          int recordSize = (rawRecord.key() == null ? 0 : rawRecord.key().length)
+              + (rawRecord.value() == null ? 0 : rawRecord.value().length);
           pState.recordConsumed(offset, recordSize);
           return true;
 
@@ -993,8 +993,8 @@ public class KafkaIO {
         return initialWatermark;
       }
 
-      return source.watermarkFn.isPresent() ?
-          source.watermarkFn.get().apply(curRecord) : curTimestamp;
+      return source.watermarkFn.isPresent()
+          ? source.watermarkFn.get().apply(curRecord) : curTimestamp;
     }
 
     @Override



Mime
View raw message