From 614c18dcd9b6424d87ea836e08ddf5a84cc53894 Mon Sep 17 00:00:00 2001 From: zentol Date: Wed, 2 Aug 2017 11:08:20 +0200 Subject: [PATCH] [FLINK-7348] [checkstyle] Allow redundant modifiers on methods / revert removal of final modifier This closes #4458. --- .../java/org/apache/flink/storm/wrappers/SpoutWrapper.java | 2 +- .../api/java/operators/translation/PlanFilterOperator.java | 2 +- .../java/org/apache/flink/graph/pregel/MessageIterator.java | 6 +++--- .../org/apache/flink/graph/spargel/MessageIterator.java | 6 +++--- tools/maven/checkstyle.xml | 4 +++- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/flink-contrib/flink-storm/src/main/java/org/apache/flink/storm/wrappers/SpoutWrapper.java b/flink-contrib/flink-storm/src/main/java/org/apache/flink/storm/wrappers/SpoutWrapper.java index 458fffbfc37ea..6d37b293fb850 100644 --- a/flink-contrib/flink-storm/src/main/java/org/apache/flink/storm/wrappers/SpoutWrapper.java +++ b/flink-contrib/flink-storm/src/main/java/org/apache/flink/storm/wrappers/SpoutWrapper.java @@ -240,7 +240,7 @@ public void setStormTopology(StormTopology stormTopology) { } @Override - public void run(final SourceContext ctx) throws Exception { + public final void run(final SourceContext ctx) throws Exception { final GlobalJobParameters config = super.getRuntimeContext().getExecutionConfig() .getGlobalJobParameters(); StormConfig stormConfig = new StormConfig(); diff --git a/flink-java/src/main/java/org/apache/flink/api/java/operators/translation/PlanFilterOperator.java b/flink-java/src/main/java/org/apache/flink/api/java/operators/translation/PlanFilterOperator.java index ecf1aac90205c..07287b8c7a216 100644 --- a/flink-java/src/main/java/org/apache/flink/api/java/operators/translation/PlanFilterOperator.java +++ b/flink-java/src/main/java/org/apache/flink/api/java/operators/translation/PlanFilterOperator.java @@ -53,7 +53,7 @@ private FlatMapFilter(FilterFunction wrapped) { } @Override - public void flatMap(T value, Collector out) throws Exception { + public final void flatMap(T value, Collector out) throws Exception { if (this.wrappedFunction.filter(value)) { out.collect(value); } diff --git a/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/pregel/MessageIterator.java b/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/pregel/MessageIterator.java index f8dd926c0bd0e..8f9cf81145c34 100644 --- a/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/pregel/MessageIterator.java +++ b/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/pregel/MessageIterator.java @@ -43,7 +43,7 @@ void setFirst(Message msg) { } @Override - public boolean hasNext() { + public final boolean hasNext() { if (first != null) { return true; } @@ -53,7 +53,7 @@ public boolean hasNext() { } @Override - public Message next() { + public final Message next() { if (first != null) { Message toReturn = first; first = null; @@ -63,7 +63,7 @@ public Message next() { } @Override - public void remove() { + public final void remove() { throw new UnsupportedOperationException(); } diff --git a/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/spargel/MessageIterator.java b/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/spargel/MessageIterator.java index be3695499065c..071a61708c1b1 100644 --- a/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/spargel/MessageIterator.java +++ b/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/spargel/MessageIterator.java @@ -36,17 +36,17 @@ void setSource(Iterator> source) { } @Override - public boolean hasNext() { + public final boolean hasNext() { return this.source.hasNext(); } @Override - public Message next() { + public final Message next() { return this.source.next().f1; } @Override - public void remove() { + public final void remove() { throw new UnsupportedOperationException(); } diff --git a/tools/maven/checkstyle.xml b/tools/maven/checkstyle.xml index 897802ba8f7bc..6139a44e90dfd 100644 --- a/tools/maven/checkstyle.xml +++ b/tools/maven/checkstyle.xml @@ -217,8 +217,10 @@ This file is based on the checkstyle file of Apache Beam. - +