summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2015-08-05 10:58:25 -0700
committerAdriaan Moors <adriaan.moors@typesafe.com>2015-08-05 11:04:04 -0700
commitecf9128d8bf7a965492f0b714876650bba66b040 (patch)
tree406db7c5db708d03891b463613e3ecd8f210ce19 /src
parentb8744bafd7a9b3836932cd8348cc6d7cc83cec17 (diff)
parent928e6892d4fc10a953e0121fbefcae54bff1ab0c (diff)
downloadscala-ecf9128d8bf7a965492f0b714876650bba66b040.tar.gz
scala-ecf9128d8bf7a965492f0b714876650bba66b040.tar.bz2
scala-ecf9128d8bf7a965492f0b714876650bba66b040.zip
Merge branch '2.11.x' into 2.12.x
Transcript: ``` ➜ scala git:(2.12.x) export MB=$(git merge-base 2.12.x 2.11.x) ➜ scala git:(2.12.x) echo $MB 0e9525aa618a2eca143a1c7379ff1e6efd23b86e ➜ scala git:(2.12.x) g log --oneline --graph $MB...2.11.x ``` Read this upside down :-). The last merge comes first, with merge commands interspersed in the git log. ``` ➜ scala git:(2.12.x) g merge 2.11.x Auto-merging versions.properties Auto-merging src/reflect/scala/reflect/internal/pickling/UnPickler.scala Auto-merging src/reflect/scala/reflect/internal/Types.scala Auto-merging src/reflect/scala/reflect/internal/TreeGen.scala Auto-merging src/library/scala/collection/immutable/Stream.scala Auto-merging src/library/scala/collection/convert/Wrappers.scala Auto-merging build.xml CONFLICT (content): Merge conflict in build.xml Auto-merging README.md Automatic merge failed; fix conflicts and then commit the result. ``` ``` * 928e6892d4 (scala/2.11.x, 2.11.x) Merge pull request #4682 from adriaanm/jline-quick.bin |\ | * b763dbf368 (adriaanm/jline-quick.bin, jline-quick.bin) Include jline on quick.bin tool path * | ccded7d179 Merge pull request #4680 from janekdb/2.11.x-option |\ \ | |/ |/| | * 58ae3e51f7 Delegate null test to Option |/ * a745f06e35 Merge pull request #4670 from retronym/ticket/9422 |\ | * ec95e534a2 SI-9422 Fix incorrect constant propagation * 65fa73dff3 Merge pull request #4669 from janekdb/2.11.x-scaladoc-reflect |\ | * e206a1837d ScalaDoc fixes for reflect * | 8e7e3b4a5f Merge pull request #4667 from janekdb/2.11.x-scaladoc-library-library-aux |\ \ | |/ |/| | * 69c2c106fe ScalaDoc fixes for library and library-aux * | 7de4cbc5e5 Merge pull request #4665 from lrytz/asm-504-3 |\ \ | * | cdc55c29d0 Upgrade scala-asm to 5.0.4-scala-3 |/ / * | d8da39a197 Merge pull request #4661 from retronym/ticket/9365 |\ \ | * | 0c99742c51 SI-9365 Don't null out dependencies of transient lazy vals | / * | 2279d3f3d9 Merge pull request #4662 from janekdb/2.11.x-redundant-val-modifier |\ \ | * | 173a6fad95 Remove redundant 'val' from case class params. * | | e0d21432d6 Merge pull request #4664 from SethTisue/remove-dead-link-in-readme |\ \ \ | |_|/ |/| | | * | 600fc4e6e1 fix readme for death of typesafe.artifactoryonline.com | |/ * | 7492bda816 Merge pull request #4636 from SethTisue/contributor-stuff-from-github-wiki |\ \ | |/ |/| | * ed5098dbc4 merge two reviewers lists in readme | * e136e4ad47 tighten up CONTRIBUTING.md a little | * f9ca6863d4 readme/contributor's guide tweaks | * 80e98b03a1 tiny readme fix | * 197845620c merge in text from pull request policy from old wiki | * e93ca409ae drop in pull request policy from old wiki | * 951939d1b3 contributor guide: add a morsel salvaged from GitHub wiki * f682441f6f Merge pull request #4653 from lrytz/t9403 |\ | * 2678d349b2 SI-9403 fix ICodeReader for negative BIPUSH / SIPUSH values ``` ``` ➜ scala git:(2.12.x) g merge -s ours f2d7838d90 Merge made by the 'ours' strategy. ``` ``` * f2d7838d90 Merge pull request #4657 from lrytz/backports |\ | * 241bb9ac19 Rename the ENUM / DEFAULTMETHOD flags to include JAVA_ | * 7a7f9927c3 SI-9393 fix modifiers of ClassBTypes for Java annotations | * 8946d60bd2 [backport] Fix bytecode stability when running the closure optimizer | * 3b6b2bfe9f [backport] SI-9392 Clarify the workaround comment and introduce a devWarning | * 091c1e6ed8 [backport] SI-9392 Avoid crash in GenBCode for incoherent trees | * 6177cb4481 [backport] SI-9393 Temporarily disable two assertions in GenBCode | * a1d471f7ba [backport] Refactor the ClosureOptimizer, run ProdCons only once per method | * f5e72765f2 [backport] SI-9387 Fix VerifyError introduced by indylambda | * 41b99e2531 [backport] Integrate the LMFInvokeDynamic extractor into LambdaMetaFactoryCall | * fc1cda2118 [backport] Small refactoring to the closure optimizer | * 8f272c0ad2 [backport] Accessibility checks for methods with an InvokeDynamic instruction | * 1c1d8259b5 [backport] Fix bytecode stability | * ef9d845676 [backport] Support methodHandle / invokeDynamic constant pool entries in scalap | * 60747c7555 [backport] Skip mirror class when invoking deserializeLambda | * 404e86239e [backport] Prevent infinite recursion in ProdConsAnalyzer | * 1b0703e74d [backport] SI-9376 don't crash when inlining a closure body that throws. | * e511375a90 [backport] Fix superclass for Java interface symbols created in JavaMirrors | * 1b57723169 [backport] `deserializeLambda` should not use encoded class name | * 8bafa8ed88 [backport] Java parser: default methods in interfaces are not `DEFERRED` | * 44e2761a9b [backport] SI-6613 fixed in GenBCode ``` ``` ➜ scala git:(2.12.x) g merge 4c6dcfe934 Auto-merging src/scaladoc/scala/tools/nsc/doc/html/page/Template.scala Auto-merging doc/License.rtf Auto-merging doc/LICENSE.md Auto-merging build.xml Auto-merging build.sbt Merge made by the 'recursive' strategy. Auto packing the repository in background for optimum performance. See "git help gc" for manual housekeeping. build.sbt | 2 +- build.xml | 2 +- doc/LICENSE.md | 4 ++-- doc/License.rtf | 4 ++-- src/scaladoc/scala/tools/nsc/doc/html/page/Template.scala | 2 +- src/scalap/decoder.properties | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) ``` ``` * | 4c6dcfe934 Merge pull request #4656 from lrytz/filtersOpenJDK |\ \ | |/ |/| | * 0b35bc29aa Ignore OpenJDK warnings in partest filters * 6eb0812050 Merge pull request #4644 from SethTisue/copyright-2015 * e0aac7c9ef bump copyright year to 2015 ```
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/backend/opt/ConstantOptimization.scala8
-rw-r--r--src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala3
-rw-r--r--src/compiler/scala/tools/nsc/symtab/classfile/ICodeReader.scala6
-rw-r--r--src/compiler/scala/tools/nsc/transform/Mixin.scala2
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Macros.scala4
-rw-r--r--src/library-aux/scala/AnyRef.scala4
-rw-r--r--src/library/scala/StringContext.scala2
-rw-r--r--src/library/scala/collection/GenSeqLike.scala2
-rw-r--r--src/library/scala/collection/convert/Wrappers.scala41
-rw-r--r--src/library/scala/collection/immutable/Stream.scala2
-rw-r--r--src/library/scala/compat/Platform.scala2
-rw-r--r--src/library/scala/math/BigDecimal.scala2
-rw-r--r--src/library/scala/ref/WeakReference.scala5
-rw-r--r--src/library/scala/reflect/Manifest.scala4
-rw-r--r--src/reflect/scala/reflect/api/Trees.scala2
-rw-r--r--src/reflect/scala/reflect/api/TypeTags.scala2
-rw-r--r--src/reflect/scala/reflect/internal/ExistentialsAndSkolems.scala2
-rw-r--r--src/reflect/scala/reflect/internal/SymbolPairs.scala2
-rw-r--r--src/reflect/scala/reflect/internal/TreeGen.scala7
-rw-r--r--src/reflect/scala/reflect/internal/Types.scala6
-rw-r--r--src/reflect/scala/reflect/internal/pickling/UnPickler.scala2
-rw-r--r--src/reflect/scala/reflect/internal/util/AbstractFileClassLoader.scala2
-rw-r--r--src/reflect/scala/reflect/runtime/TwoWayCache.scala3
-rw-r--r--src/reflect/scala/reflect/runtime/TwoWayCaches.scala3
24 files changed, 46 insertions, 72 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/opt/ConstantOptimization.scala b/src/compiler/scala/tools/nsc/backend/opt/ConstantOptimization.scala
index 0e6ee76eb2..fb1799e092 100644
--- a/src/compiler/scala/tools/nsc/backend/opt/ConstantOptimization.scala
+++ b/src/compiler/scala/tools/nsc/backend/opt/ConstantOptimization.scala
@@ -170,9 +170,11 @@ abstract class ConstantOptimization extends SubComponent {
// out all the possibilities
case Impossible(possible2) => (possible -- possible2).nonEmpty
})
- def mightNotEqual(other: Contents): Boolean = (this ne other) && (other match {
- // two Possibles might not be equal if either has possible members that the other doesn't
- case Possible(possible2) => (possible -- possible2).nonEmpty || (possible2 -- possible).nonEmpty
+ def mightNotEqual(other: Contents): Boolean = (other match {
+ case Possible(possible2) =>
+ // two Possibles must equal if each is known to be of the same, single value
+ val mustEqual = possible.size == 1 && possible == possible2
+ !mustEqual
case Impossible(_) => true
})
}
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
index 06a0299d2a..99e61d2482 100644
--- a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
+++ b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
@@ -84,6 +84,9 @@ abstract class ClassfileParser {
protected final def u2(): Int = in.nextChar.toInt
protected final def u4(): Int = in.nextInt
+ protected final def s1(): Int = in.nextByte.toInt // sign-extend the byte to int
+ protected final def s2(): Int = (in.nextByte.toInt << 8) | u1 // sign-extend and shift the first byte, or with the unsigned second byte
+
private def readInnerClassFlags() = readClassFlags()
private def readClassFlags() = JavaAccFlags classFlags u2
private def readMethodFlags() = JavaAccFlags methodFlags u2
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ICodeReader.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ICodeReader.scala
index 438a71061e..b2f5a4119d 100644
--- a/src/compiler/scala/tools/nsc/symtab/classfile/ICodeReader.scala
+++ b/src/compiler/scala/tools/nsc/symtab/classfile/ICodeReader.scala
@@ -326,8 +326,8 @@ abstract class ICodeReader extends ClassfileParser {
case JVM.dconst_0 => code emit CONSTANT(Constant(0.0))
case JVM.dconst_1 => code emit CONSTANT(Constant(1.0))
- case JVM.bipush => code.emit(CONSTANT(Constant(u1))); size += 1
- case JVM.sipush => code.emit(CONSTANT(Constant(u2))); size += 2
+ case JVM.bipush => code.emit(CONSTANT(Constant(s1))); size += 1
+ case JVM.sipush => code.emit(CONSTANT(Constant(s2))); size += 2
case JVM.ldc => code.emit(CONSTANT(pool.getConstant(u1))); size += 1
case JVM.ldc_w => code.emit(CONSTANT(pool.getConstant(u2))); size += 2
case JVM.ldc2_w => code.emit(CONSTANT(pool.getConstant(u2))); size += 2
@@ -466,7 +466,7 @@ abstract class ICodeReader extends ClassfileParser {
size += 2
val local = code.getLocal(u1, INT)
code.emit(LOAD_LOCAL(local))
- code.emit(CONSTANT(Constant(u1)))
+ code.emit(CONSTANT(Constant(s1)))
code.emit(CALL_PRIMITIVE(Arithmetic(ADD, INT)))
code.emit(STORE_LOCAL(local))
diff --git a/src/compiler/scala/tools/nsc/transform/Mixin.scala b/src/compiler/scala/tools/nsc/transform/Mixin.scala
index 25d45cc819..a079a76ce7 100644
--- a/src/compiler/scala/tools/nsc/transform/Mixin.scala
+++ b/src/compiler/scala/tools/nsc/transform/Mixin.scala
@@ -1122,7 +1122,7 @@ abstract class Mixin extends InfoTransform with ast.TreeDSL {
if (scope exists (_.isLazy)) {
val map = mutable.Map[Symbol, Set[Symbol]]() withDefaultValue Set()
// check what fields can be nulled for
- for ((field, users) <- singleUseFields(templ); lazyFld <- users)
+ for ((field, users) <- singleUseFields(templ); lazyFld <- users if !lazyFld.accessed.hasAnnotation(TransientAttr))
map(lazyFld) += field
map.toMap
diff --git a/src/compiler/scala/tools/nsc/typechecker/Macros.scala b/src/compiler/scala/tools/nsc/typechecker/Macros.scala
index 10aefae20b..99dd81c7e2 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Macros.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Macros.scala
@@ -85,9 +85,9 @@ trait Macros extends MacroRuntimes with Traces with Helpers {
*/
case class MacroImplBinding(
// Is this macro impl a bundle (a trait extending *box.Macro) or a vanilla def?
- val isBundle: Boolean,
+ isBundle: Boolean,
// Is this macro impl blackbox (i.e. having blackbox.Context in its signature)?
- val isBlackbox: Boolean,
+ isBlackbox: Boolean,
// Java class name of the class that contains the macro implementation
// is used to load the corresponding object with Java reflection
className: String,
diff --git a/src/library-aux/scala/AnyRef.scala b/src/library-aux/scala/AnyRef.scala
index 8c1862e729..7217499da7 100644
--- a/src/library-aux/scala/AnyRef.scala
+++ b/src/library-aux/scala/AnyRef.scala
@@ -45,7 +45,7 @@ trait AnyRef extends Any {
*/
def synchronized[T](body: => T): T
- /** Tests whether the argument (`arg0`) is a reference to the receiver object (`this`).
+ /** Tests whether the argument (`that`) is a reference to the receiver object (`this`).
*
* The `eq` method implements an [[http://en.wikipedia.org/wiki/Equivalence_relation equivalence relation]] on
* non-null instances of `AnyRef`, and has three additional properties:
@@ -73,7 +73,7 @@ trait AnyRef extends Any {
/** The expression `x == that` is equivalent to `if (x eq null) that eq null else x.equals(that)`.
*
- * @param arg0 the object to compare against this object for equality.
+ * @param that the object to compare against this object for equality.
* @return `true` if the receiver object is equivalent to the argument; `false` otherwise.
*/
final def ==(that: Any): Boolean =
diff --git a/src/library/scala/StringContext.scala b/src/library/scala/StringContext.scala
index e60fa2f290..69533c12da 100644
--- a/src/library/scala/StringContext.scala
+++ b/src/library/scala/StringContext.scala
@@ -173,7 +173,7 @@ object StringContext {
/** An exception that is thrown if a string contains a backslash (`\`) character
* that does not start a valid escape sequence.
* @param str The offending string
- * @param idx The index of the offending backslash character in `str`.
+ * @param index The index of the offending backslash character in `str`.
*/
class InvalidEscapeException(str: String, @deprecatedName('idx) val index: Int) extends IllegalArgumentException(
s"""invalid escape ${
diff --git a/src/library/scala/collection/GenSeqLike.scala b/src/library/scala/collection/GenSeqLike.scala
index f786293822..be1da1660a 100644
--- a/src/library/scala/collection/GenSeqLike.scala
+++ b/src/library/scala/collection/GenSeqLike.scala
@@ -274,7 +274,7 @@ trait GenSeqLike[+A, +Repr] extends Any with GenIterableLike[A, Repr] with Equal
* @tparam B the element type of the returned $coll.
* @tparam That $thatinfo
* @param bf $bfinfo
- * @return a new $coll` which is a copy of this $coll with the element at position `index` replaced by `elem`.
+ * @return a new $coll which is a copy of this $coll with the element at position `index` replaced by `elem`.
* @throws IndexOutOfBoundsException if `index` does not satisfy `0 <= index < length`.
*
* @usecase def updated(index: Int, elem: A): $Coll[A]
diff --git a/src/library/scala/collection/convert/Wrappers.scala b/src/library/scala/collection/convert/Wrappers.scala
index c2da66a9bf..3edc5ba1b4 100644
--- a/src/library/scala/collection/convert/Wrappers.scala
+++ b/src/library/scala/collection/convert/Wrappers.scala
@@ -266,17 +266,11 @@ private[collection] trait Wrappers {
def +=(kv: (A, B)): this.type = { underlying.put(kv._1, kv._2); this }
def -=(key: A): this.type = { underlying remove key; this }
- override def put(k: A, v: B): Option[B] = {
- val r = underlying.put(k, v)
- if (r != null) Some(r) else None
- }
+ override def put(k: A, v: B): Option[B] = Option(underlying.put(k, v))
override def update(k: A, v: B) { underlying.put(k, v) }
- override def remove(k: A): Option[B] = {
- val r = underlying remove k
- if (r != null) Some(r) else None
- }
+ override def remove(k: A): Option[B] = Option(underlying remove k)
def iterator: Iterator[(A, B)] = new AbstractIterator[(A, B)] {
val ui = underlying.entrySet.iterator
@@ -327,25 +321,15 @@ private[collection] trait Wrappers {
* are not guaranteed to be atomic.
*/
case class JConcurrentMapWrapper[A, B](underlying: juc.ConcurrentMap[A, B]) extends mutable.AbstractMap[A, B] with JMapWrapperLike[A, B, JConcurrentMapWrapper[A, B]] with concurrent.Map[A, B] {
- override def get(k: A) = {
- val v = underlying get k
- if (v != null) Some(v)
- else None
- }
+ override def get(k: A) = Option(underlying get k)
override def empty = new JConcurrentMapWrapper(new juc.ConcurrentHashMap[A, B])
- def putIfAbsent(k: A, v: B): Option[B] = {
- val r = underlying.putIfAbsent(k, v)
- if (r != null) Some(r) else None
- }
+ def putIfAbsent(k: A, v: B): Option[B] = Option(underlying.putIfAbsent(k, v))
def remove(k: A, v: B): Boolean = underlying.remove(k, v)
- def replace(k: A, v: B): Option[B] = {
- val prev = underlying.replace(k, v)
- if (prev != null) Some(prev) else None
- }
+ def replace(k: A, v: B): Option[B] = Option(underlying.replace(k, v))
def replace(k: A, oldvalue: B, newvalue: B): Boolean =
underlying.replace(k, oldvalue, newvalue)
@@ -381,25 +365,16 @@ private[collection] trait Wrappers {
case class JDictionaryWrapper[A, B](underlying: ju.Dictionary[A, B]) extends mutable.AbstractMap[A, B] with mutable.Map[A, B] {
override def size: Int = underlying.size
- def get(k: A) = {
- val v = underlying get k
- if (v != null) Some(v) else None
- }
+ def get(k: A) = Option(underlying get k)
def +=(kv: (A, B)): this.type = { underlying.put(kv._1, kv._2); this }
def -=(key: A): this.type = { underlying remove key; this }
- override def put(k: A, v: B): Option[B] = {
- val r = underlying.put(k, v)
- if (r != null) Some(r) else None
- }
+ override def put(k: A, v: B): Option[B] = Option(underlying.put(k, v))
override def update(k: A, v: B) { underlying.put(k, v) }
- override def remove(k: A): Option[B] = {
- val r = underlying remove k
- if (r != null) Some(r) else None
- }
+ override def remove(k: A): Option[B] = Option(underlying remove k)
def iterator = enumerationAsScalaIterator(underlying.keys) map (k => (k, underlying get k))
diff --git a/src/library/scala/collection/immutable/Stream.scala b/src/library/scala/collection/immutable/Stream.scala
index 1d0d40a1d8..5989517532 100644
--- a/src/library/scala/collection/immutable/Stream.scala
+++ b/src/library/scala/collection/immutable/Stream.scala
@@ -1129,7 +1129,7 @@ object Stream extends SeqFactory[Stream] {
def #:::(prefix: Stream[A]): Stream[A] = prefix append tl
}
- /** A wrapper method that adds `#::` for cons and `#::: for concat as operations
+ /** A wrapper method that adds `#::` for cons and `#:::` for concat as operations
* to streams.
*/
implicit def consWrapper[A](stream: => Stream[A]): ConsWrapper[A] =
diff --git a/src/library/scala/compat/Platform.scala b/src/library/scala/compat/Platform.scala
index 4c82d6e15b..42dfcbfdde 100644
--- a/src/library/scala/compat/Platform.scala
+++ b/src/library/scala/compat/Platform.scala
@@ -41,7 +41,7 @@ object Platform {
* @throws java.lang.ArrayStoreException If either `src` or `dest` are not of type
* [java.lang.Array]; or if the element type of `src` is not
* compatible with that of `dest`.
- * @throws java.lang.IndexOutOfBoundsException If either srcPos` or `destPos` are
+ * @throws java.lang.IndexOutOfBoundsException If either `srcPos` or `destPos` are
* outside of the bounds of their respective arrays; or if `length`
* is negative; or if there are less than `length` elements available
* after `srcPos` or `destPos` in `src` and `dest` respectively.
diff --git a/src/library/scala/math/BigDecimal.scala b/src/library/scala/math/BigDecimal.scala
index 6bb35606a6..bb337e7a1d 100644
--- a/src/library/scala/math/BigDecimal.scala
+++ b/src/library/scala/math/BigDecimal.scala
@@ -124,7 +124,7 @@ object BigDecimal {
*/
def exact(s: String): BigDecimal = exact(new BigDec(s))
- /** Constructs a 'BigDecimal` that exactly represents the number
+ /** Constructs a `BigDecimal` that exactly represents the number
* specified in base 10 in a character array.
*/
def exact(cs: Array[Char]): BigDecimal = exact(new BigDec(cs))
diff --git a/src/library/scala/ref/WeakReference.scala b/src/library/scala/ref/WeakReference.scala
index 6ee40aed5c..9dcc0bbe5f 100644
--- a/src/library/scala/ref/WeakReference.scala
+++ b/src/library/scala/ref/WeakReference.scala
@@ -28,10 +28,7 @@ object WeakReference {
def apply[T <: AnyRef](value: T) = new WeakReference(value)
/** Optionally returns the referenced value, or `None` if that value no longer exists */
- def unapply[T <: AnyRef](wr: WeakReference[T]): Option[T] = {
- val x = wr.underlying.get
- if (x != null) Some(x) else None
- }
+ def unapply[T <: AnyRef](wr: WeakReference[T]): Option[T] = Option(wr.underlying.get)
}
/**
diff --git a/src/library/scala/reflect/Manifest.scala b/src/library/scala/reflect/Manifest.scala
index 2f7643bccf..4ff49c44d0 100644
--- a/src/library/scala/reflect/Manifest.scala
+++ b/src/library/scala/reflect/Manifest.scala
@@ -248,7 +248,7 @@ object ManifestFactory {
def arrayType[T](arg: Manifest[_]): Manifest[Array[T]] =
arg.asInstanceOf[Manifest[T]].arrayManifest
- /** Manifest for the abstract type `prefix # name'. `upperBound` is not
+ /** Manifest for the abstract type `prefix # name`. `upperBound` is not
* strictly necessary as it could be obtained by reflection. It was
* added so that erasure can be calculated without reflection. */
def abstractType[T](prefix: Manifest[_], name: String, upperBound: Predef.Class[_], args: Manifest[_]*): Manifest[T] =
@@ -269,7 +269,7 @@ object ManifestFactory {
(if (upperBound eq Nothing) "" else " <: "+upperBound)
}
- /** Manifest for the intersection type `parents_0 with ... with parents_n'. */
+ /** Manifest for the intersection type `parents_0 with ... with parents_n`. */
def intersectionType[T](parents: Manifest[_]*): Manifest[T] =
new Manifest[T] {
def runtimeClass = parents.head.runtimeClass
diff --git a/src/reflect/scala/reflect/api/Trees.scala b/src/reflect/scala/reflect/api/Trees.scala
index 2bf407ee19..a43195d9b6 100644
--- a/src/reflect/scala/reflect/api/Trees.scala
+++ b/src/reflect/scala/reflect/api/Trees.scala
@@ -143,7 +143,7 @@ trait Trees { self: Universe =>
/** Find all subtrees matching predicate `p`. Same as `withFilter` */
def filter(f: Tree => Boolean): List[Tree]
- /** Apply `pf' to each subtree on which the function is defined and collect the results.
+ /** Apply `pf` to each subtree on which the function is defined and collect the results.
*/
def collect[T](pf: PartialFunction[Tree, T]): List[T]
diff --git a/src/reflect/scala/reflect/api/TypeTags.scala b/src/reflect/scala/reflect/api/TypeTags.scala
index 7db375ca61..bc239ca870 100644
--- a/src/reflect/scala/reflect/api/TypeTags.scala
+++ b/src/reflect/scala/reflect/api/TypeTags.scala
@@ -53,7 +53,7 @@ import java.io.ObjectStreamException
* Each of these methods constructs a `TypeTag[T]` or `ClassTag[T]` for the given
* type argument `T`.
*
- * === #2 Using an implicit parameter of type `TypeTag[T]`, `ClassTag[T]`, or `WeakTypeTag[T]
+ * === #2 Using an implicit parameter of type `TypeTag[T]`, `ClassTag[T]`, or `WeakTypeTag[T]`
*
* For example:
* {{{
diff --git a/src/reflect/scala/reflect/internal/ExistentialsAndSkolems.scala b/src/reflect/scala/reflect/internal/ExistentialsAndSkolems.scala
index 0eeca4aace..3e18f88f80 100644
--- a/src/reflect/scala/reflect/internal/ExistentialsAndSkolems.scala
+++ b/src/reflect/scala/reflect/internal/ExistentialsAndSkolems.scala
@@ -110,7 +110,7 @@ trait ExistentialsAndSkolems {
/**
* Compute an existential type from hidden symbols `hidden` and type `tp`.
* @param hidden The symbols that will be existentially abstracted
- * @param hidden The original type
+ * @param tp The original type
* @param rawOwner The owner for Java raw types.
*/
final def packSymbols(hidden: List[Symbol], tp: Type, rawOwner: Symbol = NoSymbol): Type =
diff --git a/src/reflect/scala/reflect/internal/SymbolPairs.scala b/src/reflect/scala/reflect/internal/SymbolPairs.scala
index 4763e77a34..a52d2d8510 100644
--- a/src/reflect/scala/reflect/internal/SymbolPairs.scala
+++ b/src/reflect/scala/reflect/internal/SymbolPairs.scala
@@ -217,7 +217,7 @@ abstract class SymbolPairs {
bs(nshifted) |= nmask
}
- /** Implements `bs1 * bs2 * {0..n} != 0.
+ /** Implements `bs1 * bs2 * {0..n} != 0`.
* Used in hasCommonParentAsSubclass */
private def intersectionContainsElementLeq(bs1: BitSet, bs2: BitSet, n: Int): Boolean = {
val nshifted = n >> 5
diff --git a/src/reflect/scala/reflect/internal/TreeGen.scala b/src/reflect/scala/reflect/internal/TreeGen.scala
index 894038dd0a..5c8ae17f5b 100644
--- a/src/reflect/scala/reflect/internal/TreeGen.scala
+++ b/src/reflect/scala/reflect/internal/TreeGen.scala
@@ -594,13 +594,12 @@ abstract class TreeGen {
* TupleN(x_1, ..., x_N)
* } ...)
*
- * If any of the P_i are variable patterns, the corresponding `x_i @ P_i' is not generated
+ * If any of the P_i are variable patterns, the corresponding `x_i @ P_i` is not generated
* and the variable constituting P_i is used instead of x_i
*
- * @param mapName The name to be used for maps (either map or foreach)
- * @param flatMapName The name to be used for flatMaps (either flatMap or foreach)
* @param enums The enumerators in the for expression
- * @param body The body of the for expression
+ * @param sugarBody The body of the for expression
+ * @param fresh A source of new names
*/
def mkFor(enums: List[Tree], sugarBody: Tree)(implicit fresh: FreshNameCreator): Tree = {
val (mapName, flatMapName, body) = sugarBody match {
diff --git a/src/reflect/scala/reflect/internal/Types.scala b/src/reflect/scala/reflect/internal/Types.scala
index 9c681f3423..375218248e 100644
--- a/src/reflect/scala/reflect/internal/Types.scala
+++ b/src/reflect/scala/reflect/internal/Types.scala
@@ -739,7 +739,7 @@ trait Types
*
* `SubstThisAndSymMap` performs a breadth-first map over this type, which meant that
* symbol substitution occurred before `ThisType` substitution. Consequently, in substitution
- * of a `SingleType(ThisType(`from`), sym), symbols were rebound to `from` rather than `to`.
+ * of a `SingleType(ThisType(from), sym)`, symbols were rebound to `from` rather than `to`.
*/
def substThisAndSym(from: Symbol, to: Type, symsFrom: List[Symbol], symsTo: List[Symbol]): Type =
if (symsFrom eq symsTo) substThis(from, to)
@@ -763,7 +763,7 @@ trait Types
/** Apply `f` to each part of this type */
def foreach(f: Type => Unit) { new ForEachTypeTraverser(f).traverse(this) }
- /** Apply `pf' to each part of this type on which the function is defined */
+ /** Apply `pf` to each part of this type on which the function is defined */
def collect[T](pf: PartialFunction[Type, T]): List[T] = new CollectTypeCollector(pf).collect(this)
/** Apply `f` to each part of this type; children get mapped before their parents */
@@ -2059,7 +2059,7 @@ trait Types
/** SI-3731, SI-8177: when prefix is changed to `newPre`, maintain consistency of prefix and sym
* (where the symbol refers to a declaration "embedded" in the prefix).
*
- * @returns newSym so that `newPre` binds `sym.name` to `newSym`,
+ * @return newSym so that `newPre` binds `sym.name` to `newSym`,
* to remain consistent with `pre` previously binding `sym.name` to `sym`.
*
* `newSym` and `sym` are conceptually the same symbols, but some change to our `prefix`
diff --git a/src/reflect/scala/reflect/internal/pickling/UnPickler.scala b/src/reflect/scala/reflect/internal/pickling/UnPickler.scala
index 951c155de6..15e0f9cc14 100644
--- a/src/reflect/scala/reflect/internal/pickling/UnPickler.scala
+++ b/src/reflect/scala/reflect/internal/pickling/UnPickler.scala
@@ -168,7 +168,7 @@ abstract class UnPickler {
}
/** If entry at `i` is undefined, define it by performing
- * operation `op` with `readIndex at start of i'th
+ * operation `op` with `readIndex` at start of i'th
* entry. Restore `readIndex` afterwards.
*/
protected def at[T <: AnyRef](i: Int, op: () => T): T = {
diff --git a/src/reflect/scala/reflect/internal/util/AbstractFileClassLoader.scala b/src/reflect/scala/reflect/internal/util/AbstractFileClassLoader.scala
index 30dcbc21ca..5cbdb92664 100644
--- a/src/reflect/scala/reflect/internal/util/AbstractFileClassLoader.scala
+++ b/src/reflect/scala/reflect/internal/util/AbstractFileClassLoader.scala
@@ -12,7 +12,7 @@ import java.security.cert.Certificate
import java.security.{ ProtectionDomain, CodeSource }
import java.util.{ Collections => JCollections, Enumeration => JEnumeration }
-/** A class loader that loads files from a {@link scala.tools.nsc.io.AbstractFile}.
+/** A class loader that loads files from a [[scala.reflect.io.AbstractFile]].
*
* @author Lex Spoon
*/
diff --git a/src/reflect/scala/reflect/runtime/TwoWayCache.scala b/src/reflect/scala/reflect/runtime/TwoWayCache.scala
index d0fc3dac74..6c1ca5b571 100644
--- a/src/reflect/scala/reflect/runtime/TwoWayCache.scala
+++ b/src/reflect/scala/reflect/runtime/TwoWayCache.scala
@@ -26,8 +26,7 @@ private[runtime] class TwoWayCache[J, S] {
private object SomeRef {
def unapply[T](optRef: Option[WeakReference[T]]): Option[T] =
if (optRef.nonEmpty) {
- val result = optRef.get.get
- if (result != null) Some(result) else None
+ Option(optRef.get.get)
} else None
}
diff --git a/src/reflect/scala/reflect/runtime/TwoWayCaches.scala b/src/reflect/scala/reflect/runtime/TwoWayCaches.scala
index 6e2890e536..6ce0c0a728 100644
--- a/src/reflect/scala/reflect/runtime/TwoWayCaches.scala
+++ b/src/reflect/scala/reflect/runtime/TwoWayCaches.scala
@@ -26,8 +26,7 @@ private[runtime] trait TwoWayCaches { self: SymbolTable =>
private object SomeRef {
def unapply[T](optRef: Option[WeakReference[T]]): Option[T] =
if (optRef.nonEmpty) {
- val result = optRef.get.get
- if (result != null) Some(result) else None
+ Option(optRef.get.get)
} else None
}