-
Notifications
You must be signed in to change notification settings - Fork 5.9k
8358066: Non-ascii package names gives compilation error "import requires canonical name" #25567
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
base: master
Are you sure you want to change the base?
Conversation
👋 Welcome back acobbs! A progress list of the required criteria for merging this PR into |
@archiecobbs This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 73 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
@archiecobbs The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
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.
Overall, looks sensible. Comments for consideration inline.
public static void main(String[] args) { | ||
|
||
// This is the string "ab«cd≤ef🟢gh" | ||
String s = "ab\u00ABcd\u2264ef\ud83d\udd34gh"; |
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.
Nit: not sure if there's a strong reason to use escapes in the string literal, esp. given the Unicode characters are used in the comment above. Given #24574 is integrated, I would say, use UTF-8 in the string literal, and drop the comment?
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.
I was aware of that recent change, but I don't understand the testing mechanics well enough to verify that -encoding utf-8
is being added to the regression test compilation step on every possible platform (and wouldn't that be a jtreg thing, not an openjdk thing?)
So I was playing it safe, but if you say it's OK to assume compilation is always being done with -encoding utf-8
then I'll take your word for it :)
src/jdk.compiler/share/classes/com/sun/tools/javac/util/Convert.java
Outdated
Show resolved
Hide resolved
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.
Looks good to me. (I didn't run tests, please ask if you would want me to run them.)
Thanks for the review! Re: tests, to be honest I'm not sure what criteria to use to determine that. This change seems pretty innocuous but "seems" is a dangerous word. I'm happy to follow your advice on this... ? Thanks. |
For what it's worth: I reported the issue, and the test I wrote - splitting a UTF-8 import statement into a list of package-parts and classname using lastIndexOfAscii('.') and utfNumChars - now works fine. |
I've started a test run, the results will hopefully be tomorrow (my time, CEST). I think we should wait with the integration before they run. Alternatively you could issue |
Sounds great - thanks. |
Just a drive-by comment, but should we check the validity of |
Good question. This method is explicitly documented as assuming that the data is valid UTF-8. It's not trying to handle invalid data. |
I meant the validity of |
Well I guess to be more specific the method assumes that the given range of bytes is valid UTF-8. But yes you are right, this could all be better (more precisely) documented. That's for another PR though, I am loath to further delay this one at this point since it's already approved and the JDK 25 lop off happens tomorrow. |
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.
That's for another PR though, I am loath to further delay this one at this point since it's already approved and the JDK 25 lop off happens tomorrow
Totally fine by me
Tests (tier1-3) passed, so OK to integrate, I think. Thanks! |
A simple counting bug in
Convert.utfNumChars()
causes bogus compiler errors forimport
statements of non-ASCII class names when the compiler is configured to use one of the older UTF-8 basedName
table implementations (e.g., by specifying the-XDuseUnsharedTable=true
flag).Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/25567/head:pull/25567
$ git checkout pull/25567
Update a local copy of the PR:
$ git checkout pull/25567
$ git pull https://git.openjdk.org/jdk.git pull/25567/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 25567
View PR using the GUI difftool:
$ git pr show -t 25567
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/25567.diff
Using Webrev
Link to Webrev Comment