RightCurly: False negative on multiblock tokens with ALONE_OR_SINGLELINE option #4091

Closed
Vladlis opened this Issue Mar 23, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@Vladlis
Member

Vladlis commented Mar 23, 2017

$ cat TestClass.java
public class TestClass {
    void method() {
        if (true) {
            getClass();}
    }
}

$ 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="RightCurly">
            <property name="option" value="ALONE_OR_SINGLELINE"/>
        </module>
    </module>
</module>

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

Expected: violation on IF
Issue is reproducible with other multiblock tokens as well (for, while...)

@Vladlis

This comment has been minimized.

Show comment
Hide comment
@Vladlis

Vladlis Mar 23, 2017

Member

I am on it

Member

Vladlis commented Mar 23, 2017

I am on it

Vladlis added a commit to Vladlis/checkstyle that referenced this issue Mar 23, 2017

Vladlis added a commit to Vladlis/checkstyle that referenced this issue Mar 24, 2017

Vladlis added a commit to Vladlis/checkstyle that referenced this issue Mar 24, 2017

Vladlis added a commit to Vladlis/checkstyle that referenced this issue Mar 24, 2017

Vladlis added a commit to Vladlis/checkstyle that referenced this issue Mar 25, 2017

Vladlis added a commit to Vladlis/checkstyle that referenced this issue Mar 25, 2017

Vladlis added a commit to Vladlis/checkstyle that referenced this issue Mar 25, 2017

Vladlis added a commit to Vladlis/checkstyle that referenced this issue Mar 25, 2017

rnveach added a commit that referenced this issue Apr 5, 2017

@rnveach

This comment has been minimized.

Show comment
Hide comment
@rnveach

rnveach Apr 5, 2017

Member

Fix is merged

Member

rnveach commented Apr 5, 2017

Fix is merged

@rnveach rnveach closed this Apr 5, 2017

@rnveach rnveach added this to the 7.7 milestone Apr 5, 2017

@rnveach rnveach added the bug label Apr 5, 2017

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