-
Notifications
You must be signed in to change notification settings - Fork 98
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
CompactFormatter precision and surrogate pairs #528
Labels
Comments
jmehrens
added a commit
to jmehrens/mail
that referenced
this issue
Mar 27, 2021
Signed-off-by: jmehrens <jason_mehrens@hotmail.com>
jmehrens
added a commit
to jmehrens/mail
that referenced
this issue
Mar 29, 2021
Signed-off-by: jmehrens <jason_mehrens@hotmail.com> (cherry picked from commit 16d423d)
jmehrens
added a commit
to jmehrens/mail
that referenced
this issue
Mar 29, 2021
Signed-off-by: jmehrens <jason_mehrens@hotmail.com>
lukasj
pushed a commit
that referenced
this issue
Apr 7, 2021
lukasj
pushed a commit
that referenced
this issue
Apr 7, 2021
Committed to 2.0.2-SNAPSHOT and 1.6.7-SNAPSHOT |
bvfalcon
pushed a commit
to bvfalcon/jakarta-mail
that referenced
this issue
Aug 8, 2022
…ee#543) Signed-off-by: jmehrens <jason_mehrens@hotmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Working on improving the code coverage for the CompactFormatter I noticed that the logic for handling precision can bisect a supplementary character.
The faulty code is here:
https://github.com/eclipse-ee4j/mail/blob/226d2d6f1db283042537fa9a30dfab798649fea2/mail/src/main/java/com/sun/mail/util/logging/CompactFormatter.java#L812
In its current form, the code is just dead code that could produce a garbage character. The good news is that java.util.Formatter doesn't handle supplementary characters either. See: java.util.Fomatter precision and surrogate pairs. This means that for all argument indexes precision will bisect in the same manor. Since the default format is using CompactFormatter$Alternate with a precision, supplementary characters should be handled correctly.
Need to write up tests to ensure that all CompactFormatter$Alternate parameters don't bisect supplementary characters.
In general the change is roughly:
The text was updated successfully, but these errors were encountered: