Skip to content

Commit

Permalink
[FLINK-7348] [checkstyle] Allow redundant modifiers on methods / reve…
Browse files Browse the repository at this point in the history
…rt removal of final modifier

This closes apache#4458.
  • Loading branch information
zentol committed Aug 7, 2017
1 parent a164407 commit 614c18d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public void setStormTopology(StormTopology stormTopology) {
}

@Override
public void run(final SourceContext<OUT> ctx) throws Exception {
public final void run(final SourceContext<OUT> ctx) throws Exception {
final GlobalJobParameters config = super.getRuntimeContext().getExecutionConfig()
.getGlobalJobParameters();
StormConfig stormConfig = new StormConfig();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private FlatMapFilter(FilterFunction<T> wrapped) {
}

@Override
public void flatMap(T value, Collector<T> out) throws Exception {
public final void flatMap(T value, Collector<T> out) throws Exception {
if (this.wrappedFunction.filter(value)) {
out.collect(value);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void setFirst(Message msg) {
}

@Override
public boolean hasNext() {
public final boolean hasNext() {
if (first != null) {
return true;
}
Expand All @@ -53,7 +53,7 @@ public boolean hasNext() {
}

@Override
public Message next() {
public final Message next() {
if (first != null) {
Message toReturn = first;
first = null;
Expand All @@ -63,7 +63,7 @@ public Message next() {
}

@Override
public void remove() {
public final void remove() {
throw new UnsupportedOperationException();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@ void setSource(Iterator<Tuple2<?, Message>> 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();
}

Expand Down
4 changes: 3 additions & 1 deletion tools/maven/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,10 @@ This file is based on the checkstyle file of Apache Beam.
<module name="RedundantModifier">
<!-- Checks for redundant modifiers on various symbol definitions.
See: http://checkstyle.sourceforge.net/config_modifier.html#RedundantModifier
We exclude METHOD_DEF to allow final methods in final classes to make them more future-proof.
-->
<property name="tokens" value="METHOD_DEF, VARIABLE_DEF, ANNOTATION_FIELD_DEF, INTERFACE_DEF, CLASS_DEF, ENUM_DEF"/>
<property name="tokens" value="VARIABLE_DEF, ANNOTATION_FIELD_DEF, INTERFACE_DEF, CLASS_DEF, ENUM_DEF"/>
</module>

<!--
Expand Down

0 comments on commit 614c18d

Please sign in to comment.