Issue #18118: fix indentation calculation logic for chained method call#18406
Conversation
|
Github, generate report for Indentation/all-examples-in-one |
|
Report for Indentation/all-examples-in-one: |
|
Diff is huge |
|
Hi @Atharv3221 , |
|
As per regression report change has caused huge difference in reported violations. I don't think all violations change were false positives. Means fix wasn't proper. Please add a test case which fails from this change. |
a0ec879 to
17a959d
Compare
|
Github, generate report for Indentation/all-examples-in-one |
|
Report for Indentation/all-examples-in-one: |
|
Hi @Atharv3221 |
|
@M-SaaD-H |
|
@Atharv3221 |
|
rebased in web |
|
please add to inputs https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/17a959dcf706b8fabba0acaa4e28e040231a667e_2025104024/reports/diff/spring-framework/index.html#A13 looks like we missing this case in our Inputs |
fbb84a3 to
bfd4287
Compare
|
@romani |
|
@romani |
d57a852 to
50fb25a
Compare
|
@romani |
|
Github, generate report for Indentation/all-examples-in-one |
|
Report for Indentation/all-examples-in-one: |
|
@romani
|
|
@M-SaaD-H , please review diff report, too much changes, we need to be sure that no regressions happening |
|
@vivek-0509, please help to review this PR. You are expert in this Check. |
|
Sure, I’ll review it once I get back to my laptop. |
|
Github, generate report for Indentation/all-examples-in-one |
|
Report generation failed. Please check the logs for more details. |
|
Github, generate report for Indentation/all-examples-in-one |
|
Report for Indentation/all-examples-in-one: |
|
@romani |
|
@M-SaaD-H We found a new surviving mutant please eliminate it |
|
@vivek-0509 @romani |
Fixes #18118
Problem
The Indentation check incorrectly flagged the closing parenthesis in chained method calls like:
However, using Stream.of("foo") instead produced no error, creating inconsistent behavior.
Solution
Modified MethodCallHandler.getIndentImpl() to add the line start column as an acceptable+ indent level for chained method calls. This allows correctly indented closing parens to be accepted while still validating actually incorrect indentation.