Skip to content

Issue #18435: Remove emptyforinitializerpad Example2 from XdocsExampl…#18505

Merged
romani merged 1 commit into
checkstyle:masterfrom
ZaheerAhmadDev:fix-Xdocs-clean
Jan 6, 2026
Merged

Issue #18435: Remove emptyforinitializerpad Example2 from XdocsExampl…#18505
romani merged 1 commit into
checkstyle:masterfrom
ZaheerAhmadDev:fix-Xdocs-clean

Conversation

@ZaheerAhmadDev

@ZaheerAhmadDev ZaheerAhmadDev commented Jan 4, 2026

Copy link
Copy Markdown
Contributor

Issue #18435:
Remove emptyforinitializerpad Example2 from XdocsExamplesAstConsistencyTest.
Update Example 2 to match Example 1 Ast.

https://www.diffchecker.com/kS03ZKeN/
Comparison of Example1 and  Example2
Both Example2 and Example1 have same numbers and spacing.

@romani romani left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://www.diffchecker.com/vr99pJo2/

Image

please keep all numbers and spaces be same.

only comments location and content should be in diff.

@romani

romani commented Jan 4, 2026

Copy link
Copy Markdown
Member

@smita1078 , do you see a reason why diff checking did not detect different numbers.

@smita1078

Copy link
Copy Markdown
Contributor

@smita1078 , do you see a reason why diff checking did not detect different numbers.

I didn't get it? Are u asking about the XdocsExamplesAstConsistencyTest

@romani

romani commented Jan 5, 2026

Copy link
Copy Markdown
Member

@smita1078 , yes. There is different digit in for loop , and test is not failing.

@smita1078

smita1078 commented Jan 5, 2026

Copy link
Copy Markdown
Contributor

@smita1078 , yes. There is different digit in for loop , and test is not failing.

Currently The test only compares token types and structure, not literal values. So i < 1 and i < 2 have identical AST structure (between xdoc --start and xdoc --end) from this test's perspective.

@romani

romani commented Jan 5, 2026

Copy link
Copy Markdown
Member

@smita1078, please create issue, this is good point to improve.

@ZaheerAhmadDev ZaheerAhmadDev force-pushed the fix-Xdocs-clean branch 2 times, most recently from bae7cb4 to 330167c Compare January 5, 2026 07:06
@smita1078

Copy link
Copy Markdown
Contributor

@smita1078, please create issue, this is good point to improve.

Sure will do!

@ZaheerAhmadDev

Copy link
Copy Markdown
Contributor Author

@romani,
All numbers and spacing in Example2 are identical to Example1.
Only the comments differ as they are used solely to explain the violations for documentation purposes.

@smita1078

Copy link
Copy Markdown
Contributor

@smita1078, please create issue, this is good point to improve.

#18517

@romani

romani commented Jan 5, 2026

Copy link
Copy Markdown
Member

@ZaheerAhmadDev, please share web diff in PR description, as I did

@romani romani left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Items

for (; i < 2; i++ ) { }; // violation '';' is not preceded with whitespace'
for (;i<2;i++) { }; // violation '';' is not preceded with whitespace'
for ( ;i<2;i++) { };
for ( ; i < 1; i++ );

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use 2 to let FOR to look kind of same in all lines

@romani

romani commented Jan 6, 2026

Copy link
Copy Markdown
Member

GitHub, generate website

@romani

romani commented Jan 6, 2026

Copy link
Copy Markdown
Member

@ZaheerAhmadDev , please do #18505 (comment)

@ZaheerAhmadDev

Copy link
Copy Markdown
Contributor Author

@romani
Example2 now matches Example1 in numbers and spacing.Both Example 1 and Example 2 have same numbers and spaces.only comments differ to explain violations.

@romani

romani commented Jan 6, 2026

Copy link
Copy Markdown
Member

Make it like #18505 (review)

@ZaheerAhmadDev ZaheerAhmadDev left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Numbers and spacing in Example2 and Example1 are both same.
Comments remain to explain violations.

@romani

romani commented Jan 6, 2026

Copy link
Copy Markdown
Member

I don't know how else hint you that I need picture of diff , same as I did

@ZaheerAhmadDev

Copy link
Copy Markdown
Contributor Author

@romani

romani commented Jan 6, 2026

Copy link
Copy Markdown
Member

Compare example1 vs example2

@ZaheerAhmadDev

Copy link
Copy Markdown
Contributor Author

https://www.diffchecker.com/kS03ZKeN/
Comparison of Example1 and  Example2
Both Example2 and Example1 have same numbers and spacing.

@ZaheerAhmadDev

Copy link
Copy Markdown
Contributor Author

@romani, please review this PR and let me know if any other changes are required.

@ZaheerAhmadDev

Copy link
Copy Markdown
Contributor Author

@romani ,
===================== BENCHMARK SUMMARY ====================
Execution Time Baseline: 390.7 s
Average Execution Time: 433.10 s

Execution Time Difference: 10.8500%
Difference exceeds the maximum allowed difference (10.8500% > 10%)!
The changes in this PR are mostly related to removing Example2 from Xdocs, so I don’t expect it to significantly affect performance.

@romani romani merged commit 4d9f4e0 into checkstyle:master Jan 6, 2026
118 of 119 checks passed
@romani

romani commented Jan 6, 2026

Copy link
Copy Markdown
Member

All good thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants