Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoWhitespaceAfter takes over WhitespaceAround setting #1013

Closed
maisonobe opened this issue Apr 29, 2015 · 2 comments
Closed

NoWhitespaceAfter takes over WhitespaceAround setting #1013

maisonobe opened this issue Apr 29, 2015 · 2 comments
Labels
Milestone

Comments

@maisonobe
Copy link

It seems a fix introduced between 6.2 and 6.3 changed the behaviour of NoWhitespaceAfter which now triggers an error with the following code, despiteWhitespaceAround is configured with at least PLUS in the tokens list :

public class A {
    public static int[][] create(int i, int j) {
        return new int[i + j][3];
    }
}

The error is "'i' is followed by whitespace."

I would think that an expression inside the square brackets for the array dimensions should be parsed as an expression, regardless of it being inside the brackets.

$ java -jar checkstyle-6.3-all.jar -c config.xml 3.java
Starting audit...
/var/tmp/3.java:3:25: 'i' is followed by whitespace.
Audit done.

$ java -jar checkstyle-6.2-all.jar -c config.xml 3.java
Starting audit...
Audit done.

$ cat 3.java 
public class A {
    public static int[][] create(int i, int j) {
        return new int[i + j][3];
    }
}

$ cat config.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">
  <module name="TreeWalker">
    <module name="NoWhitespaceAfter"/>
  </module>
</module>

Problem is caused by - e6638c3 with attempt to fix #68 and #542

maisonobe added a commit to CS-SI/Orekit that referenced this issue Apr 29, 2015
These warnings appear only since checkstyle versions 6.3 and are due to
bug checkstyle/checkstyle#1013. So they don't
appear with maven-checkstyle-plugin 2.15 which is based on checkstyle
6.1.1, but they appear with the current Eclipse checkstyle plugin which
is based on checkstyle 6.5.
@attatrol
Copy link
Contributor

I am on it.

attatrol added a commit to attatrol/checkstyle that referenced this issue Jul 24, 2015
attatrol added a commit to attatrol/checkstyle that referenced this issue Jul 25, 2015
attatrol added a commit to attatrol/checkstyle that referenced this issue Jul 26, 2015
attatrol added a commit to attatrol/checkstyle that referenced this issue Jul 27, 2015
attatrol added a commit to attatrol/checkstyle that referenced this issue Aug 4, 2015
attatrol added a commit to attatrol/checkstyle that referenced this issue Aug 4, 2015
attatrol added a commit to attatrol/checkstyle that referenced this issue Sep 5, 2015
attatrol added a commit to attatrol/checkstyle that referenced this issue Sep 5, 2015
attatrol added a commit to attatrol/checkstyle that referenced this issue Sep 6, 2015
attatrol added a commit to attatrol/checkstyle that referenced this issue Sep 6, 2015
attatrol added a commit to attatrol/checkstyle that referenced this issue Oct 12, 2015
attatrol added a commit to attatrol/checkstyle that referenced this issue Oct 12, 2015
attatrol added a commit to attatrol/checkstyle that referenced this issue Oct 12, 2015
attatrol added a commit to attatrol/checkstyle that referenced this issue Oct 12, 2015
attatrol added a commit to attatrol/checkstyle that referenced this issue Oct 12, 2015
attatrol added a commit to attatrol/checkstyle that referenced this issue Oct 12, 2015
attatrol added a commit to attatrol/checkstyle that referenced this issue Oct 20, 2015
attatrol added a commit to attatrol/checkstyle that referenced this issue Oct 20, 2015
attatrol added a commit to attatrol/checkstyle that referenced this issue Oct 24, 2015
attatrol added a commit to attatrol/checkstyle that referenced this issue Oct 24, 2015
attatrol added a commit to attatrol/checkstyle that referenced this issue Oct 27, 2015
attatrol added a commit to attatrol/checkstyle that referenced this issue Oct 28, 2015
attatrol added a commit to attatrol/checkstyle that referenced this issue Oct 28, 2015
attatrol added a commit to attatrol/checkstyle that referenced this issue Oct 28, 2015
attatrol added a commit to attatrol/checkstyle that referenced this issue Oct 28, 2015
attatrol added a commit to attatrol/checkstyle that referenced this issue Oct 28, 2015
attatrol added a commit to attatrol/checkstyle that referenced this issue Oct 28, 2015
attatrol added a commit to attatrol/checkstyle that referenced this issue Oct 28, 2015
attatrol added a commit to attatrol/checkstyle that referenced this issue Oct 28, 2015
attatrol added a commit to attatrol/checkstyle that referenced this issue Oct 28, 2015
attatrol added a commit to attatrol/checkstyle that referenced this issue Oct 29, 2015
attatrol added a commit to attatrol/checkstyle that referenced this issue Oct 29, 2015
attatrol added a commit to attatrol/checkstyle that referenced this issue Oct 29, 2015
romani pushed a commit that referenced this issue Oct 31, 2015
@romani romani added this to the 6.12 milestone Oct 31, 2015
@romani
Copy link
Member

romani commented Oct 31, 2015

merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants