Skip to content

Commit e92634f

Browse files
committed
Drop all non-user-facing Scaladoc
17 of the documented declarations on this branch are private, private[x], protected[x], or nested inside such a scope. scaladoc's isHiddenByVisibility drops every one of them unless -private is passed, and no build in this repository passes it, so none of this reaches the published API pages. This commit removes them, 113 comment line(s) across 3 file(s), leaving only documentation the API pages render. Nothing is lost: scaladoc-missing-docs-runtime-internal restores this tree exactly.
1 parent 74a56f9 commit e92634f

3 files changed

Lines changed: 0 additions & 113 deletions

File tree

library/src/scala/runtime/ClassValueCompat.scala

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -21,78 +21,26 @@ private[scala] abstract class ClassValueCompat[T] extends ClassValueInterface[T]
2121
else new FallbackClassValue()
2222

2323
private class JavaClassValue extends ClassValue[T] with ClassValueInterface[T] {
24-
/** Computes the value for `cls` by delegating to the enclosing
25-
* `ClassValueCompat`'s `computeValue`; `java.lang.ClassValue` caches
26-
* the result per class.
27-
*
28-
* @param cls the class to compute the value for
29-
* @return the computed value
30-
*/
3124
override def computeValue(cls: Class[?]): T = self.computeValue(cls)
3225
}
3326

3427
private class FallbackClassValue extends ClassValueInterface[T] {
35-
/** Returns the value for `cls`, computed by the enclosing
36-
* `ClassValueCompat`'s `computeValue` on every call: the fallback
37-
* caches nothing.
38-
*
39-
* @param cls the class to compute the value for
40-
*/
4128
override def get(cls: Class[?]): T = self.computeValue(cls)
4229

43-
/** Does nothing: the fallback caches no values, so there is nothing to
44-
* remove.
45-
*
46-
* @param cls never used
47-
*/
4830
override def remove(cls: Class[?]): Unit = {}
4931
}
5032

51-
/** Returns the value associated with `cls`: when `java.lang.ClassValue`
52-
* is available, from its per-class cache, computed by `computeValue` on
53-
* first access; otherwise by calling `computeValue` on every call.
54-
*
55-
* @param cls the class to get the value for
56-
*/
5733
def get(cls: Class[?]): T = instance.get(cls)
5834

59-
/** Removes the cached value for `cls`, so that the next `get` recomputes
60-
* it; does nothing when `java.lang.ClassValue` is unavailable, since
61-
* nothing is cached then.
62-
*
63-
* @param cls the class whose cached value to remove
64-
*/
6535
def remove(cls: Class[?]): Unit = instance.remove(cls)
6636

67-
/** Computes the value to associate with `cls`.
68-
*
69-
* Called by `get`: when backed by `java.lang.ClassValue`, on the first
70-
* access for each class (and again after `remove`); otherwise on every
71-
* call.
72-
*
73-
* @param cls the class to compute the value for
74-
* @return the value to associate with `cls`
75-
*/
7637
protected def computeValue(cls: Class[?]): T
7738
}
7839

7940
private[scala] object ClassValueCompat {
80-
/** A common interface over `java.lang.ClassValue` and the non-caching
81-
* fallback used on runtimes where that class cannot be loaded.
82-
*
83-
* @tparam T the type of the value derived from a class
84-
*/
8541
trait ClassValueInterface[T] {
86-
/** Returns the value for `cls`, computing it if necessary.
87-
*
88-
* @param cls the class to get the value for
89-
*/
9042
def get(cls: Class[?]): T
9143

92-
/** Removes any cached value for `cls`.
93-
*
94-
* @param cls the class whose cached value to remove
95-
*/
9644
def remove(cls: Class[?]): Unit
9745
}
9846

library/src/scala/runtime/MethodCache.scala

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -38,35 +38,13 @@ private[scala] sealed abstract class MethodCache {
3838
* @return the cached `JMethod` compatible with `forReceiver`, or `null` if no such method is cached (in which case the caller should look up the method and `add` it)
3939
*/
4040
def find(forReceiver: JClass[?]): JMethod | Null
41-
/** Returns a cache that also resolves `forMethod` for receiver class
42-
* `forReceiver`, to replace this cache at the call point. This cache
43-
* itself is not mutated: implementations return either a new cache
44-
* extending this one or this cache unchanged.
45-
*
46-
* @param forReceiver the runtime `Class` of the receiver object the method was looked up for
47-
* @param forMethod the method resolved for `forReceiver`
48-
* @return the cache to use for subsequent look-ups at this call point
49-
*/
5041
def add(forReceiver: JClass[?], forMethod: JMethod): MethodCache
5142
}
5243

5344
private[scala] final class EmptyMethodCache extends MethodCache {
5445

55-
/** Returns `null`: the empty cache contains no methods, so the caller
56-
* should look up the method and `add` it.
57-
*
58-
* @param forReceiver the runtime `Class` of the receiver object; never used
59-
*/
6046
def find(forReceiver: JClass[?]): JMethod | Null = null
6147

62-
/** Returns a new single-entry [[PolyMethodCache]] of complexity 1 that
63-
* resolves `forMethod` for receiver class `forReceiver`, with this empty
64-
* cache as the end of its chain.
65-
*
66-
* @param forReceiver the runtime `Class` of the receiver object the method was looked up for
67-
* @param forMethod the method resolved for `forReceiver`
68-
* @return the new one-entry cache
69-
*/
7048
def add(forReceiver: JClass[?], forMethod: JMethod): MethodCache =
7149
new PolyMethodCache(this, forReceiver, forMethod, 1)
7250

@@ -77,24 +55,9 @@ private[scala] final class MegaMethodCache(
7755
private val forParameterTypes: Array[JClass[?]]
7856
) extends MethodCache {
7957

80-
/** Returns the public method of `forReceiver` with this cache's method
81-
* name and parameter types, resolved reflectively via `getMethod` on
82-
* every call: a mega-morphic cache stores no per-receiver entries.
83-
*
84-
* @param forReceiver the runtime `Class` of the receiver object to resolve the method on
85-
* @return the resolved method; never `null`
86-
* @throws NoSuchMethodException if `forReceiver` has no public method
87-
* with this cache's name and parameter types
88-
*/
8958
def find(forReceiver: JClass[?]): JMethod | Null =
9059
forReceiver.getMethod(forName, forParameterTypes*)
9160

92-
/** Returns this cache unchanged: a mega-morphic cache resolves methods
93-
* reflectively in `find` and records no per-receiver entries.
94-
*
95-
* @param forReceiver never used
96-
* @param forMethod never used
97-
*/
9861
def add(forReceiver: JClass[?], forMethod: JMethod): MethodCache = this
9962

10063
}
@@ -119,27 +82,11 @@ private[scala] final class PolyMethodCache(
11982
case _ => next find forReceiver
12083
}
12184

122-
/** Returns the cached method whose receiver class is reference-equal to
123-
* `forReceiver` anywhere in this chain, or `null` if no entry matches
124-
* (in which case the caller should look up the method and `add` it).
125-
*
126-
* @param forReceiver the runtime `Class` of the receiver object to look up in the cache chain
127-
*/
12885
def find(forReceiver: JClass[?]): JMethod | Null = findInternal(forReceiver)
12986

13087
// TODO: come up with a more realistic number
13188
final private val MaxComplexity = 160
13289

133-
/** Returns a new [[PolyMethodCache]] that prepends the entry
134-
* (`forReceiver`, `forMethod`) to this chain, unless this chain has
135-
* reached `MaxComplexity` entries, in which case the call point has
136-
* turned mega-morphic: returns a [[MegaMethodCache]] for the method's
137-
* name and parameter types, discarding the per-receiver entries.
138-
*
139-
* @param forReceiver the runtime `Class` of the receiver object the method was looked up for
140-
* @param forMethod the method resolved for `forReceiver`
141-
* @return the extended chain, or a mega-morphic cache at the cutover
142-
*/
14390
def add(forReceiver: JClass[?], forMethod: JMethod): MethodCache =
14491
if (complexity < MaxComplexity)
14592
new PolyMethodCache(this, forReceiver, forMethod, complexity + 1)

library/src/scala/runtime/PStatics.scala

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,5 @@ import scala.language.`2.13`
1919
private[scala] object PStatics {
2020
// `Int.MaxValue - 8` traditional soft limit to maximize compatibility with diverse JVMs
2121
// See https://stackoverflow.com/a/8381338 for example
22-
/** The largest array length that common JVMs reliably allow:
23-
* `Int.MaxValue - 8`.
24-
*
25-
* Although array lengths are `Int`s, some VMs reserve a few header words
26-
* in an array, so requesting a length above this limit can throw
27-
* `OutOfMemoryError` even when enough memory is available. Array-backed
28-
* collections use this value as the cap when growing their backing arrays.
29-
*/
3022
final val VM_MaxArraySize = 2147483639
3123
}

0 commit comments

Comments
 (0)