Skip to content
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

8289689: (fs) Re-examine the need for normalization to Unicode Normalization Format D (macOS) #10885

Closed

Conversation

bplb
Copy link
Member

@bplb bplb commented Oct 27, 2022

On macOS, perform file name normalization if and only if a specific system property is set.


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
  • Change requires a CSR request to be approved

Issues

  • JDK-8289689: (fs) Re-examine the need for normalization to Unicode Normalization Format D (macOS)
  • JDK-8296141: (fs) Re-examine the need for normalization to Unicode Normalization Format D (macOS) (CSR)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 10885

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

Using diff file

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

@bplb
Copy link
Member Author

bplb commented Oct 27, 2022

If the need for the new property is accepted, then a CSR will be filed.

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 27, 2022

👋 Welcome back bpb! 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 added the rfr Pull request is ready for review label Oct 27, 2022
@openjdk
Copy link

openjdk bot commented Oct 27, 2022

@bplb The following label will be automatically applied to this pull request:

  • nio

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.

@openjdk openjdk bot added the nio nio-dev@openjdk.org label Oct 27, 2022
@mlbridge
Copy link

mlbridge bot commented Oct 27, 2022

Webrevs


static {
final String name = PROPERTY_ENABLE_FILE_NAME_ENCODING;
String value = GetPropertyAction.privilegedGetProperty(name);
Copy link
Member

Choose a reason for hiding this comment

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

Can we use sun.security.action.GetBooleanAction#privilegedGetProperty instead?

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use sun.security.action.GetBooleanAction#privilegedGetProperty instead?

That is problematic for the case that a value is empty, as in -Djdk.nio.path.useNormalizationFormD.

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure I understand. What the problem with empty value exactly?

Copy link
Contributor

Choose a reason for hiding this comment

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

There are 4 cases:
jdk.nio.path.useNormalizationFormD not set
-Djdk.nio.path.useNormalizationFormD
-Djdk.nio.path.useNormalizationFormD=true or a case variant
-Djdk.nio.path.useNormalizationFormD=false or a case variant
The second and third should enable the normalisation. This will do it

    NORMALIZE_FILE_PATHS = (value != null)
                && ("".equals(value) || Boolean.parseBoolean(value));

Copy link
Member

@turbanoff turbanoff Oct 31, 2022

Choose a reason for hiding this comment

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

The second and third should enable the normalisation.

Is it convention for all JDK system properties?
Then I don't understand why GetBooleanAction.privilegedGetProperty doesn't have exactly the same logic as you propose.
Perhaps another helper method could be introduced?

Copy link
Contributor

Choose a reason for hiding this comment

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

Is it convention for all JDK system properties? Then I don't understand why privilegedGetProperty doesn't have exactly the same logic as you propose. Perhaps another helper method could be introduced?

It comes up quite often. Ideally privilegedGetProperty would have another parameter to indicate the default when the value is empty.

@openjdk openjdk bot added the csr Pull request needs approved CSR before integration label Oct 31, 2022
@jaikiran
Copy link
Member

jaikiran commented Nov 2, 2022

Thank you for that change in the test, Brian. The test looks fine to me. The source change looks fine too, but I don't have enough knowledge of it.

@jaikiran
Copy link
Member

jaikiran commented Nov 2, 2022

On a related note, have we tested this change on a macos version < 10.13 just to be sure that the command line flag does indeed allow to revert back to old behaviour on those setups?

@@ -35,6 +36,17 @@

class MacOSXFileSystem extends BsdFileSystem {

private static final String PROPERTY_ENABLE_FILE_NAME_ENCODING =
"jdk.nio.path.useNormalizationFormD";
Copy link
Member

Choose a reason for hiding this comment

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

Do we document system properties like this one in some javadoc through the use of @systemProperty so that it shows up in the documentation? Or is it OK to just have this mentioned in the release notes?

@openjdk openjdk bot removed the csr Pull request needs approved CSR before integration label Nov 3, 2022
@openjdk
Copy link

openjdk bot commented Nov 3, 2022

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

8289689: (fs) Re-examine the need for normalization to Unicode Normalization Format D (macOS)

Reviewed-by: jpai, alanb

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

  • 13b20e0: 8296262: Remove dead code from InstanceKlass::signature_name()
  • fd60036: 8296188: Update style and header in JDWP Protocol spec and JVMTI spec
  • c7b95a8: 8296163: [aarch64] Cleanup Pre/Post addressing mode classes
  • f84b0ad: 8295670: Remove duplication in java/util/Formatter/Basic*.java
  • a124d8e: 8296115: Allow for compiling the JDK with strict standards conformance
  • 491d43c: 8289838: ZGC: OOM before clearing all SoftReferences
  • a1c349f: 8290063: IGV: Give the graphs a unique number in the outline
  • b807470: 8296235: IGV: Change shortcut to delete graph from ctrl+del to del
  • e15d241: 8295991: java/net/httpclient/CancelRequestTest.java fails intermittently
  • 16a041a: 8296142: CertAttrSet::(getName|getElements|delete) are mostly useless
  • ... and 52 more: https://git.openjdk.org/jdk/compare/a8450b37ee6ea83c5354ba0892ac71df19e5a1cc...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 Nov 3, 2022
@bplb
Copy link
Member Author

bplb commented Nov 3, 2022

/integrate

@openjdk
Copy link

openjdk bot commented Nov 3, 2022

Going to push as commit 25dfcbd.
Since your change was applied there have been 70 commits pushed to the master branch:

  • b7442d1: 8295653: Add a graph of the sealed class hierarchy for marked classes
  • 59a13b1: 8295872: [PPC64] JfrGetCallTrace: Need pc == nullptr check before frame constructor
  • 2a79dfc: 8295774: Write a test to verify List sends ItemEvent/ActionEvent
  • cc3c5a1: 8296101: nmethod::is_unloading result unstable with concurrent unloading
  • d771abb: 8295970: Add vector api sanity tests in tier1
  • 7a85441: 8232933: Javac inferred type does not conform to equality constraint
  • 6ee8ccf: 8296168: x86: Add reasonable constraints between AVX and SSE
  • 1950747: 8279913: obsolete ExtendedDTraceProbes
  • 13b20e0: 8296262: Remove dead code from InstanceKlass::signature_name()
  • fd60036: 8296188: Update style and header in JDWP Protocol spec and JVMTI spec
  • ... and 60 more: https://git.openjdk.org/jdk/compare/a8450b37ee6ea83c5354ba0892ac71df19e5a1cc...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Nov 3, 2022

@bplb Pushed as commit 25dfcbd.

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

@bplb bplb deleted the MacOSXFileSystem-normalizePath-8289689 branch November 3, 2022 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated nio nio-dev@openjdk.org
4 participants