Skip to content

Conversation

DakshRJain737
Copy link

@DakshRJain737 DakshRJain737 commented Oct 3, 2025

Fixes GenericWhitespaceCheck to reject tab characters after closing angle bracket '>'
and enforce a single ASCII space where required, while keeping existing diamond operator exceptions intact.

This resolves Issue #17756.

@DakshRJain737 DakshRJain737 changed the title Fix GenericWhitespaceCheck to reject tabs after '>' Fix GenericWhitespaceCheck to reject tabs after '>' #17756 Oct 3, 2025
@DakshRJain737 DakshRJain737 changed the title Fix GenericWhitespaceCheck to reject tabs after '>' #17756 Fix GenericWhitespaceCheck to reject tabs after '>' Oct 3, 2025
@DakshRJain737 DakshRJain737 force-pushed the fix-generic-tab-whitespace branch 2 times, most recently from 5758a2d to 1f4bc16 Compare October 3, 2025 16:47
@mohitsatr
Copy link
Member

mohitsatr commented Oct 4, 2025

@DakshRJain737 you need to add test cases to prove your code actually resolves the issue.
Make a input file, copy the code from the issue and test if false-negative is actually eliminated.

@DakshRJain737
Copy link
Author

@mohitsatr I used tab space in input file. Its not being approved by workflows due to the tab

@mohitsatr
Copy link
Member

@DakshRJain737 Tabs are not allowed. Use Spaces

@DakshRJain737
Copy link
Author

@mohitsatr tried what you told but i dont know why it feels messed up

@DakshRJain737 DakshRJain737 force-pushed the fix-generic-tab-whitespace branch 2 times, most recently from 6905658 to 918c178 Compare October 5, 2025 11:40
@DakshRJain737
Copy link
Author

@mohitsatr
InputGenericWhitespace
GenericWhiteSpaceTest
GenericWhitespace

Coverage

here after + 1 < line.length can never be false due to which missed branches coverage is stuck at 93%

@mohitsatr
Copy link
Member

Github, generate report for GenericWhitespace/all-examples-in-one

Copy link
Contributor

github-actions bot commented Oct 6, 2025

@mohitsatr
Copy link
Member

mohitsatr commented Oct 6, 2025

@DakshRJain737

Add the following cases/ or similar looking syntax to the input:
https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/918c1787f4bf07c673cecff7a50bd91d3224aa15_2025120649/reports/diff/apache-ant/xref/home/runner/work/checkstyle/checkstyle/.ci-temp/repositories/apache-ant/src/main/org/apache/tools/ant/taskdefs/MacroDef.java.html#L47

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/918c1787f4bf07c673cecff7a50bd91d3224aa15_2025120649/reports/diff/apache-ant/xref/home/runner/work/checkstyle/checkstyle/.ci-temp/repositories/apache-ant/src/main/org/apache/tools/ant/types/PropertySet.java.html#L281

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/918c1787f4bf07c673cecff7a50bd91d3224aa15_2025120649/reports/diff/elasticsearch/xref/home/runner/work/checkstyle/checkstyle/.ci-temp/repositories/elasticsearch/src/main/java/org/elasticsearch/index/mapper/FieldMapperListener.java.html#L41

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/918c1787f4bf07c673cecff7a50bd91d3224aa15_2025120649/reports/diff/checkstyle/xref/home/runner/work/checkstyle/checkstyle/.ci-temp/repositories/checkstyle/src/test/resources/com/puppycrawl/tools/checkstyle/checks/indentation/indentation/InputIndentationMembers.java.html#L90

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/918c1787f4bf07c673cecff7a50bd91d3224aa15_2025120649/reports/diff/checkstyle/xref/home/runner/work/checkstyle/checkstyle/.ci-temp/repositories/checkstyle/src/test/resources/com/puppycrawl/tools/checkstyle/checks/indentation/indentation/InputIndentationFromGuava.java.html#L21

and see if branch is fully covered after adding them

Copy link
Member

@mohitsatr mohitsatr left a comment

Choose a reason for hiding this comment

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

items:

@DakshRJain737
Copy link
Author

DakshRJain737 commented Oct 6, 2025

@mohitsatr 100% code coverage
I think the problem is with my src/test/resources/com/puppycrawl/tools/checkstyle/checks/whitespace/genericwhitespace/InputGenericWhitespace.java
bacause the line is too long
line 18
line 20 and
line 26

@DakshRJain737 DakshRJain737 force-pushed the fix-generic-tab-whitespace branch from eb481a2 to 020124d Compare October 7, 2025 08:18
@DakshRJain737 DakshRJain737 changed the title Fix GenericWhitespaceCheck to reject tabs after '>' Issue #17756: Fix GenericWhitespaceCheck to reject tabs after '>' Oct 7, 2025
@DakshRJain737 DakshRJain737 force-pushed the fix-generic-tab-whitespace branch from 020124d to 0582034 Compare October 7, 2025 08:43
@DakshRJain737
Copy link
Author

DakshRJain737 commented Oct 7, 2025

@mohitsatr sir 🙂
I am really sorry for troubling you so much.

@DakshRJain737
Copy link
Author

DakshRJain737 commented Oct 7, 2025

[ERROR] AdvancedNetworkAddressPicker.java:87:56: '>' is followed by an illegal character. [GenericWhitespace]
[ERROR] AdvancedNetworkAddressPicker.java:97:56: '>' is followed by an illegal character. [GenericWhitespace]
[ERROR] AdvancedNetworkAddressPicker.java:112:56: '>' is followed by an illegal character. [GenericWhitespace]
[ERROR] MapProxyImpl.java:826:22: '>' is followed by an illegal character. [GenericWhitespace]
[ERROR] TypedByteArrayDeserializer.java:26:46: '>' is followed by an illegal character. [GenericWhitespace]
[ERROR] TypedStreamDeserializer.java:28:43: '>' is followed by an illegal character. [GenericWhitespace]
[ERROR] ClientMapBasicTest.java:911:29: '>' is followed by an illegal character. [GenericWhitespace]

I just saw the hazelcast repo and the code in AdvancedNetworkAddressPicker.java:87:56: has multiple space after '>'.

@mohitsatr
Copy link
Member

mohitsatr commented Oct 9, 2025

I just saw the hazelcast repo and the code

Please raise a PR on their project, fixing the spaces in all these files and reference this PR in the description. Example: pgjdbc/pgjdbc#3682

@DakshRJain737
Copy link
Author

@mohitsatr Oh done I will do it by today
Btw there are two pitest issue I can see

@mohitsatr
Copy link
Member

I think something went wrong with pitest CI workflow itself. It did not fail last time. don't worry It is not failing because of your code.

@DakshRJain737
Copy link
Author

I think something went wrong with pitest CI workflow itself. It did not fail last time. don't worry It is not failing because of your code.

Ok I will resolve hazelcast issue by today

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.

2 participants