From 20fd254101553cb5a4c932c8d03064899112bee6 Mon Sep 17 00:00:00 2001 From: Dongjoon Hyun Date: Mon, 21 Mar 2016 07:58:57 +0000 Subject: [SPARK-14011][CORE][SQL] Enable `LineLength` Java checkstyle rule ## What changes were proposed in this pull request? [Spark Coding Style Guide](https://cwiki.apache.org/confluence/display/SPARK/Spark+Code+Style+Guide) has 100-character limit on lines, but it's disabled for Java since 11/09/15. This PR enables **LineLength** checkstyle again. To help that, this also introduces **RedundantImport** and **RedundantModifier**, too. The following is the diff on `checkstyle.xml`. ```xml - - -167,5 +164,7 + + ``` ## How was this patch tested? Currently, `lint-java` is disabled in Jenkins. It needs a manual test. After passing the Jenkins tests, `dev/lint-java` should passes locally. Author: Dongjoon Hyun Closes #11831 from dongjoon-hyun/SPARK-14011. --- .../apache/spark/ml/classification/JavaLogisticRegressionSuite.java | 1 - .../java/org/apache/spark/ml/classification/JavaOneVsRestSuite.java | 3 ++- .../java/org/apache/spark/ml/feature/JavaStopWordsRemoverSuite.java | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'mllib/src/test') diff --git a/mllib/src/test/java/org/apache/spark/ml/classification/JavaLogisticRegressionSuite.java b/mllib/src/test/java/org/apache/spark/ml/classification/JavaLogisticRegressionSuite.java index 536f0dc58f..e160a5a47e 100644 --- a/mllib/src/test/java/org/apache/spark/ml/classification/JavaLogisticRegressionSuite.java +++ b/mllib/src/test/java/org/apache/spark/ml/classification/JavaLogisticRegressionSuite.java @@ -18,7 +18,6 @@ package org.apache.spark.ml.classification; import java.io.Serializable; -import java.lang.Math; import java.util.List; import org.junit.After; diff --git a/mllib/src/test/java/org/apache/spark/ml/classification/JavaOneVsRestSuite.java b/mllib/src/test/java/org/apache/spark/ml/classification/JavaOneVsRestSuite.java index d493a7fcec..00f4476841 100644 --- a/mllib/src/test/java/org/apache/spark/ml/classification/JavaOneVsRestSuite.java +++ b/mllib/src/test/java/org/apache/spark/ml/classification/JavaOneVsRestSuite.java @@ -48,7 +48,8 @@ public class JavaOneVsRestSuite implements Serializable { jsql = new SQLContext(jsc); int nPoints = 3; - // The following coefficients and xMean/xVariance are computed from iris dataset with lambda=0.2. + // The following coefficients and xMean/xVariance are computed from iris dataset with + // lambda=0.2. // As a result, we are drawing samples from probability distribution of an actual model. double[] coefficients = { -0.57997, 0.912083, -0.371077, -0.819866, 2.688191, diff --git a/mllib/src/test/java/org/apache/spark/ml/feature/JavaStopWordsRemoverSuite.java b/mllib/src/test/java/org/apache/spark/ml/feature/JavaStopWordsRemoverSuite.java index 5812037dee..bdcbde5e26 100644 --- a/mllib/src/test/java/org/apache/spark/ml/feature/JavaStopWordsRemoverSuite.java +++ b/mllib/src/test/java/org/apache/spark/ml/feature/JavaStopWordsRemoverSuite.java @@ -63,7 +63,8 @@ public class JavaStopWordsRemoverSuite { RowFactory.create(Arrays.asList("Mary", "had", "a", "little", "lamb")) ); StructType schema = new StructType(new StructField[] { - new StructField("raw", DataTypes.createArrayType(DataTypes.StringType), false, Metadata.empty()) + new StructField("raw", DataTypes.createArrayType(DataTypes.StringType), false, + Metadata.empty()) }); Dataset dataset = jsql.createDataFrame(data, schema); -- cgit v1.2.3