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

8170389: java.text.DigitList.getDouble() : Controversy between javadoc and code #10567

Conversation

justin-curtis-lu
Copy link
Member

@justin-curtis-lu justin-curtis-lu commented Oct 4, 2022

Problem: Outdated doc does not match code. Claimed to throw exception and compared to Long method.
Fix: Update doc to match code, compared to Double.parseDouble() accordingly.


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-8170389: java.text.DigitList.getDouble() : Controversy between javadoc and code

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 10567

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 4, 2022

👋 Welcome back justin-curtis-lu! 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 4, 2022
@openjdk
Copy link

openjdk bot commented Oct 4, 2022

@justin-curtis-lu The following label will be automatically applied to this pull request:

  • core-libs

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 core-libs core-libs-dev@openjdk.org label Oct 4, 2022
@mlbridge
Copy link

mlbridge bot commented Oct 4, 2022

Webrevs

@jddarcy
Copy link
Member

jddarcy commented Oct 4, 2022

/csr needed

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

openjdk bot commented Oct 4, 2022

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

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

Copy link
Member

@naotoj naotoj 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 to me. Since you are only modifying the comments, please add noreg-doc label to the JIRA issue.

@justin-curtis-lu
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented Oct 5, 2022

@justin-curtis-lu This pull request has not yet been marked as ready for integration.

@naotoj
Copy link
Member

naotoj commented Oct 5, 2022

Turned out that the comment was not aligning with the behavior of Double.parseDouble(""), as it throws NumberFormatException (Thanks to @LanceAndersen who let me know). So how about changing it to:

If (count == 0) this returns 0.0, unlike Double.parseDouble("") which throws NumberFormatException

It also applies to getLong(), and you may want to add comments getBigDecimal() for consistency with other getXXX() methods (without "unlike ..." part though).

@@ -194,6 +194,9 @@ public final long getLong() {
return Long.parseLong(temp.toString());
}

/**
* Utility routine to get the value of the digit list.
Copy link
Contributor

Choose a reason for hiding this comment

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

new BigDecimal("") will also throw a NumberFormatException so I would add a similar comment for count as done above for getLong/Double()

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks Lance, will make that change

Update getBigDecimal to match other getXXX() methods in DigitList
@jddarcy
Copy link
Member

jddarcy commented Oct 6, 2022

/csr unneeded

@jddarcy
Copy link
Member

jddarcy commented Oct 6, 2022

Sorry; didn't look closely enough before applying the csr label.

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

openjdk bot commented Oct 6, 2022

@jddarcy determined that a CSR request is not needed for this pull request.

@openjdk
Copy link

openjdk bot commented Oct 6, 2022

@justin-curtis-lu 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:

8170389: java.text.DigitList.getDouble() : Controversy between javadoc and code

Reviewed-by: naoto, lancea

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

  • 85569e9: 8286037: Bump minimum boot jdk to JDK 19
  • fef345b: 8293672: Update freetype md file
  • 5c030cc: 8290973: In AffineTransform, equals(Object) is inconsistent with hashCode()
  • f888aa9: 8293061: Combine CDSOptions and AppCDSOptions test utility classes
  • 73f0646: 8294839: Disable StressLongCountedLoop in compiler/loopopts/TestRemoveEmptyLoop.java
  • 2ceebf6: 8294456: Fix misleading-indentation warnings in core JDK libraries
  • ad7b7d4: 8294697: java/lang/Thread/virtual/ThreadAPI.testGetStackTrace2 failed with non-empty stack trace
  • e38ae8a: 8294759: Print actual lock/monitor ranking
  • 7012d4b: 8294837: unify Windows 2019 version check in os_windows and java_props_md
  • 8c15f77: 8270915: GIFImageReader disregards ignoreMetadata flag which causes memory exhaustion
  • ... and 44 more: https://git.openjdk.org/jdk/compare/e137f9f2f0e4244307900cd0eadceb9b773e9858...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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@naotoj, @LanceAndersen) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Oct 6, 2022
Copy link
Contributor

@LanceAndersen LanceAndersen left a comment

Choose a reason for hiding this comment

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

Looks fine Justin.

Please make sure the comments are < 80 characters and if they are longer break them into two lines as they seem like they might be long

Make under 80 chars
@justin-curtis-lu
Copy link
Member Author

Looks fine Justin.

Please make sure the comments are < 80 characters and if they are longer break them into two lines as they seem like they might be long

@LanceAndersen Made the change, thanks Lance

Copy link
Contributor

@LanceAndersen LanceAndersen left a comment

Choose a reason for hiding this comment

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

thank you Justin :-)

@justin-curtis-lu
Copy link
Member Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Oct 6, 2022
@openjdk
Copy link

openjdk bot commented Oct 6, 2022

@justin-curtis-lu
Your change (at version cafcab8) is now ready to be sponsored by a Committer.

@naotoj
Copy link
Member

naotoj commented Oct 6, 2022

/integrate

@openjdk
Copy link

openjdk bot commented Oct 6, 2022

@naotoj Only the author (@justin-curtis-lu) is allowed to issue the integrate command. As this pull request is ready to be sponsored, and you are an eligible sponsor, did you mean to issue the /sponsor command?

@naotoj
Copy link
Member

naotoj commented Oct 7, 2022

/sponsor

@openjdk
Copy link

openjdk bot commented Oct 7, 2022

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

  • 3466e99: 8294691: dynamicArchive/RelativePath.java is running other test case
  • 823b53d: 8294987: Streamline DerOutputStream write
  • 6a266c4: 8292879: com/sun/jdi/ClassUnloadEventTest.java failed due to classes not unloading
  • fe7a461: 8294920: Missing SP value in Linux x86_32 thread context
  • 4cbac40: 8294717: (bf) DirectByteBuffer constructor will leak if allocating Deallocator or Cleaner fails with OOME
  • c1166a3: 8289561: java/lang/instrument/NativeMethodPrefixAgent.java fails with "ERROR: Injection failure: java.lang.UnsupportedOperationException: Records requires ASM8"
  • a1747ef: 8294941: GHA: Cut down cross-compilation sysroots
  • 67210ab: 8286394: Address possibly lossy conversions in jdk.naming.dns
  • 7a194d3: 8290154: [JVMCI] partially implement JVMCI for RISC-V
  • b38bed6: 8294308: Allow dynamically choosing the MEMFLAGS of a type without ResourceObj
  • ... and 63 more: https://git.openjdk.org/jdk/compare/e137f9f2f0e4244307900cd0eadceb9b773e9858...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Oct 7, 2022

@naotoj @justin-curtis-lu Pushed as commit d39d8c8.

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