Skip to content

JDK-8300222: Replace NULL with nullptr in share/logging #12014

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 1 commit into from

Conversation

jdksjolen
Copy link
Contributor

@jdksjolen jdksjolen commented Jan 16, 2023

Do the conversion in the share/logging sub-directory and all of its files.


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-8300222: Replace NULL with nullptr in share/logging

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 12014

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 16, 2023

👋 Welcome back jsjolen! 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
Copy link

openjdk bot commented Jan 16, 2023

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

  • hotspot-runtime

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 hotspot-runtime hotspot-runtime-dev@openjdk.org label Jan 16, 2023
@jdksjolen jdksjolen changed the title Replace NULL with nullptr in share/logging JDK-8300222: Replace NULL with nullptr in share/logging Jan 17, 2023
@jdksjolen jdksjolen marked this pull request as ready for review January 17, 2023 11:37
@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 17, 2023
@mlbridge
Copy link

mlbridge bot commented Jan 17, 2023

Webrevs

Copy link
Contributor

@coleenp coleenp left a comment

Choose a reason for hiding this comment

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

Scrolled through can confirm only trivial change. I had one question.

char buffer[1024];
if (os::get_host_name(buffer, sizeof(buffer))) {
host_name = os::strdup_check_oom(buffer);
const char* old_value = Atomic::cmpxchg(&_host_name, (const char*)NULL, host_name);
if (old_value != NULL) {
const char* old_value = Atomic::cmpxchg(&_host_name, (const char*)nullptr, host_name);
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if you need this cast with nullptr ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The nullptr argument is templated, so we do need the cast.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for checking. I won't ask on the next one. :)

Choose a reason for hiding this comment

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

I'd like to add overloads for std::nullptr_t someday.

@openjdk
Copy link

openjdk bot commented Jan 17, 2023

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

8300222: Replace NULL with nullptr in share/logging

Reviewed-by: coleenp, dholmes

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

  • f1194dc: 8300109: RISC-V: Improve code generation for MinI/MaxI nodes
  • 89a032d: 8300002: Performance regression caused by non-inlined hot methods due to post call noop instructions
  • 7071397: 8299224: TestReporterStreams.java has bad indentation for legal header
  • 1d8b87d: 8300321: Use link tags in javax.sql.rowset package-info
  • f9883fc: 8300279: Use generalized see and link tags in core libs in client libs
  • 00b6c55: 8300254: ASan build does not correctly propagate ASAN_OPTIONS
  • e37078f: 8282664: Unroll by hand StringUTF16 and StringLatin1 polynomial hash loops
  • ade08e1: 8300093: Refactor code examples to use @snippet in java.text.MessageFormat
  • d7c05d1: 8300011: Refactor code examples to use @snippet in java.util.TimeZone
  • 8c12ae8: 8283203: Fix typo in SystemTray.getTrayIconSize javadoc
  • ... and 230 more: https://git.openjdk.org/jdk/compare/11fd651ab1820770e3c65cd49589416098987a87...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 Jan 17, 2023
Copy link
Member

@dholmes-ora dholmes-ora 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. Thanks.

@@ -192,10 +192,10 @@ void AsyncLogWriter::initialize() {
AsyncLogWriter* self = new AsyncLogWriter();
if (self->_initialized) {
Atomic::release_store_fence(&AsyncLogWriter::_instance, self);
// All readers of _instance after the fence see non-NULL.
// All readers of _instance after the fence see non-nullptr.
Copy link
Member

Choose a reason for hiding this comment

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

Nit: When "null" or "NULL" are used in prose there is some ambiguity about whether it is referring to the general concept of nullness or the value NULL. In this case I would have written this as "see non-null". I find "non-nullptr" a bit jarring.

@jdksjolen
Copy link
Contributor Author

/integrate

The tier1 tests are passing, so I'm integrating this. Thank you for the reviews.

@openjdk
Copy link

openjdk bot commented Jan 18, 2023

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

  • 15a9186: 8300169: Build failure with clang-15
  • d918042: 8300267: Remove duplicated setter/getter for do_not_unlock
  • 7c8b99e: 8300117: Replace use of JNI_COMMIT mode with mode 0
  • c705673: 8299089: Instrument global jni handles with tag to make them distinguishable
  • 66f7387: 8299074: nmethod marked for deoptimization is not deoptimized
  • 1f438a8: 8282651: ZGC: vmTestbase/gc/ArrayJuggle/ tests fails intermittently with exit code 97
  • f1194dc: 8300109: RISC-V: Improve code generation for MinI/MaxI nodes
  • 89a032d: 8300002: Performance regression caused by non-inlined hot methods due to post call noop instructions
  • 7071397: 8299224: TestReporterStreams.java has bad indentation for legal header
  • 1d8b87d: 8300321: Use link tags in javax.sql.rowset package-info
  • ... and 236 more: https://git.openjdk.org/jdk/compare/11fd651ab1820770e3c65cd49589416098987a87...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Jan 18, 2023

@jdksjolen Pushed as commit bd5ca95.

💡 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
hotspot-runtime hotspot-runtime-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

4 participants