Skip to content

8308046: Move Solaris related charsets from java.base to jdk.charsets module #13973

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

Closed
wants to merge 3 commits into from

Conversation

takiguc
Copy link

@takiguc takiguc commented May 15, 2023

According to "JDK 20 Internationalization Guide"
https://docs.oracle.com/en/java/javase/20/intl/supported-encodings.html
Following Solaris related charsets are in "contained in jdk.charsets module" list.

  • PCK (x-PCK)
  • EUC_JP_Solaris (x-eucJP-Open)
  • Big5_Solaris (x-Big5-Solaris)

These are not supported by Linux platform, so they should not be in java.base module.

Note:
GHA Linux x86 builds were failed.
I think it's not related by my modified code.
I opened JDK-8308051 GHA: Linux x86 builds failure


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8308046: Move Solaris related charsets from java.base to jdk.charsets module

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/13973/head:pull/13973
$ git checkout pull/13973

Update a local copy of the PR:
$ git checkout pull/13973
$ git pull https://git.openjdk.org/jdk.git pull/13973/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 13973

View PR using the GUI difftool:
$ git pr show -t 13973

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/13973.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented May 15, 2023

👋 Welcome back itakiguchi! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot changed the title 8308046: Move Solaris related Japanese charsets from java.base to jdk.charsets module 8308046: Move Solaris related Japanese charsets from java.base to jdk.charsets module May 15, 2023
@openjdk
Copy link

openjdk bot commented May 15, 2023

@takiguc The following labels will be automatically applied to this pull request:

  • build
  • i18n

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added build build-dev@openjdk.org i18n i18n-dev@openjdk.org labels May 15, 2023
@takiguc
Copy link
Author

takiguc commented May 15, 2023

/label remove build

@openjdk openjdk bot removed the build build-dev@openjdk.org label May 15, 2023
@openjdk
Copy link

openjdk bot commented May 15, 2023

@takiguc
The build label was successfully removed.

@takiguc takiguc marked this pull request as ready for review May 15, 2023 02:50
@openjdk openjdk bot added the rfr Pull request is ready for review label May 15, 2023
@mlbridge
Copy link

mlbridge bot commented May 15, 2023

Webrevs

@naotoj
Copy link
Member

naotoj commented May 15, 2023

Hi @takiguc,
I'd expect this change not specific to Japanese, but to all such as Big-5. BTW, I am thinking of removing Charsets for Solaris (8308117)

@naotoj
Copy link
Member

naotoj commented May 15, 2023

/label add core-libs

@openjdk openjdk bot added the core-libs core-libs-dev@openjdk.org label May 15, 2023
@openjdk
Copy link

openjdk bot commented May 15, 2023

@naotoj
The core-libs label was successfully added.

@naotoj
Copy link
Member

naotoj commented May 16, 2023

I now think it is better simply removing Solaris-related charsets, as moving them from java.base to jdk.charsets would require unnecessary code changes in non-Solaris code.

@takiguc
Copy link
Author

takiguc commented May 17, 2023

Hello @naotoj .
I'm not sure we can remove Solaris related charsets.
Somebody may use them for text communication between Solaris.
The latest change can move Big5_Solaris from java.base to jdk.charsets module.

@naotoj
Copy link
Member

naotoj commented May 17, 2023

Hello @naotoj . I'm not sure we can remove Solaris related charsets. Somebody may use them for text communication between Solaris.

OK, maybe not now.

I think the fix may be simplified by changing access for those DoubleByte-X.java.template internals, such as DecodeHolder to public, instead of introducing those access methods. You can import classes in java.base/sun.nio.cs with the wild card so that it would work on all platforms (Big5 either in java.base or jdk.charsets)

Also, please drop Japanese from the issue/PR title

Comment on lines 66 to 71
private static final SingleByte.Decoder DEC0201 =
(SingleByte.Decoder)new JIS_X_0201().newDecoder();

private static final DoubleByte.Decoder DEC0208 =
(DoubleByte.Decoder)new JIS_X_0208().newDecoder();

Copy link
Member

Choose a reason for hiding this comment

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

Can these also be removed, by making those original ones in EUC_JP public?

@takiguc takiguc changed the title 8308046: Move Solaris related Japanese charsets from java.base to jdk.charsets module 8308046: Move Solaris related charsets from java.base to jdk.charsets module May 18, 2023
@naotoj
Copy link
Member

naotoj commented May 18, 2023

You can import classes in java.base/sun.nio.cs with the wild card so that it would work on all platforms (Big5 either in java.base or jdk.charsets)

Scratch that, you've already did it. Then you can remove these:

import sun.nio.cs.DoubleByte;
import sun.nio.cs.HistoricallyNamedCharset;

@takiguc
Copy link
Author

takiguc commented May 20, 2023

Hello @naotoj .
I'd like to confirm about DoubleByte-X.java.template and EUC_JP.java.template.
I think the values are package-private.
Even if class is changed to public, the classes insun.nio.cs.ext package could not access to these values in sun.nio.cs package...
I may be misunderstanding your suggestion, could you tell me more ?

@naotoj
Copy link
Member

naotoj commented May 20, 2023

I think the values are package-private. Even if class is changed to public, the classes insun.nio.cs.ext package could not access to these values in sun.nio.cs package...

I meant making those package-private fields public. I believe it's OK because java.base/sun.nio.cs package is only exported to jdk.charsets module.

@takiguc
Copy link
Author

takiguc commented May 22, 2023

Thanks @naotoj .
I changed related fields to public.

Copy link
Member

@naotoj naotoj left a comment

Choose a reason for hiding this comment

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

Looks good. I think you may want to change stdcs-aix as well.
As to the JBS issue, please change the title to match the PR title, and add noreg-cleanup label

@takiguc
Copy link
Author

takiguc commented May 23, 2023

Hello @naotoj .
I appreciate your attention about JBS side.
I changed title and description, add noreg-cleanup label.

@openjdk
Copy link

openjdk bot commented May 23, 2023

@takiguc 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:

8308046: Move Solaris related charsets from java.base to jdk.charsets module

Reviewed-by: naoto

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 116 new commits pushed to the master branch:

  • 878162b: 8306507: [linux] Print number of memory mappings in error reports
  • 90d5041: 8300086: Replace NULL with nullptr in share/c1/
  • 8474e69: 8308465: Reduce memory accesses in AArch64 MD5 intrinsic
  • f99ad11: 8302218: CHeapBitMap::free frees with incorrect size
  • d77a410: 8308388: Update description of SourceVersion.RELEASE_21
  • 3f4cfbd: 8307190: Refactor ref_at methods in Constant Pool
  • 491bdea: 8308458: Windows build failure with disassembler.cpp(792): warning C4267: '=': conversion from 'size_t' to 'int'
  • b58980b: 8308034: Some CDS tests need to use @requires vm.flagless
  • 29b8d3d: 8307573: Implementation of JEP 449: Deprecate the Windows 32-bit x86 Port for Removal
  • 5fc9b57: 8308276: Change layout API to work with bytes, not bits
  • ... and 106 more: https://git.openjdk.org/jdk/compare/646747fd7c7320910eed682ae6da3cd4c60a51a5...master

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 master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label May 23, 2023
@takiguc
Copy link
Author

takiguc commented May 23, 2023

/integrate

@openjdk
Copy link

openjdk bot commented May 23, 2023

Going to push as commit 5d8ba93.
Since your change was applied there have been 116 commits pushed to the master branch:

  • 878162b: 8306507: [linux] Print number of memory mappings in error reports
  • 90d5041: 8300086: Replace NULL with nullptr in share/c1/
  • 8474e69: 8308465: Reduce memory accesses in AArch64 MD5 intrinsic
  • f99ad11: 8302218: CHeapBitMap::free frees with incorrect size
  • d77a410: 8308388: Update description of SourceVersion.RELEASE_21
  • 3f4cfbd: 8307190: Refactor ref_at methods in Constant Pool
  • 491bdea: 8308458: Windows build failure with disassembler.cpp(792): warning C4267: '=': conversion from 'size_t' to 'int'
  • b58980b: 8308034: Some CDS tests need to use @requires vm.flagless
  • 29b8d3d: 8307573: Implementation of JEP 449: Deprecate the Windows 32-bit x86 Port for Removal
  • 5fc9b57: 8308276: Change layout API to work with bytes, not bits
  • ... and 106 more: https://git.openjdk.org/jdk/compare/646747fd7c7320910eed682ae6da3cd4c60a51a5...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label May 23, 2023
@openjdk openjdk bot closed this May 23, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels May 23, 2023
@openjdk
Copy link

openjdk bot commented May 23, 2023

@takiguc Pushed as commit 5d8ba93.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs core-libs-dev@openjdk.org i18n i18n-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

2 participants