Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8204377

Rename Object#wait parameter name from "timeout" to "timeoutMillis"

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 11
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b18

      Backports

        Description

        Unitless primitive parameters often have an implied unit, like milliseconds for Object#wait. Making that clear in the parameter name makes unit mismatch less likely.

        Let's choose the naming convention carefully. "timeoutMillis" is already in use in j.u.c. tests, and "millisTimeout" is absent from the code base.. "timeoutMillis" matches the English grammatical order "timeout in milliseconds"

        See discussion at https://openjdk.markmail.org/thread/ndcwjnmbpwhkvkwe

        The "nanos" parameter could perhaps also be renamed, but out of scope for this change. It's possible that renaming "nanos" -> "additionalNanos" or "extraNanos" would be an improvement but "timeoutNanos" would not (in this case it would be misleading).

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  martin Martin Buchholz
                  Reporter:
                  martin Martin Buchholz
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: