Roman Ivanov
Roman Ivanov
match empty static block: ``` $ cat Test.java /** some. */ public class Test { static {} static {;} } $ java -jar checkstyle-10.18.1-all.jar \ -b "//STATIC_INIT/SLIST/*[1][self::RCURLY]" \ Test.java COMPILATION_UNIT...
empty IF ``` $ javac Test.java $ cat Test.java /** some. */ public class Test { void foo() { if (true) { } if (true) {;} } } $ java...
``` $ javac Test.java $ cat Test.java /** some. */ public class Test { void foo() throws Exception { try (MyResource r = new MyResource()) { } try (MyResource r...
`//*[self::LITERAL_IF or self::STATIC_INIT or self::LITERAL_TRY]/SLIST/*[1][self::RCURLY]` All this empty blocks if very hacky code, that most likely almost never happens in code, so weird edgecases, when it is ok to have...
RightCurly supposed to do job here already but had problem https://github.com/checkstyle/checkstyle/issues/6807 and suppressed https://github.com/checkstyle/checkstyle/blob/35d646dd5599058e7dbdab0b4eccbb58da5bfef6/src/main/resources/google_checks.xml#L104-L117 https://github.com/checkstyle/checkstyle/issues/7541 looks like more elegant way of doing this if we have more time ( not...
> We should be giving violation for not having curly braces in K&R style for this case, We can split issue in few issues, in first issue we just remove...
No need to wait, just make new branch from branch of this PR, do work, you can send PR (there will be 2 commits), we start review of second commit,...
issue is fixed by https://github.com/checkstyle/checkstyle/pull/15659 that is related to issue https://github.com/checkstyle/checkstyle/issues/15642 Followup issue is created to address false-negatives detected during testing https://github.com/checkstyle/checkstyle/issues/15664
Still a problem https://dev.azure.com/romanivanovjr/romanivanovjr/_build/results?buildId=23457&view=logs&jobId=e663805c-ee13-5a24-f979-d725e0346c8e&j=e663805c-ee13-5a24-f979-d725e0346c8e&t=40ff6e43-c5d7-5753-f947-23012624b0c6 ``` - spotbugs-maven-plugin:4.8.6.2:check (default) @ checkstyle --- [INFO] BugInstance size is 1 [INFO] Error size is 0 [INFO] Total bugs: 1 [ERROR] Low: Overridable method clearSelection...
Fix is claimed to released in 4.8.4 of spot bugs Library. We use maven plugin 4.8.6.2 that uses library 4.8.6. https://mvnrepository.com/artifact/com.github.spotbugs/spotbugs-maven-plugin/4.8.6.2 https://github.com/checkstyle/checkstyle/blob/5d8229566b6bae89a7e97b7404fa45efbffcc54b/pom.xml#L211 I contacted spotbugs team https://github.com/spotbugs/spotbugs/issues/1867#issuecomment-2322349914