-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Fix escaped char pattern in AvoidEscapedUnicodeCharactersCheck #9314
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
Conversation
…CharactersCheck
559c606
to
17fdba3
Compare
Github, generate report |
src/main/java/com/puppycrawl/tools/checkstyle/checks/AvoidEscapedUnicodeCharactersCheck.java
Show resolved
Hide resolved
…CharactersCheck
17fdba3
to
f5b9257
Compare
+ "(00[0-1][0-9A-Fa-f]" | ||
+ "|00[8-9][0-9A-Fa-f]" | ||
private static final Pattern UNICODE_CONTROL = Pattern.compile("\\\\u+" | ||
+ "(00[0189][0-9A-Fa-f]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small simplification
…CharactersCheck
f5b9257
to
c2699f2
Compare
Github, generate report |
GitHub, generate report |
Report generation job failed on phase , step . |
Openjdk report failed by timeout (job was interrupted after 6 hours), but for other reps looks ok. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to place example of problem in PR description in format we demand for issues. As main code is changed, it is bug.
Small item before merge:
src/main/java/com/puppycrawl/tools/checkstyle/checks/AvoidEscapedUnicodeCharactersCheck.java
Show resolved
Hide resolved
…CharactersCheck
AvoidEscapedUnicodeCharactersCheck pattern for escaped chars is a bit incorrect.
According to JLS char 'u' can be repeated many times, and it is still valid escape.
Note: pattern for whitespace escapes was not updated - it is causing sonar violation that require big refactoring of regex and tests.
Diff Regression config: https://gist.githubusercontent.com/strkkk/31749e0743553a606f69fdfc6670d780/raw/2031b8f52d40c522c5cd8c343ff2c8af476082d7/confg.xml
Diff Regression projects: https://gist.githubusercontent.com/strkkk/29c0f3a0ce06a681afdf8d3c417a4b30/raw/f2771cee1ba63f0236377c2b55b77a2fb1fe45e0/small_projects
Report label: only jdk9