Closed mahfouz72 closed 3 weeks ago
Please define line and the expected violation.
@nrmancuso
Same as https://github.com/checkstyle/checkstyle/issues/15225#issuecomment-2228355458
D:\CS\test cat config.xml
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="Checker">
<module name="TreeWalker">
<module name="NoWhitespaceAfter">
</module>
</module>
</module>
D:\CS\test cat src\Test.java
public class Test {
record Point(int x, int y ,int z) { }
}
D:\CS\test java -jar checkstyle-10.17.0-all.jar -c config.xml src/Test.java
Starting audit...
Audit done.
We should not be placing violations on this code, I am approving this issue for new test case only.
@mahfouz72 Can you clarify specifically what we are talking about in the first post.
I assume we are talking about line 3's .{space}
. However, I don't see how this transfers over to line 4. There is no period, but there is an extra space after _
which is a variable name, not related to a period.
Also you have expected violation
but then later say this behavior is correct.
@rnveach first post is updated. This was a bug issue before but then we agreed to not violate this example and just add an input and move on https://github.com/checkstyle/checkstyle/issues/15224#issuecomment-2254252543
First post is still not clear. What exactly were we examining and found not to be an issue.
similarity between these 2 examples
if (o instanceof ColoredPoint(int x, _ , String c) ) {}
record ColoredPoint(int x, int y , String c) { }
https://github.com/checkstyle/checkstyle/issues/15224#issuecomment-2227100841
It is still not clear what specifically is the target of this issue. What line/column are we talking about. The _
and y
and what comes after it?
It is still not clear what specifically is the target of this issue
NoWhitespaceAfter Unnamed patterns as stated im issue title
The _ and y and what comes after it?
Yes. the check doesn't emforces no whitspace after int y
then space after _
should not violation
Yes. the check doesn't emforces no whitspace after int y then space after _ should not violation
Please add info like this to the first post. It makes it clearer what we are examining for validation.
@rnveach done
child of https://github.com/checkstyle/checkstyle/issues/14942 Check doc: https://checkstyle.org/checks/whitespace/nowhitespaceafter.html#NoWhitespaceAfter
Describe what you want in detail.
This check's behavior is correct, we can just add a new test case for unnamed variables. The check doesn't enforce no whitespace after
int y
then space after_
should not violation