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

JDK-8274639: Provide a way to disable warnings for cross-modular links #5900

Closed
wants to merge 5 commits into from

Conversation

hns
Copy link
Member

@hns hns commented Oct 11, 2021

This is a simple change to add a new --link-modularity-mismatch (warn|info) command line option to allow messages about wrong modularity of externally linked documentation bundles to be issued as warnings or notices.

CSR: https://bugs.openjdk.java.net/browse/JDK-8274969


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issues

  • JDK-8274639: Provide a way to disable warnings for cross-modular links
  • JDK-8274969: Javadoc option to disable warnings for cross-modular links (CSR) ⚠️ Issue is not open.

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/5900/head:pull/5900
$ git checkout pull/5900

Update a local copy of the PR:
$ git checkout pull/5900
$ git pull https://git.openjdk.java.net/jdk pull/5900/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 5900

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/5900.diff

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Oct 11, 2021

👋 Welcome back hannesw! 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 label Oct 11, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Oct 11, 2021

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

  • javadoc

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 javadoc label Oct 11, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Oct 11, 2021

Webrevs

@hns
Copy link
Member Author

@hns hns commented Oct 14, 2021

/csr

@openjdk openjdk bot added the csr label Oct 14, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Oct 14, 2021

@hns this pull request will not be integrated until the CSR request JDK-8274969 for issue JDK-8274639 has been approved.

Copy link
Contributor

@jonathan-gibbons jonathan-gibbons left a comment

It's OK, but I think it would be better off using a enum rather than a boolean to control the diagnostic generation.

* Argument for command-line option {@code --link-modularity-mismatch}.
* True if warnings on external documentation with non-matching modularity should be omitted.
*/
private boolean linkModularityNoWarning = false;
Copy link
Contributor

@jonathan-gibbons jonathan-gibbons Nov 8, 2021

Choose a reason for hiding this comment

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

Would it be better to use a local enum that matches the option values?

Copy link
Member Author

@hns hns Nov 10, 2021

Choose a reason for hiding this comment

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

I introduced an enum, I agree it's an improvement. Hope you are ok with the naming.

@openjdk openjdk bot removed the csr label Nov 10, 2021
Copy link
Contributor

@jonathan-gibbons jonathan-gibbons left a comment

Minor naming suggestions, but generally approved.

Report external documentation with wrong modularity as either\n\
warning or informational message. The default behaviour is to\n\
Copy link
Contributor

@jonathan-gibbons jonathan-gibbons Dec 1, 2021

Choose a reason for hiding this comment

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

suggest:

Report external documentation with wrong modularity with either\n
a warning or informational message.

(change "as" to "with"; add "a" before "warning")

public enum ModularityMismatchPolicy {
info,
warn
}
Copy link
Contributor

@jonathan-gibbons jonathan-gibbons Dec 1, 2021

Choose a reason for hiding this comment

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

enum name is good; constants could be upper case?

public boolean process(String opt, List<String> args) {
String s = args.get(0);
switch (s) {
case "warn", "info" -> linkModularityMismatch = ModularityMismatchPolicy.valueOf(s);
Copy link
Contributor

@jonathan-gibbons jonathan-gibbons Dec 1, 2021

Choose a reason for hiding this comment

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

If the constants were upper case, you could use s.toUpperCase(Locale.ROOT)

@openjdk
Copy link

@openjdk openjdk bot commented Dec 1, 2021

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

8274639: Provide a way to disable warnings for cross-modular links

Reviewed-by: jjg

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

  • 088b244: 8251216: Implement MD5 intrinsics on AArch64
  • a093cdd: 8276657: XSLT compiler tries to define a class with empty name
  • 8198807: 8266435: WBMPImageReader.read() should not truncate the input stream
  • b226ab9: 8276141: XPathFactory set/getProperty method
  • 09522db: 8277647: [REDO] JDK-8277507 Add jlink.debug system property while launching jpackage tests to help diagonize recent intermittent failures
  • 67745fa: 8276299: G1: Unify the wording buffer/node/element in G1SegmentedArrayXxx, G1CardSetXxx and related classes
  • 51d6d7a: 8266839: Enable pandoc on macosx-aarch64 at Oracle
  • 0dfb3a7: 8268582: javadoc throws NPE with --ignore-source-errors option
  • f41e768: 8277762: Allow configuration of HOTSPOT_BUILD_USER
  • a363b7b: 8177819: DateTimeFormatterBuilder zone parsing should recognise DST
  • ... and 772 more: https://git.openjdk.java.net/jdk/compare/c05dc268acaf87236f30cf700ea3ac778e3b20e5...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 label Dec 1, 2021
@hns
Copy link
Member Author

@hns hns commented Dec 2, 2021

/integrate

@openjdk
Copy link

@openjdk openjdk bot commented Dec 2, 2021

Going to push as commit 103da8f.
Since your change was applied there have been 782 commits pushed to the master branch:

  • 088b244: 8251216: Implement MD5 intrinsics on AArch64
  • a093cdd: 8276657: XSLT compiler tries to define a class with empty name
  • 8198807: 8266435: WBMPImageReader.read() should not truncate the input stream
  • b226ab9: 8276141: XPathFactory set/getProperty method
  • 09522db: 8277647: [REDO] JDK-8277507 Add jlink.debug system property while launching jpackage tests to help diagonize recent intermittent failures
  • 67745fa: 8276299: G1: Unify the wording buffer/node/element in G1SegmentedArrayXxx, G1CardSetXxx and related classes
  • 51d6d7a: 8266839: Enable pandoc on macosx-aarch64 at Oracle
  • 0dfb3a7: 8268582: javadoc throws NPE with --ignore-source-errors option
  • f41e768: 8277762: Allow configuration of HOTSPOT_BUILD_USER
  • a363b7b: 8177819: DateTimeFormatterBuilder zone parsing should recognise DST
  • ... and 772 more: https://git.openjdk.java.net/jdk/compare/c05dc268acaf87236f30cf700ea3ac778e3b20e5...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Dec 2, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Dec 2, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Dec 2, 2021

@hns Pushed as commit 103da8f.

💡 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
integrated javadoc
2 participants