summaryrefslogtreecommitdiff
path: root/src/library/scala/Long.scala
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@gmail.com>2016-04-01 22:41:58 +0200
committerLukas Rytz <lukas.rytz@gmail.com>2016-04-01 22:52:49 +0200
commitff442fc7bc7ab0b2fef82762c4705a15d8c17ecd (patch)
tree906c441643d3c8353e37d597228398f010b52aa7 /src/library/scala/Long.scala
parent19dac8212090f81ffd18bad6d7cc929fbff9bec8 (diff)
downloadscala-ff442fc7bc7ab0b2fef82762c4705a15d8c17ecd.tar.gz
scala-ff442fc7bc7ab0b2fef82762c4705a15d8c17ecd.tar.bz2
scala-ff442fc7bc7ab0b2fef82762c4705a15d8c17ecd.zip
SI-6710 Clarify stub methods in primitive value classes
- Replaces the implementations of box/unbox in AnyVal companions by `???`, the methods are only stubs, and the impls did not correspond to the actual behavior. The doc comment already points to the actual implementation in BoxesRunTime. - Replaces the body of `getClass` from `null` to `???` and clarifies in a comment why the overrides exist.
Diffstat (limited to 'src/library/scala/Long.scala')
-rw-r--r--src/library/scala/Long.scala7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/library/scala/Long.scala b/src/library/scala/Long.scala
index b27a66647f..1d219ecf1e 100644
--- a/src/library/scala/Long.scala
+++ b/src/library/scala/Long.scala
@@ -434,7 +434,8 @@ final abstract class Long private extends AnyVal {
/** Returns the remainder of the division of this value by `x`. */
def %(x: Double): Double
- override def getClass(): Class[Long] = null
+ // Provide a more specific return type for Scaladoc
+ override def getClass(): Class[Long] = ???
}
object Long extends AnyValCompanion {
@@ -451,7 +452,7 @@ object Long extends AnyValCompanion {
* @param x the Long to be boxed
* @return a java.lang.Long offering `x` as its underlying value.
*/
- def box(x: Long): java.lang.Long = java.lang.Long.valueOf(x)
+ def box(x: Long): java.lang.Long = ???
/** Transform a boxed type into a value type. Note that this
* method is not typesafe: it accepts any Object, but will throw
@@ -463,7 +464,7 @@ object Long extends AnyValCompanion {
* @throws ClassCastException if the argument is not a java.lang.Long
* @return the Long resulting from calling longValue() on `x`
*/
- def unbox(x: java.lang.Object): Long = x.asInstanceOf[java.lang.Long].longValue()
+ def unbox(x: java.lang.Object): Long = ???
/** The String representation of the scala.Long companion object. */
override def toString = "object scala.Long"