RedundantModifier: no violation on final enum field methods #3582

Closed
rnveach opened this Issue Nov 24, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@rnveach
Member

rnveach commented Nov 24, 2016

Taken from #2068 (comment) :

$ cat TestClass.java
public enum TestEnum {
    E1,

    E2 {
        @Override
        public final void v() {
        }
    };

    public void v() {
    }
}

$ cat TestConfig.xml
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
          "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
          "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">

<module name="Checker">
    <property name="charset" value="UTF-8"/>

    <module name="TreeWalker">
        <module name="RedundantModifier">
        </module>
    </module>
</module>

$ java -jar checkstyle-7.2-all.jar -c TestConfig.xml TestClass.java
Starting audit...
Audit done.

Expecting a violation on line 6. Final is redundant because enum like a final class in that it can't be inherited.

@romani

This comment has been minimized.

Show comment
Hide comment
@romani

romani Nov 26, 2016

Member

Ut that was added at #3579 , should be fixed.

Member

romani commented Nov 26, 2016

Ut that was added at #3579 , should be fixed.

rnveach added a commit to rnveach/checkstyle that referenced this issue Jan 5, 2017

@rnveach rnveach self-assigned this Jan 5, 2017

romani added a commit that referenced this issue Jan 5, 2017

@romani romani added the bug label Jan 5, 2017

@romani romani added this to the 7.5 milestone Jan 5, 2017

@romani

This comment has been minimized.

Show comment
Hide comment
@romani

romani Jan 5, 2017

Member

fix is merged.

Member

romani commented Jan 5, 2017

fix is merged.

@romani romani closed this Jan 5, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment