Skip to content

Collection mutable (2): filled in @param, @tparam, and @return tags that were missed last time#26120

Open
bvenners wants to merge 1 commit into
scala:mainfrom
artimahub:scaladoc-tags-collection-mutable-cleanup
Open

Collection mutable (2): filled in @param, @tparam, and @return tags that were missed last time#26120
bvenners wants to merge 1 commit into
scala:mainfrom
artimahub:scaladoc-tags-collection-mutable-cleanup

Conversation

@bvenners
Copy link
Copy Markdown
Contributor

As a next step in improving the Scaladoc documentation for the Scala 3 standard library, this PR fills in @param, @tparam, and @return tags for scala.collection.mutable that were missed in the previous batch of PRs. I'm submitting it as a draft PR so to get CI to run on it, to see if it breaks anything, and to start getting feedback. We automated the generation of these changes and are starting to review them. We will review them all before making the PR non-draft. Please let me know if you see anything specific that you think could be improved.

Copy link
Copy Markdown
Contributor

@cheeseng cheeseng left a comment

Choose a reason for hiding this comment

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

Suggestions added.

Comment thread library/src/scala/collection/mutable/AnyRefMap.scala Outdated
Comment thread library/src/scala/collection/mutable/ArrayDeque.scala Outdated
@bvenners bvenners force-pushed the scaladoc-tags-collection-mutable-cleanup branch 2 times, most recently from 4054f13 to 74bb7d4 Compare May 31, 2026 21:45
@bvenners bvenners force-pushed the scaladoc-tags-collection-mutable-cleanup branch from 74bb7d4 to ef8c7ed Compare May 31, 2026 22:30
@bvenners bvenners marked this pull request as ready for review May 31, 2026 22:32
@bvenners bvenners requested a review from a team as a code owner May 31, 2026 22:32
/** Implementation of `make` for JS.
*
* @tparam T the element type of the array builder, with a `ClassTag` context bound
* @return a new generic `ArrayBuilder` optimized for Scala.js
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

optimized?

* See trimToSize if you want to also resize internally
*
* @param index the zero-based position of the first element to remove
* @param count the number of elements to remove; a negative value throws `IllegalArgumentException`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

are we missing a @throws, then?

*/
/** This is a more general version of copyToArray - this also accepts a srcStart unlike copyToArray
* This copies maxItems elements from this collection's srcStart to dest's destStart
* If we reach the end of either collections before we could copy maxItems, we simply stop copying
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
* If we reach the end of either collections before we could copy maxItems, we simply stop copying
* If we reach the end of either collection before we could copy maxItems, we simply stop copying

* @tparam V the type of the values associated with the keys
* @param initialCapacity the initial capacity of the internal hash table
* @param loadFactor the load factor for the hash table, used to determine when to resize
* @param ordering the `Ordering` used to compare keys within a bucket's red-black tree
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

does it make sense to mention the red-black tree, or is that just an implementation detail?

/** Computes the improved hash of an original (`any.##`) hash.
*
* @param originalHash the original hash code from `any.##`
* @return the improved hash with the high 16 bits xored into the low 16 bits
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

consistency: xor vs XOR (I think I prefer XOR, but regardless, it should be consistent)

*
* @param index the index to modify.
* @param ch the new Char.
* @return this StringBuilder.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
* @return this StringBuilder.
* @return this `StringBuilder`.

/** Overloaded version of `addAll` that takes a string.
*
* @param s the string to append to this builder
* @return this StringBuilder
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
* @return this StringBuilder
* @return this `StringBuilder`

@bvenners
Copy link
Copy Markdown
Contributor Author

bvenners commented Jun 2, 2026

@SethTisue Great comments. I'll check into them.

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.

3 participants