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

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

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 11
    • None
    • core-libs
    • b18

        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).

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

                Created:
                Updated:
                Resolved: