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

8318150: StaticProxySelector.select should not throw NullPointerExceptions #16199

Closed
wants to merge 3 commits into from

Conversation

djelinski
Copy link
Member

@djelinski djelinski commented Oct 16, 2023

ProxySelector.select and connectFailed methods should throw IllegalArgumentExceptions on null parameters.

Additionally, the select method doesn't need to be synchronized - the selector is immutable.

Tier2 green.


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 CSR request JDK-8318164 to be approved

Issues

  • JDK-8318150: StaticProxySelector.select should not throw NullPointerExceptions (Bug - P4)
  • JDK-8318164: StaticProxySelector.select should not throw NullPointerExceptions (CSR)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 16199

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 16, 2023

👋 Welcome back djelinski! 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 8318150 8318150: StaticProxySelector.select should not throw NullPointerExceptions Oct 16, 2023
@openjdk
Copy link

openjdk bot commented Oct 16, 2023

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

  • net

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 net net-dev@openjdk.org label Oct 16, 2023
@djelinski djelinski marked this pull request as ready for review October 16, 2023 10:05
@openjdk openjdk bot added the rfr Pull request is ready for review label Oct 16, 2023
@mlbridge
Copy link

mlbridge bot commented Oct 16, 2023

Webrevs

Copy link
Member

@jaikiran jaikiran left a comment

Choose a reason for hiding this comment

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

The change to the source and the migration of the test to junit looks fine to me.

@openjdk
Copy link

openjdk bot commented Oct 16, 2023

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

8318150: StaticProxySelector.select should not throw NullPointerExceptions

Reviewed-by: jpai, dfuchs

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

  • 9cf334f: 8318383: Remove duplicated checks in os::get_native_stack() in posix implementation
  • defc7e0: 8318454: TestLayoutPaths broken on Big Endian platforms after JDK-8317837
  • 3c70f2c: 8318418: hsdis build fails with system binutils on Ubuntu
  • 15acf4b: 8318324: Drop redundant default methods from FFM API
  • 1a09835: 8317358: G1: Make TestMaxNewSize use createTestJvm
  • 47bb1a1: 8318415: Adjust describing comment of os_getChildren after 8315026
  • 80bd22d: 8316144: Remove unused field jdk.internal.util.xml.impl.XMLStreamWriterImpl.Element._Depth
  • c0e154c: 8318089: Class space not marked as such with NMT when CDS is off
  • 24bc5bd: 8318104: macOS 10.13 check in TabButtonAccessibility.m can be removed
  • e25a49a: 8318471: ProblemList compiler/sharedstubs/SharedTrampolineTest.java
  • ... and 57 more: https://git.openjdk.org/jdk/compare/37aed6f46d19a48b7bceffde61b529a69a6abf54...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 Oct 16, 2023
@dfuch
Copy link
Member

dfuch commented Oct 16, 2023

/csr needed

@openjdk openjdk bot added the csr Pull request needs approved CSR before integration label Oct 16, 2023
@openjdk
Copy link

openjdk bot commented Oct 16, 2023

@dfuch has indicated that a compatibility and specification (CSR) request is needed for this pull request.

@djelinski please create a CSR request for issue JDK-8318150 with the correct fix version. This pull request cannot be integrated until the CSR request is approved.

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Oct 16, 2023
Copy link
Member

@dfuch dfuch left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me. I believe CSR and release notes would be warranted. Also it would be good to double check whether other implementations of ProxySelector - e.g. when using -Djava.net.useSystemProxies=true also respect the contract of throwing IAE in those cases. We can't check that with a non-regression test unfortunately (unless it's a manual test) - but some code inspection might reveal whether the contract is respected or not.

@djelinski
Copy link
Member Author

There are only 2 implementations of ProxySelector in the JDK, and they are both covered by this test. -Djava.net.useSystemProxies=true changes the behavior of DefaultProxySelector, but parameter validation code path is the same in both cases. I could add a separate @run line with -Djava.net.useSystemProxies=true, but in the current state it would just run the same code again.

Will post a CSR and a release note soon.

@dfuch
Copy link
Member

dfuch commented Oct 16, 2023

I could add a separate @run line with -Djava.net.useSystemProxies=true, but in the current state it would just run the same code again.

No need for that - and thanks for confirming that we have only two concrete implementations in the JDK and they now both behave in the same way.

@openjdk openjdk bot added ready Pull request is ready to be integrated and removed csr Pull request needs approved CSR before integration labels Oct 19, 2023
@djelinski
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented Oct 20, 2023

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

  • c46a54e: 8312777: notifyJvmtiMount before notifyJvmtiUnmount
  • 8f5f440: 8317692: jcmd GC.heap_dump performance regression after JDK-8292818
  • 684b91e: 8315064: j.text.ChoiceFormat provides no specification on quoting behavior
  • 1740950: 8314901: AES-GCM interleaved implementation using AVX2 instructions
  • cc8f8da: 8318322: Update IANA Language Subtag Registry to Version 2023-10-16
  • 599560a: 8317635: Improve GetClassFields test to verify correctness of field order
  • 9cf334f: 8318383: Remove duplicated checks in os::get_native_stack() in posix implementation
  • defc7e0: 8318454: TestLayoutPaths broken on Big Endian platforms after JDK-8317837
  • 3c70f2c: 8318418: hsdis build fails with system binutils on Ubuntu
  • 15acf4b: 8318324: Drop redundant default methods from FFM API
  • ... and 63 more: https://git.openjdk.org/jdk/compare/37aed6f46d19a48b7bceffde61b529a69a6abf54...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Oct 20, 2023

@djelinski Pushed as commit d9ce525.

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

@djelinski djelinski deleted the staticproxyselector branch October 20, 2023 06:18
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 net net-dev@openjdk.org
4 participants