Skip to content

SI-8140 Documentation references java.lang.String directly #4591

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 30, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/library/scala/Predef.scala
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ object Predef extends LowPriorityImplicits with DeprecatedPredef {
*/
def classOf[T]: Class[T] = null // This is a stub method. The actual implementation is filled in by the compiler.

/** The `String` type in Scala has methods that come either from the underlying
* Java String (see the documentation corresponding to your Java version, for
* example [[http://docs.oracle.com/javase/8/docs/api/java/lang/String.html]]) or
* are added implicitly through [[scala.collection.immutable.StringOps]].
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

There are a couple of JavaDoc-style comments still in Predef, but it shows Scala pride to use Scala-style, as at the top. It saves vertical space. Also, might as well link to Java 8 doc.

type String = java.lang.String
type Class[T] = java.lang.Class[T]

Expand Down
7 changes: 3 additions & 4 deletions src/library/scala/collection/immutable/StringOps.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ package immutable

import mutable.StringBuilder

/**
* This class serves as a wrapper providing `String`s with all the operations
* found in indexed sequences. Where needed, instances of `String` object
* are implicitly converted into this class.
/** This class serves as a wrapper providing [[scala.Predef.String]]s with all
* the operations found in indexed sequences. Where needed, `String`s are
* implicitly converted into instances of this class.
*
* The difference between this class and `WrappedString` is that calling transformer
* methods such as `filter` and `map` will yield a `String` object, whereas a
Expand Down