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-8314975: JavadocTester should set source path if not specified #15424

Conversation

jonathan-gibbons
Copy link
Contributor

@jonathan-gibbons jonathan-gibbons commented Aug 25, 2023

Please review a test-only fix, for JavadocTester, to set the source path to a sensible value if none specified explicitly, to override the tool default to use the class path.

The underlying issue is that TestNG is on the class path, and contains a file Version.java in the root directory -- i.e. the unnamed package. This can interfere with various tests that use classes in the unnamed package.

The fix is to set the source path to testSrc, so that testng.jar is never on the source path.


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-8314975: JavadocTester should set source path if not specified (Bug - P3)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 15424

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Aug 25, 2023

👋 Welcome back jjg! 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 Aug 25, 2023
@openjdk
Copy link

openjdk bot commented Aug 25, 2023

@jonathan-gibbons 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 javadoc-dev@openjdk.org label Aug 25, 2023
@mlbridge
Copy link

mlbridge bot commented Aug 25, 2023

Webrevs

@pavelrappo
Copy link
Member

I understand why you are doing it, but I wonder if it is possible to do it in a better way. If this is integrated, tests that use JavadocTester will always specify -sourcepath. That won't be clean and will likely cause suprises down the road.

@hns
Copy link
Member

hns commented Aug 28, 2023

I understand why you are doing it, but I wonder if it is possible to do it in a better way. If this is integrated, tests that use JavadocTester will always specify -sourcepath. That won't be clean and will likely cause suprises down the road.

As comments in the related JBS issues show, javadoc will always look for the sources somewhere. Using testSrc as explicit default seems preferable to the implicit default class path.

@jonathan-gibbons
Copy link
Contributor Author

I understand why you are doing it, but I wonder if it is possible to do it in a better way. If this is integrated, tests that use JavadocTester will always specify -sourcepath. That won't be clean and will likely cause suprises down the road.

To clarify what I think you mean: tests that use JavaDocTester will have some suitable source path is set for the underlying invocation of javadoc, either implicit (to testSrc) or explicit (given as args to the javadoc call.)

To me, that is cleaner than letting the source path default to the class path and whatever is on that.

The only time this will be an issue is if we want to specifically test javadoc behavior when the source path is not set explicitly. That would be a very small minority of tests, in test/langtools/jdk/javadoc/tool, and for any such tests, there are other convenient ways to invoke javadoc without going through JavadocTester, such as toolbox.JavadocTask.

If it was seen to be really important, we could set a flag on JavadocTester to override the proposed behavior to always set a sensible value, but so far I'm not seeing the use case. If we were to do that, any tests using the feature would probably have to ensure a sensible value is set for the class path (that being the default value for the source path, if that is not set.)

@openjdk
Copy link

openjdk bot commented Sep 15, 2023

@jonathan-gibbons 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:

8314975: JavadocTester should set source path if not specified

Reviewed-by: hannesw

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

  • 8dfde28: 8315485: (fs) Move java/nio/file/Path/Misc.java tests into java/nio/file/Path/PathOps.java
  • 3c743cf: 8312126: NullPointerException in CertStore.getCRLs after 8297955
  • bd26813: 8316295: Serial: Remove empty Generation::promotion_failure_occurred
  • 42dc6b5: 8316182: RISC-V: SA stack walking code having trouble finding sender frame when invoking LambdaForms is involved
  • 31c4e03: 8314551: More generic way to handshake GC threads with monitor deflation
  • 89cb290: 8312165: Fix typos in java.desktop Swing
  • 25f32f3: 8316160: Remove sun.misc.Unsafe.{shouldBeInitialized,ensureClassInitialized}
  • 86dde5e: 8316001: GC: Make TestArrayAllocatorMallocLimit use createTestJvm
  • 4f864fa: 8314136: Test java/net/httpclient/CancelRequestTest.java failed: WARNING: tracker for HttpClientImpl(42) has outstanding operations
  • 4070829: 8315931: RISC-V: xxxMaxVectorTestsSmokeTest fails when using RVV
  • ... and 270 more: https://git.openjdk.org/jdk/compare/2624324ac216aadc938a870075f6fad287fedf05...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 Sep 15, 2023
@bridgekeeper
Copy link

bridgekeeper bot commented Oct 13, 2023

@jonathan-gibbons This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@jonathan-gibbons
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Oct 17, 2023

Going to push as commit 2f4d601.
Since your change was applied there have been 692 commits pushed to the master branch:

  • 0ba48ef: 8316972: Add javadoc support for restricted methods
  • 5145e5a: 8318328: DHKEM should check XDH name in case-insensitive mode
  • c566dfc: 8317600: VtableStubs::stub_containing() table load not ordered wrt to stores
  • c998572: 8316959: Improve InlineCacheBuffer pending queue management
  • d667903: 8316462: sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.java ignores VM flags
  • 61cc4a0: 8311538: CDS InternSharedString test fails on huge pages host - cannot find shared string
  • 39e2b7a: 8318295: Update launcher help for enable-native-access
  • d0ea2a5: 8318015: Lock inflation not needed for OSR or Deopt for new locking modes
  • 6aa837e: 8316927: JFR: Move shouldCommit check earlier for socket events
  • 5ca1beb: 8317300: javac erroneously allows "final" in front of a record pattern
  • ... and 682 more: https://git.openjdk.org/jdk/compare/2624324ac216aadc938a870075f6fad287fedf05...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Oct 17, 2023

@jonathan-gibbons Pushed as commit 2f4d601.

💡 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 Pull request has been integrated javadoc javadoc-dev@openjdk.org
3 participants