-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Java14 Full Records Support Check Validation: WhitespaceAroundCheck #8528
Comments
This check should handle compact record ctors too: <!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="WhitespaceAround">
<property name="allowEmptyConstructors" value="true"/>
</module>
</module>
</module> class TestClass {
public TestClass() {} // ok
}
record TestRecord() {
public TestRecord {} // unexpected violation x2
} The method |
@pbludov This should be a violation too, right?
Also, what about allowing violation of empty component list, |
Yes, it should be more like a ctor declaration. class TestClass {
TestClass () { // if there is a violation...
}
}
class TestRecord () { // ...then there must be the same violation here
}
I'm not sure. There is already |
Actually, there is no violation for this:
|
Both |
I'm adding test cases to show this. |
Fix is merged |
Child of #8452
Check documentation: https://checkstyle.sourceforge.io/config_whitespace.html#WhitespaceAround
From check documentation:
Checks that a token is surrounded by whitespace. Empty constructor, method, class, enum, interface, loop bodies (blocks), lambdas of the form...
This check works as intended with the new records syntax, so I think we can close this issue.
The text was updated successfully, but these errors were encountered: