Skip to content

runtime (8): Add Scaladoc comments for undocumented entities - #26905

Draft
bvenners wants to merge 1 commit into
scala:mainfrom
artimahub:scaladoc-missing-docs-runtime
Draft

bvenners wants to merge 1 commit into
scala:mainfrom
artimahub:scaladoc-missing-docs-runtime

Conversation

@bvenners

Copy link
Copy Markdown
Contributor

This PR fills in a main doc comment plus @PARAM, @tparam, and @return tags for scala.runtime, scala.runtime.java8 and scala.runtime.coverage APIs that are completely missing any Scaladoc documentation. Most of the files are the 87 of scala.runtime.java8 that back Java function interop; the rest is the value-class runtime support, the array and tuple helpers, and the rich wrapper classes. I'm submitting it as a draft PR so that I can get the CI to run on it, to see if it breaks anything, and to start getting feedback. We automated the generation of these changes and have not reviewed all of them yet. We will review them all before making the PR non-draft. Please let me know whether you think this is going in the right direction in general, and anything specific that you notice that could be improved.

@bvenners
bvenners force-pushed the scaladoc-missing-docs-runtime branch from a194e42 to 74a56f9 Compare August 24, 2026 21:59
Documents declarations that had no doc comment at all across scala.runtime:
the boxed and unboxed value-class runtime support, the array and tuple
helpers, and the 87 files of scala.runtime.java8 that back Java function
interop.

Comment-only: no declaration, body, import, annotation or blank line is
touched.
@bvenners
bvenners force-pushed the scaladoc-missing-docs-runtime branch from e92634f to 1ff6ff3 Compare September 10, 2026 06:21

@cheeseng cheeseng left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Added some review comments.

override def longValue = self.toLong
/** Returns this character's integer value (its UTF-16 code unit) as an `Int`. */
override def intValue = self.toInt
/** Returns the low 8 bits of this character's integer value as a `Byte`. */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it is worth mentioning that this will not be exact, it drops/ignores the high 8 bits, 'precision lose' does happen imho.

* @return an exclusive [[scala.collection.immutable.NumericRange]] from this
* value until `end` with the given step
* @throws IllegalArgumentException if `step` is zero, or if the range has more
* than `Int.MaxValue` elements; both are raised when the range's length

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this part is confusing, if it is being raised only when length is first computed, should the @throw be set at the .length?

* @return an inclusive [[scala.collection.immutable.NumericRange]] from this
* value to `end` with the given step
* @throws IllegalArgumentException if `step` is zero, or if the range has more
* than `Int.MaxValue` elements; both are raised when the range's length

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Similar to until, I think it is confusing if this @throws actually does not happens in this method.

*
* @param message the explanation of the failed assertion, appended to the
* fixed prefix
* @throws java.lang.AssertionError always

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think the 'always' is redundent, if we need something here perhaps we can describe what's the message will be included.


/** Throws an `AssertionError` with the fixed message `"assertion failed"`.
*
* @throws java.lang.AssertionError always

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think the 'always' is redundent, if we need something here perhaps we can describe what's the message will be included.

* catches it: the handler compares `key` with its own marker object by
* reference and completes the method with `value` on a match, rethrowing
* otherwise, so a throw always unwinds to the invocation it belongs to. As a
* [[scala.util.control.ControlThrowable]] it carries no stack trace and is

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For the stack trace may be better described as:

"It overrides fillInStackTrace to carry no stack trace, keeping the throw cheap."

* @tparam To1 the type of the first result collection
* @tparam To2 the type of the second result collection
* @tparam To3 the type of the third result collection
* @param f the predicate applied to each triple of corresponding elements

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@param for bf1 and bf2 are missing here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants