RightCurly rule should properly enforce same rule for LITERAL_DO #3090

Closed
vrozov opened this Issue Apr 10, 2016 · 2 comments

Comments

Projects
None yet
3 participants
@vrozov

vrozov commented Apr 10, 2016

java -jar checkstyle-6.17-all.jar -c 1.xml DoWhile.java
Starting audit...
[ERROR] DoWhile.java:4:5: '}' at column 5 should be on the same line as the next part of a multi-block statement (one that directly contains multiple blocks: if/else-if/else or try/catch/finally). [RightCurly]
Audit done.
Checkstyle ends with 1 errors.

cat -n 1.xml
     1  <?xml version="1.0"?>
     2  <!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
     3         
     4  <module name="Checker">
     5    <property name="charset" value="UTF-8"/>
     6         
     7    <module name="TreeWalker">
     8      <module name="RightCurly">
     9        <property name="option" value="same"/>
    10        <property name="tokens" value="LITERAL_DO"/>
    11      </module>
    12    </module>
    13        
    14        
    15  </module>

cat -n DoWhile.java 
     1  public class DoWhile {
     2    public static void main(String[] args) {
     3      do {
     4      } while (true);
     5    }
     6  }

@vrozov vrozov changed the title from RightCurly rule should properly enforce same rule to RightCurly rule should properly enforce same rule for LITERAL_DO Apr 10, 2016

@romani

This comment has been minimized.

Show comment
Hide comment
@romani

romani Apr 10, 2016

Member

@vrozov , thanks a lot for informative(with all details) issue report.

Member

romani commented Apr 10, 2016

@vrozov , thanks a lot for informative(with all details) issue report.

MEZk pushed a commit to MEZk/checkstyle that referenced this issue Jun 7, 2016

MEZk added a commit to MEZk/checkstyle that referenced this issue Jun 10, 2016

MEZk added a commit to MEZk/checkstyle that referenced this issue Jun 10, 2016

romani added a commit that referenced this issue Jun 12, 2016

@romani romani added this to the 7.0 milestone Jun 12, 2016

@romani

This comment has been minimized.

Show comment
Hide comment
@romani

romani Jun 12, 2016

Member

fix is merged

Member

romani commented Jun 12, 2016

fix is merged

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