You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ch...@apache.org on 2017/07/18 18:58:57 UTC
[2/9] flink git commit: [FLINK-7189] Activate checkstyle
flink-java/utils
[FLINK-7189] Activate checkstyle flink-java/utils
This closes #4336.
Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/137463cd
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/137463cd
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/137463cd
Branch: refs/heads/master
Commit: 137463cd6651dd63fbc3d45796208cb359680d73
Parents: 72678f1
Author: Dawid Wysakowicz <dw...@apache.org>
Authored: Fri Jul 14 10:35:29 2017 +0200
Committer: zentol <ch...@apache.org>
Committed: Tue Jul 18 16:14:25 2017 +0200
----------------------------------------------------------------------
.../flink/api/java/utils/DataSetUtils.java | 32 +++---
.../org/apache/flink/api/java/utils/Option.java | 6 +-
.../apache/flink/api/java/utils/OptionType.java | 3 +-
.../flink/api/java/utils/ParameterTool.java | 100 +++++++++----------
.../api/java/utils/RequiredParameters.java | 14 +--
.../java/utils/RequiredParametersException.java | 1 +
.../java/utils/AbstractParameterToolTest.java | 4 +
.../api/java/utils/RequiredParametersTest.java | 10 +-
8 files changed, 82 insertions(+), 88 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flink/blob/137463cd/flink-java/src/main/java/org/apache/flink/api/java/utils/DataSetUtils.java
----------------------------------------------------------------------
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/utils/DataSetUtils.java b/flink-java/src/main/java/org/apache/flink/api/java/utils/DataSetUtils.java
index f04211c..8f62a80 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/utils/DataSetUtils.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/utils/DataSetUtils.java
@@ -41,8 +41,8 @@ import org.apache.flink.api.java.summarize.aggregation.SummaryAggregatorFactory;
import org.apache.flink.api.java.summarize.aggregation.TupleSummaryAggregator;
import org.apache.flink.api.java.tuple.Tuple;
import org.apache.flink.api.java.tuple.Tuple2;
-import org.apache.flink.api.java.typeutils.TypeExtractor;
import org.apache.flink.api.java.typeutils.TupleTypeInfoBase;
+import org.apache.flink.api.java.typeutils.TypeExtractor;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.util.AbstractID;
import org.apache.flink.util.Collector;
@@ -134,7 +134,7 @@ public final class DataSetUtils {
}
/**
- * Method that assigns a unique {@link Long} value to all elements in the input data set in the following way:
+ * Method that assigns a unique {@link Long} value to all elements in the input data set as described below.
* <ul>
* <li> a map function is applied to the input data set
* <li> each map task holds a counter c which is increased for each record
@@ -221,10 +221,9 @@ public final class DataSetUtils {
/**
* Generate a sample of DataSet which contains fixed size elements.
- * <p>
- * <strong>NOTE:</strong> Sample with fixed size is not as efficient as sample with fraction, use sample with
+ *
+ * <p><strong>NOTE:</strong> Sample with fixed size is not as efficient as sample with fraction, use sample with
* fraction unless you need exact precision.
- * </p>
*
* @param withReplacement Whether element can be selected more than once.
* @param numSamples The expected sample size.
@@ -240,10 +239,9 @@ public final class DataSetUtils {
/**
* Generate a sample of DataSet which contains fixed size elements.
- * <p>
- * <strong>NOTE:</strong> Sample with fixed size is not as efficient as sample with fraction, use sample with
+ *
+ * <p><strong>NOTE:</strong> Sample with fixed size is not as efficient as sample with fraction, use sample with
* fraction unless you need exact precision.
- * </p>
*
* @param withReplacement Whether element can be selected more than once.
* @param numSamples The expected sample size.
@@ -295,11 +293,10 @@ public final class DataSetUtils {
// Summarize
// --------------------------------------------------------------------------------------------
-
/**
- * Summarize a DataSet of Tuples by collecting single pass statistics for all columns
+ * Summarize a DataSet of Tuples by collecting single pass statistics for all columns.
*
- * Example usage:
+ * <p>Example usage:
* <pre>
* {@code
* Dataset<Tuple3<Double, String, Boolean>> input = // [...]
@@ -312,7 +309,7 @@ public final class DataSetUtils {
* @return the summary as a Tuple the same width as input rows
*/
public static <R extends Tuple, T extends Tuple> R summarize(DataSet<T> input) throws Exception {
- if( !input.getType().isTupleType()) {
+ if (!input.getType().isTupleType()) {
throw new IllegalArgumentException("summarize() is only implemented for DataSet's of Tuples");
}
final TupleTypeInfoBase<?> inType = (TupleTypeInfoBase<?>) input.getType();
@@ -320,7 +317,7 @@ public final class DataSetUtils {
@Override
public void mapPartition(Iterable<T> values, Collector<TupleSummaryAggregator<R>> out) throws Exception {
TupleSummaryAggregator<R> aggregator = SummaryAggregatorFactory.create(inType);
- for (Tuple value: values) {
+ for (Tuple value : values) {
aggregator.aggregate(value);
}
out.collect(aggregator);
@@ -356,16 +353,15 @@ public final class DataSetUtils {
return res.<Utils.ChecksumHashCode> getAccumulatorResult(id);
}
-
// *************************************************************************
// UTIL METHODS
// *************************************************************************
- public static int getBitSize(long value){
- if(value > Integer.MAX_VALUE) {
- return 64 - Integer.numberOfLeadingZeros((int)(value >> 32));
+ public static int getBitSize(long value) {
+ if (value > Integer.MAX_VALUE) {
+ return 64 - Integer.numberOfLeadingZeros((int) (value >> 32));
} else {
- return 32 - Integer.numberOfLeadingZeros((int)value);
+ return 32 - Integer.numberOfLeadingZeros((int) value);
}
}
http://git-wip-us.apache.org/repos/asf/flink/blob/137463cd/flink-java/src/main/java/org/apache/flink/api/java/utils/Option.java
----------------------------------------------------------------------
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/utils/Option.java b/flink-java/src/main/java/org/apache/flink/api/java/utils/Option.java
index aaf714f..818d5f0 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/utils/Option.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/utils/Option.java
@@ -58,7 +58,6 @@ public class Option {
return this;
}
-
/**
* Define the type of the Option.
*
@@ -73,11 +72,10 @@ public class Option {
/**
* Define a default value for the option.
*
- * Throws an exception if the list of possible values for the parameter is not empty and the default value passed
- * is not in the list.
- *
* @param defaultValue - the default value
* @return the updated Option
+ * @throws RequiredParametersException if the list of possible values for the parameter is not empty and the default
+ * value passed is not in the list.
*/
public Option defaultValue(String defaultValue) throws RequiredParametersException {
if (this.choices.isEmpty()) {
http://git-wip-us.apache.org/repos/asf/flink/blob/137463cd/flink-java/src/main/java/org/apache/flink/api/java/utils/OptionType.java
----------------------------------------------------------------------
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/utils/OptionType.java b/flink-java/src/main/java/org/apache/flink/api/java/utils/OptionType.java
index 8361668..7d7755c 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/utils/OptionType.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/utils/OptionType.java
@@ -16,7 +16,6 @@
* limitations under the License.
*/
-
package org.apache.flink.api.java.utils;
import org.apache.flink.annotation.PublicEvolving;
@@ -24,7 +23,7 @@ import org.apache.flink.annotation.PublicEvolving;
/**
* Types the parameters of managed with {@link RequiredParameters} can take.
*
- * Name maps directly to the corresponding Java type.
+ * <p>Name maps directly to the corresponding Java type.
*/
@PublicEvolving
public enum OptionType {
http://git-wip-us.apache.org/repos/asf/flink/blob/137463cd/flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java
----------------------------------------------------------------------
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java b/flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java
index b76bcc0..44853f8 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/utils/ParameterTool.java
@@ -15,15 +15,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
package org.apache.flink.api.java.utils;
-import org.apache.commons.cli.Option;
-import org.apache.commons.lang3.math.NumberUtils;
import org.apache.flink.annotation.Public;
import org.apache.flink.annotation.PublicEvolving;
import org.apache.flink.api.common.ExecutionConfig;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.util.Preconditions;
+
+import org.apache.commons.cli.Option;
+import org.apache.commons.lang3.math.NumberUtils;
import org.apache.hadoop.util.GenericOptionsParser;
import java.io.File;
@@ -42,7 +44,7 @@ import java.util.Properties;
import java.util.Set;
/**
- * This class provides simple utility methods for reading and parsing program arguments from different sources
+ * This class provides simple utility methods for reading and parsing program arguments from different sources.
*/
@Public
public class ParameterTool extends ExecutionConfig.GlobalJobParameters implements Serializable, Cloneable {
@@ -51,14 +53,13 @@ public class ParameterTool extends ExecutionConfig.GlobalJobParameters implement
protected static final String NO_VALUE_KEY = "__NO_VALUE_KEY";
protected static final String DEFAULT_UNDEFINED = "<undefined>";
-
// ------------------ Constructors ------------------------
/**
* Returns {@link ParameterTool} for the given arguments. The arguments are keys followed by values.
* Keys have to start with '-' or '--'
- * <p>
- * <strong>Example arguments:</strong>
+ *
+ * <p><strong>Example arguments:</strong>
* --key1 value1 --key2 value2 -key3 value3
*
* @param args Input array arguments
@@ -70,12 +71,12 @@ public class ParameterTool extends ExecutionConfig.GlobalJobParameters implement
String key = null;
String value = null;
boolean expectValue = false;
- for(String arg: args) {
+ for (String arg : args) {
// check for -- argument
- if(arg.startsWith("--")) {
- if(expectValue) {
+ if (arg.startsWith("--")) {
+ if (expectValue) {
// we got into a new key, even though we were a value --> current key is one without value
- if(value != null) {
+ if (value != null) {
throw new IllegalStateException("Unexpected state");
}
map.put(key, NO_VALUE_KEY);
@@ -84,16 +85,16 @@ public class ParameterTool extends ExecutionConfig.GlobalJobParameters implement
key = arg.substring(2);
expectValue = true;
} // check for - argument
- else if(arg.startsWith("-")) {
+ else if (arg.startsWith("-")) {
// we are waiting for a value, so this is a - prefixed value (negative number)
- if(expectValue) {
+ if (expectValue) {
- if(NumberUtils.isNumber(arg)) {
+ if (NumberUtils.isNumber(arg)) {
// negative number
value = arg;
expectValue = false;
} else {
- if(value != null) {
+ if (value != null) {
throw new IllegalStateException("Unexpected state");
}
// We waited for a value but found a new key. So the previous key doesnt have a value.
@@ -107,37 +108,37 @@ public class ParameterTool extends ExecutionConfig.GlobalJobParameters implement
expectValue = true;
}
} else {
- if(expectValue) {
+ if (expectValue) {
value = arg;
expectValue = false;
} else {
- throw new RuntimeException("Error parsing arguments '"+ Arrays.toString(args)+"' on '"+arg+"'. Unexpected value. Please prefix values with -- or -.");
+ throw new RuntimeException("Error parsing arguments '" + Arrays.toString(args) + "' on '" + arg + "'. Unexpected value. Please prefix values with -- or -.");
}
}
- if(value == null && key == null) {
+ if (value == null && key == null) {
throw new IllegalStateException("Value and key can not be null at the same time");
}
- if(key != null && value == null && !expectValue) {
+ if (key != null && value == null && !expectValue) {
throw new IllegalStateException("Value expected but flag not set");
}
- if(key != null && value != null) {
+ if (key != null && value != null) {
map.put(key, value);
key = null;
value = null;
expectValue = false;
}
- if(key != null && key.length() == 0) {
- throw new IllegalArgumentException("The input "+Arrays.toString(args)+" contains an empty argument");
+ if (key != null && key.length() == 0) {
+ throw new IllegalArgumentException("The input " + Arrays.toString(args) + " contains an empty argument");
}
- if(key != null && !expectValue) {
+ if (key != null && !expectValue) {
map.put(key, NO_VALUE_KEY);
key = null;
expectValue = false;
}
}
- if(key != null) {
+ if (key != null) {
map.put(key, NO_VALUE_KEY);
}
@@ -145,28 +146,27 @@ public class ParameterTool extends ExecutionConfig.GlobalJobParameters implement
}
/**
- * Returns {@link ParameterTool} for the given {@link Properties} file
+ * Returns {@link ParameterTool} for the given {@link Properties} file.
*
* @param path Path to the properties file
* @return A {@link ParameterTool}
* @throws IOException If the file does not exist
- *
* @see Properties
*/
public static ParameterTool fromPropertiesFile(String path) throws IOException {
File propertiesFile = new File(path);
- if(!propertiesFile.exists()) {
+ if (!propertiesFile.exists()) {
throw new FileNotFoundException("Properties file " + propertiesFile.getAbsolutePath() + " does not exist");
}
Properties props = new Properties();
try (FileInputStream fis = new FileInputStream(propertiesFile)) {
props.load(fis);
}
- return fromMap((Map)props);
+ return fromMap((Map) props);
}
/**
- * Returns {@link ParameterTool} for the given map
+ * Returns {@link ParameterTool} for the given map.
*
* @param map A map of arguments. Both Key and Value have to be Strings
* @return A {@link ParameterTool}
@@ -188,7 +188,7 @@ public class ParameterTool extends ExecutionConfig.GlobalJobParameters implement
}
/**
- * Returns {@link ParameterTool} for the arguments parsed by {@link GenericOptionsParser}
+ * Returns {@link ParameterTool} for the arguments parsed by {@link GenericOptionsParser}.
*
* @param args Input array arguments. It should be parsable by {@link GenericOptionsParser}
* @return A {@link ParameterTool}
@@ -256,13 +256,12 @@ public class ParameterTool extends ExecutionConfig.GlobalJobParameters implement
public String getRequired(String key) {
addToDefaults(key, null);
String value = get(key);
- if(value == null) {
- throw new RuntimeException("No data for required key '"+key+"'");
+ if (value == null) {
+ throw new RuntimeException("No data for required key '" + key + "'");
}
return value;
}
-
/**
* Returns the String value for the given key.
* If the key does not exist it will return the given default value.
@@ -270,7 +269,7 @@ public class ParameterTool extends ExecutionConfig.GlobalJobParameters implement
public String get(String key, String defaultValue) {
addToDefaults(key, defaultValue);
String value = get(key);
- if(value == null) {
+ if (value == null) {
return defaultValue;
} else {
return value;
@@ -355,7 +354,7 @@ public class ParameterTool extends ExecutionConfig.GlobalJobParameters implement
public float getFloat(String key, float defaultValue) {
addToDefaults(key, Float.toString(defaultValue));
String value = get(key);
- if(value == null) {
+ if (value == null) {
return defaultValue;
} else {
return Float.valueOf(value);
@@ -381,7 +380,7 @@ public class ParameterTool extends ExecutionConfig.GlobalJobParameters implement
public double getDouble(String key, double defaultValue) {
addToDefaults(key, Double.toString(defaultValue));
String value = get(key);
- if(value == null) {
+ if (value == null) {
return defaultValue;
} else {
return Double.valueOf(value);
@@ -407,7 +406,7 @@ public class ParameterTool extends ExecutionConfig.GlobalJobParameters implement
public boolean getBoolean(String key, boolean defaultValue) {
addToDefaults(key, Boolean.toString(defaultValue));
String value = get(key);
- if(value == null) {
+ if (value == null) {
return defaultValue;
} else {
return Boolean.valueOf(value);
@@ -433,7 +432,7 @@ public class ParameterTool extends ExecutionConfig.GlobalJobParameters implement
public short getShort(String key, short defaultValue) {
addToDefaults(key, Short.toString(defaultValue));
String value = get(key);
- if(value == null) {
+ if (value == null) {
return defaultValue;
} else {
return Short.valueOf(value);
@@ -459,7 +458,7 @@ public class ParameterTool extends ExecutionConfig.GlobalJobParameters implement
public byte getByte(String key, byte defaultValue) {
addToDefaults(key, Byte.toString(defaultValue));
String value = get(key);
- if(value == null) {
+ if (value == null) {
return defaultValue;
} else {
return Byte.valueOf(value);
@@ -470,14 +469,14 @@ public class ParameterTool extends ExecutionConfig.GlobalJobParameters implement
protected void addToDefaults(String key, String value) {
String currentValue = defaultData.get(key);
- if(currentValue == null) {
- if(value == null) {
+ if (currentValue == null) {
+ if (value == null) {
value = DEFAULT_UNDEFINED;
}
defaultData.put(key, value);
} else {
// there is already an entry for this key. Check if the value is the undefined
- if(currentValue.equals(DEFAULT_UNDEFINED) && value != null) {
+ if (currentValue.equals(DEFAULT_UNDEFINED) && value != null) {
// update key with better default value
defaultData.put(key, value);
}
@@ -487,20 +486,20 @@ public class ParameterTool extends ExecutionConfig.GlobalJobParameters implement
// ------------------------- Export to different targets -------------------------
/**
- * Returns a {@link Configuration} object from this {@link ParameterTool}
+ * Returns a {@link Configuration} object from this {@link ParameterTool}.
*
* @return A {@link Configuration}
*/
public Configuration getConfiguration() {
Configuration conf = new Configuration();
- for(Map.Entry<String, String> entry: data.entrySet()) {
+ for (Map.Entry<String, String> entry : data.entrySet()) {
conf.setString(entry.getKey(), entry.getValue());
}
return conf;
}
/**
- * Returns a {@link Properties} object from this {@link ParameterTool}
+ * Returns a {@link Properties} object from this {@link ParameterTool}.
*
* @return A {@link Properties}
*/
@@ -510,12 +509,11 @@ public class ParameterTool extends ExecutionConfig.GlobalJobParameters implement
return props;
}
-
/**
* Create a properties file with all the known parameters (call after the last get*() call).
* Set the default value, if available.
*
- * Use this method to create a properties file skeleton.
+ * <p>Use this method to create a properties file skeleton.
*
* @param pathToFile Location of the default properties file.
*/
@@ -533,11 +531,11 @@ public class ParameterTool extends ExecutionConfig.GlobalJobParameters implement
*/
public void createPropertiesFile(String pathToFile, boolean overwrite) throws IOException {
File file = new File(pathToFile);
- if(file.exists()) {
- if(overwrite) {
+ if (file.exists()) {
+ if (overwrite) {
file.delete();
} else {
- throw new RuntimeException("File "+pathToFile+" exists and overwriting is not allowed");
+ throw new RuntimeException("File " + pathToFile + " exists and overwriting is not allowed");
}
}
Properties defaultProps = new Properties();
@@ -552,12 +550,10 @@ public class ParameterTool extends ExecutionConfig.GlobalJobParameters implement
return new ParameterTool(this.data);
}
-
-
// ------------------------- Interaction with other ParameterUtils -------------------------
/**
- * Merges two {@link ParameterTool}
+ * Merges two {@link ParameterTool}.
*
* @param other Other {@link ParameterTool} object
* @return The Merged {@link ParameterTool}
http://git-wip-us.apache.org/repos/asf/flink/blob/137463cd/flink-java/src/main/java/org/apache/flink/api/java/utils/RequiredParameters.java
----------------------------------------------------------------------
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/utils/RequiredParameters.java b/flink-java/src/main/java/org/apache/flink/api/java/utils/RequiredParameters.java
index 889921b..1d2e73a 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/utils/RequiredParameters.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/utils/RequiredParameters.java
@@ -21,8 +21,8 @@ package org.apache.flink.api.java.utils;
import org.apache.flink.annotation.PublicEvolving;
import java.util.HashMap;
-import java.util.List;
import java.util.LinkedList;
+import java.util.List;
import java.util.Map;
import java.util.Objects;
@@ -78,9 +78,9 @@ public class RequiredParameters {
* - has a value been passed
* - if not, does the parameter have an associated default value
* - does the type of the parameter match the one defined in RequiredParameters
- * - does the value provided in the parameterTool adhere to the choices defined in the option
+ * - does the value provided in the parameterTool adhere to the choices defined in the option.
*
- * If any check fails, a RequiredParametersException is thrown
+ * <p>If any check fails, a RequiredParametersException is thrown
*
* @param parameterTool - parameters supplied by the user.
* @throws RequiredParametersException if any of the specified checks fail
@@ -167,7 +167,7 @@ public class RequiredParameters {
/**
* Build a help text for the defined parameters.
*
- * The format of the help text will be:
+ * <p>The format of the help text will be:
* Required Parameters:
* \t -:shortName:, --:name: \t :helpText: \t default: :defaultValue: \t choices: :choices: \n
*
@@ -190,11 +190,11 @@ public class RequiredParameters {
/**
* Build a help text for the defined parameters and list the missing arguments at the end of the text.
*
- * The format of the help text will be:
+ * <p>The format of the help text will be:
* Required Parameters:
* \t -:shortName:, --:name: \t :helpText: \t default: :defaultValue: \t choices: :choices: \n
*
- * Missing parameters:
+ * <p>Missing parameters:
* \t param1 param2 ... paramN
*
* @param missingArguments - a list of missing parameters
@@ -205,7 +205,7 @@ public class RequiredParameters {
}
/**
- * for the given option create a line for the help text which looks like:
+ * for the given option create a line for the help text. The line looks like:
* \t -:shortName:, --:name: \t :helpText: \t default: :defaultValue: \t choices: :choices:
*/
private String helpText(Option option) {
http://git-wip-us.apache.org/repos/asf/flink/blob/137463cd/flink-java/src/main/java/org/apache/flink/api/java/utils/RequiredParametersException.java
----------------------------------------------------------------------
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/utils/RequiredParametersException.java b/flink-java/src/main/java/org/apache/flink/api/java/utils/RequiredParametersException.java
index 0537fb7..2476a05 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/utils/RequiredParametersException.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/utils/RequiredParametersException.java
@@ -15,6 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
package org.apache.flink.api.java.utils;
import org.apache.flink.annotation.PublicEvolving;
http://git-wip-us.apache.org/repos/asf/flink/blob/137463cd/flink-java/src/test/java/org/apache/flink/api/java/utils/AbstractParameterToolTest.java
----------------------------------------------------------------------
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/utils/AbstractParameterToolTest.java b/flink-java/src/test/java/org/apache/flink/api/java/utils/AbstractParameterToolTest.java
index 9aa9a95..f4afdd2 100644
--- a/flink-java/src/test/java/org/apache/flink/api/java/utils/AbstractParameterToolTest.java
+++ b/flink-java/src/test/java/org/apache/flink/api/java/utils/AbstractParameterToolTest.java
@@ -20,6 +20,7 @@ package org.apache.flink.api.java.utils;
import org.apache.flink.api.java.ClosureCleaner;
import org.apache.flink.configuration.Configuration;
+
import org.junit.Assert;
import org.junit.Rule;
import org.junit.rules.TemporaryFolder;
@@ -28,6 +29,9 @@ import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;
+/**
+ * Base class for tests for {@link ParameterTool}.
+ */
public abstract class AbstractParameterToolTest {
@Rule
http://git-wip-us.apache.org/repos/asf/flink/blob/137463cd/flink-java/src/test/java/org/apache/flink/api/java/utils/RequiredParametersTest.java
----------------------------------------------------------------------
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/utils/RequiredParametersTest.java b/flink-java/src/test/java/org/apache/flink/api/java/utils/RequiredParametersTest.java
index 72d95df..11d1267 100644
--- a/flink-java/src/test/java/org/apache/flink/api/java/utils/RequiredParametersTest.java
+++ b/flink-java/src/test/java/org/apache/flink/api/java/utils/RequiredParametersTest.java
@@ -18,10 +18,6 @@
package org.apache.flink.api.java.utils;
-import static org.hamcrest.CoreMatchers.containsString;
-import static org.hamcrest.CoreMatchers.not;
-import static org.junit.Assert.fail;
-
import org.hamcrest.CoreMatchers;
import org.junit.Assert;
import org.junit.Rule;
@@ -30,8 +26,12 @@ import org.junit.rules.ExpectedException;
import java.util.Arrays;
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.hamcrest.CoreMatchers.not;
+import static org.junit.Assert.fail;
+
/**
- * Tests for RequiredParameter class and its interactions with ParameterTool
+ * Tests for RequiredParameter class and its interactions with ParameterTool.
*/
public class RequiredParametersTest {