Repository: spark Updated Branches: refs/heads/master 591c88c9e -> fe7246fea
[SPARK-12830] Java style: disallow trailing whitespaces. Author: Reynold Xin <r...@databricks.com> Closes #10764 from rxin/SPARK-12830. Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/fe7246fe Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/fe7246fe Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/fe7246fe Branch: refs/heads/master Commit: fe7246fea67e1d71fba679dee3eb2c7386b4f4e2 Parents: 591c88c Author: Reynold Xin <r...@databricks.com> Authored: Thu Jan 14 23:33:45 2016 -0800 Committer: Reynold Xin <r...@databricks.com> Committed: Thu Jan 14 23:33:45 2016 -0800 ---------------------------------------------------------------------- checkstyle.xml | 8 +++++++- .../java/org/apache/spark/examples/JavaLogQuery.java | 2 +- .../java/org/apache/spark/examples/JavaSparkPi.java | 2 +- .../apache/spark/mllib/random/JavaRandomRDDsSuite.java | 2 +- .../org/apache/spark/network/buffer/LazyFileRegion.java | 2 +- .../java/org/apache/spark/network/util/ByteUnit.java | 12 ++++++------ .../src/test/resources/data/conf/hive-log4j.properties | 2 +- .../org/apache/spark/unsafe/types/UTF8StringSuite.java | 2 +- 8 files changed, 19 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/fe7246fe/checkstyle.xml ---------------------------------------------------------------------- diff --git a/checkstyle.xml b/checkstyle.xml index a493ee4..b5d1617 100644 --- a/checkstyle.xml +++ b/checkstyle.xml @@ -58,6 +58,12 @@ <property name="eachLine" value="true"/> </module> + <module name="RegexpSingleline"> + <!-- \s matches whitespace character, $ matches end of line. --> + <property name="format" value="\s+$"/> + <property name="message" value="No trailing whitespace allowed."/> + </module> + <module name="TreeWalker"> <module name="OuterTypeFilename"/> <module name="IllegalTokenText"> @@ -84,7 +90,7 @@ </module> <module name="NeedBraces"> <property name="allowSingleLineStatement" value="true"/> - </module> + </module> <module name="OneStatementPerLine"/> <module name="ArrayTypeStyle"/> <module name="FallThrough"/> http://git-wip-us.apache.org/repos/asf/spark/blob/fe7246fe/examples/src/main/java/org/apache/spark/examples/JavaLogQuery.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/spark/examples/JavaLogQuery.java b/examples/src/main/java/org/apache/spark/examples/JavaLogQuery.java index 812e9d5..0448a1a 100644 --- a/examples/src/main/java/org/apache/spark/examples/JavaLogQuery.java +++ b/examples/src/main/java/org/apache/spark/examples/JavaLogQuery.java @@ -35,7 +35,7 @@ import java.util.regex.Pattern; /** * Executes a roll up-style query against Apache logs. - * + * * Usage: JavaLogQuery [logFile] */ public final class JavaLogQuery { http://git-wip-us.apache.org/repos/asf/spark/blob/fe7246fe/examples/src/main/java/org/apache/spark/examples/JavaSparkPi.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/spark/examples/JavaSparkPi.java b/examples/src/main/java/org/apache/spark/examples/JavaSparkPi.java index 0f07cb4..af87488 100644 --- a/examples/src/main/java/org/apache/spark/examples/JavaSparkPi.java +++ b/examples/src/main/java/org/apache/spark/examples/JavaSparkPi.java @@ -26,7 +26,7 @@ import org.apache.spark.api.java.function.Function2; import java.util.ArrayList; import java.util.List; -/** +/** * Computes an approximation to pi * Usage: JavaSparkPi [slices] */ http://git-wip-us.apache.org/repos/asf/spark/blob/fe7246fe/mllib/src/test/java/org/apache/spark/mllib/random/JavaRandomRDDsSuite.java ---------------------------------------------------------------------- diff --git a/mllib/src/test/java/org/apache/spark/mllib/random/JavaRandomRDDsSuite.java b/mllib/src/test/java/org/apache/spark/mllib/random/JavaRandomRDDsSuite.java index 5728df5..be58691 100644 --- a/mllib/src/test/java/org/apache/spark/mllib/random/JavaRandomRDDsSuite.java +++ b/mllib/src/test/java/org/apache/spark/mllib/random/JavaRandomRDDsSuite.java @@ -166,7 +166,7 @@ public class JavaRandomRDDsSuite { @SuppressWarnings("unchecked") public void testLogNormalVectorRDD() { double mean = 4.0; - double std = 2.0; + double std = 2.0; long m = 100L; int n = 10; int p = 2; http://git-wip-us.apache.org/repos/asf/spark/blob/fe7246fe/network/common/src/main/java/org/apache/spark/network/buffer/LazyFileRegion.java ---------------------------------------------------------------------- diff --git a/network/common/src/main/java/org/apache/spark/network/buffer/LazyFileRegion.java b/network/common/src/main/java/org/apache/spark/network/buffer/LazyFileRegion.java index 81bc8ec..162cf6d 100644 --- a/network/common/src/main/java/org/apache/spark/network/buffer/LazyFileRegion.java +++ b/network/common/src/main/java/org/apache/spark/network/buffer/LazyFileRegion.java @@ -32,7 +32,7 @@ import org.apache.spark.network.util.JavaUtils; /** * A FileRegion implementation that only creates the file descriptor when the region is being * transferred. This cannot be used with Epoll because there is no native support for it. - * + * * This is mostly copied from DefaultFileRegion implementation in Netty. In the future, we * should push this into Netty so the native Epoll transport can support this feature. */ http://git-wip-us.apache.org/repos/asf/spark/blob/fe7246fe/network/common/src/main/java/org/apache/spark/network/util/ByteUnit.java ---------------------------------------------------------------------- diff --git a/network/common/src/main/java/org/apache/spark/network/util/ByteUnit.java b/network/common/src/main/java/org/apache/spark/network/util/ByteUnit.java index 36d6550..a2f0183 100644 --- a/network/common/src/main/java/org/apache/spark/network/util/ByteUnit.java +++ b/network/common/src/main/java/org/apache/spark/network/util/ByteUnit.java @@ -33,8 +33,8 @@ public enum ByteUnit { public long convertFrom(long d, ByteUnit u) { return u.convertTo(d, this); } - - // Convert the provided number (d) interpreted as this unit type to unit type (u). + + // Convert the provided number (d) interpreted as this unit type to unit type (u). public long convertTo(long d, ByteUnit u) { if (multiplier > u.multiplier) { long ratio = multiplier / u.multiplier; @@ -44,7 +44,7 @@ public enum ByteUnit { } return d * ratio; } else { - // Perform operations in this order to avoid potential overflow + // Perform operations in this order to avoid potential overflow // when computing d * multiplier return d / (u.multiplier / multiplier); } @@ -54,14 +54,14 @@ public enum ByteUnit { if (d < 0) { throw new IllegalArgumentException("Negative size value. Size must be positive: " + d); } - return d * multiplier; + return d * multiplier; } - + public long toKiB(long d) { return convertTo(d, KiB); } public long toMiB(long d) { return convertTo(d, MiB); } public long toGiB(long d) { return convertTo(d, GiB); } public long toTiB(long d) { return convertTo(d, TiB); } public long toPiB(long d) { return convertTo(d, PiB); } - + private final long multiplier; } http://git-wip-us.apache.org/repos/asf/spark/blob/fe7246fe/sql/hive/src/test/resources/data/conf/hive-log4j.properties ---------------------------------------------------------------------- diff --git a/sql/hive/src/test/resources/data/conf/hive-log4j.properties b/sql/hive/src/test/resources/data/conf/hive-log4j.properties index 885c86f..6a04247 100644 --- a/sql/hive/src/test/resources/data/conf/hive-log4j.properties +++ b/sql/hive/src/test/resources/data/conf/hive-log4j.properties @@ -47,7 +47,7 @@ log4j.appender.DRFA.layout.ConversionPattern=%d{ISO8601} %-5p %c{2} (%F:%M(%L)) # # console -# Add "console" to rootlogger above if you want to use this +# Add "console" to rootlogger above if you want to use this # log4j.appender.console=org.apache.log4j.ConsoleAppender http://git-wip-us.apache.org/repos/asf/spark/blob/fe7246fe/unsafe/src/test/java/org/apache/spark/unsafe/types/UTF8StringSuite.java ---------------------------------------------------------------------- diff --git a/unsafe/src/test/java/org/apache/spark/unsafe/types/UTF8StringSuite.java b/unsafe/src/test/java/org/apache/spark/unsafe/types/UTF8StringSuite.java index e21ffdc..bef5d71 100644 --- a/unsafe/src/test/java/org/apache/spark/unsafe/types/UTF8StringSuite.java +++ b/unsafe/src/test/java/org/apache/spark/unsafe/types/UTF8StringSuite.java @@ -378,7 +378,7 @@ public class UTF8StringSuite { assertTrue(Arrays.equals(fromString("ab,def,ghi").split(fromString(","), 2), new UTF8String[]{fromString("ab"), fromString("def,ghi")})); } - + @Test public void levenshteinDistance() { assertEquals(0, EMPTY_UTF8.levenshteinDistance(EMPTY_UTF8)); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org