summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/reflect/internal/Scopes.scala2
-rw-r--r--src/compiler/scala/reflect/internal/util/HashSet.scala2
-rw-r--r--src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala4
-rw-r--r--src/compiler/scala/tools/nsc/interactive/tests/core/AskCommand.scala10
-rw-r--r--src/compiler/scala/tools/nsc/interpreter/ReplTokens.scala5
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/RefChecks.scala1
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala10
-rw-r--r--src/compiler/scala/tools/nsc/util/JavaCharArrayReader.scala2
-rw-r--r--src/library/scala/collection/IndexedSeqLike.scala2
-rwxr-xr-xsrc/library/scala/collection/IndexedSeqOptimized.scala2
-rw-r--r--src/library/scala/collection/JavaConversions.scala14
-rw-r--r--src/library/scala/collection/LinearSeqLike.scala2
-rw-r--r--src/library/scala/collection/SeqLike.scala4
-rw-r--r--src/library/scala/collection/SetLike.scala2
-rw-r--r--src/library/scala/collection/immutable/ListMap.scala2
-rw-r--r--src/library/scala/collection/immutable/Stream.scala4
-rw-r--r--src/library/scala/collection/immutable/TrieIterator.scala2
-rw-r--r--src/library/scala/collection/immutable/Vector.scala2
-rw-r--r--src/library/scala/collection/mutable/Stack.scala7
-rw-r--r--src/library/scala/collection/parallel/ParSeqLike.scala2
-rw-r--r--src/library/scala/collection/parallel/immutable/ParHashMap.scala2
-rw-r--r--src/library/scala/collection/parallel/immutable/ParHashSet.scala2
-rw-r--r--src/library/scala/collection/parallel/immutable/ParVector.scala4
-rw-r--r--src/library/scala/collection/parallel/mutable/LazyCombiner.scala11
-rw-r--r--src/library/scala/collection/parallel/mutable/ParHashTable.scala2
-rw-r--r--src/library/scala/collection/parallel/mutable/ResizableParArrayCombiner.scala25
-rw-r--r--src/library/scala/collection/parallel/package.scala2
-rw-r--r--src/library/scala/io/Source.scala6
-rw-r--r--src/library/scala/ref/ReferenceWrapper.scala8
-rwxr-xr-xsrc/library/scala/reflect/generic/Trees.scala5
-rw-r--r--src/library/scala/util/matching/Regex.scala2
-rw-r--r--src/library/scala/xml/Utility.scala10
32 files changed, 62 insertions, 98 deletions
diff --git a/src/compiler/scala/reflect/internal/Scopes.scala b/src/compiler/scala/reflect/internal/Scopes.scala
index 7893e0eb3a..4db2cbf0d6 100644
--- a/src/compiler/scala/reflect/internal/Scopes.scala
+++ b/src/compiler/scala/reflect/internal/Scopes.scala
@@ -219,7 +219,7 @@ trait Scopes extends api.Scopes { self: SymbolTable =>
def lookupAll(name: Name): Iterator[Symbol] = new Iterator[Symbol] {
var e = lookupEntry(name)
def hasNext: Boolean = e ne null
- def next: Symbol = { val r = e.sym; e = lookupNextEntry(e); r }
+ def next(): Symbol = { val r = e.sym; e = lookupNextEntry(e); r }
}
/** lookup a symbol entry matching given name.
diff --git a/src/compiler/scala/reflect/internal/util/HashSet.scala b/src/compiler/scala/reflect/internal/util/HashSet.scala
index 7dc725773e..a771dad2b0 100644
--- a/src/compiler/scala/reflect/internal/util/HashSet.scala
+++ b/src/compiler/scala/reflect/internal/util/HashSet.scala
@@ -72,7 +72,7 @@ class HashSet[T >: Null <: AnyRef](val label: String, initialCapacity: Int) exte
while (i < table.length && (table(i) eq null)) i += 1
i < table.length
}
- def next: T =
+ def next(): T =
if (hasNext) { i += 1; table(i - 1).asInstanceOf[T] }
else null
}
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala
index a231a67049..d7e2d92837 100644
--- a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala
+++ b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala
@@ -449,8 +449,8 @@ abstract class GenJVM extends SubComponent with GenJVMUtil with GenAndroid with
var fieldList = List[String]()
for (f <- clasz.fields if f.symbol.hasGetter;
- val g = f.symbol.getter(c.symbol);
- val s = f.symbol.setter(c.symbol);
+ g = f.symbol.getter(c.symbol);
+ s = f.symbol.setter(c.symbol);
if g.isPublic && !(f.symbol.name startsWith "$")) // inserting $outer breaks the bean
fieldList = javaName(f.symbol) :: javaName(g) :: (if (s != NoSymbol) javaName(s) else null) :: fieldList
val methodList =
diff --git a/src/compiler/scala/tools/nsc/interactive/tests/core/AskCommand.scala b/src/compiler/scala/tools/nsc/interactive/tests/core/AskCommand.scala
index 166d312125..b65d069d94 100644
--- a/src/compiler/scala/tools/nsc/interactive/tests/core/AskCommand.scala
+++ b/src/compiler/scala/tools/nsc/interactive/tests/core/AskCommand.scala
@@ -61,7 +61,7 @@ trait AskParse extends AskCommand {
trait AskReload extends AskCommand {
/** Reload the given source files and wait for them to be reloaded. */
- def askReload(sources: Seq[SourceFile])(implicit reporter: Reporter): Response[Unit] = {
+ private[tests] def askReload(sources: Seq[SourceFile])(implicit reporter: Reporter): Response[Unit] = {
val sortedSources = (sources map (_.file.name)).sorted
reporter.println("reload: " + sortedSources.mkString(", "))
@@ -75,7 +75,7 @@ trait AskReload extends AskCommand {
trait AskCompletionAt extends AskCommand {
import compiler.Member
- def askCompletionAt(pos: Position)(implicit reporter: Reporter): Response[List[Member]] = {
+ private[tests] def askCompletionAt(pos: Position)(implicit reporter: Reporter): Response[List[Member]] = {
reporter.println("\naskTypeCompletion at " + pos.source.file.name + ((pos.line, pos.column)))
ask {
@@ -88,7 +88,7 @@ trait AskCompletionAt extends AskCommand {
trait AskTypeAt extends AskCommand {
import compiler.Tree
- def askTypeAt(pos: Position)(implicit reporter: Reporter): Response[Tree] = {
+ private[tests] def askTypeAt(pos: Position)(implicit reporter: Reporter): Response[Tree] = {
reporter.println("\naskType at " + pos.source.file.name + ((pos.line, pos.column)))
ask {
@@ -101,13 +101,13 @@ trait AskTypeAt extends AskCommand {
trait AskType extends AskCommand {
import compiler.Tree
- def askType(source: SourceFile, forceReload: Boolean)(implicit reporter: Reporter): Response[Tree] = {
+ private[tests] def askType(source: SourceFile, forceReload: Boolean)(implicit reporter: Reporter): Response[Tree] = {
ask {
compiler.askType(source, forceReload, _)
}
}
- def askType(sources: Seq[SourceFile], forceReload: Boolean)(implicit reporter: Reporter): Seq[Response[Tree]] = {
+ private[tests] def askType(sources: Seq[SourceFile], forceReload: Boolean)(implicit reporter: Reporter): Seq[Response[Tree]] = {
for(source <- sources) yield
askType(source, forceReload)
}
diff --git a/src/compiler/scala/tools/nsc/interpreter/ReplTokens.scala b/src/compiler/scala/tools/nsc/interpreter/ReplTokens.scala
index 4918e7133c..4c85f9b032 100644
--- a/src/compiler/scala/tools/nsc/interpreter/ReplTokens.scala
+++ b/src/compiler/scala/tools/nsc/interpreter/ReplTokens.scala
@@ -249,9 +249,8 @@ abstract class ReplTokens {
def prettyPrint(tokens: TraversableOnce[ReplToken]) {
val it = Iterator(Newline) ++ tokens.toIterator ++ Iterator(Newline) sliding 3 map { x =>
- (x: @unchecked) match {
- case List(x1, x2, x3) => ((x1, x2, x3))
- }
+ val List(x1, x2, x3) = x
+ ((x1, x2, x3))
}
prettyPrint(it)
}
diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
index 929f3cc6ad..8828889231 100644
--- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
@@ -1241,6 +1241,7 @@ abstract class RefChecks extends InfoTransform with reflect.internal.transform.R
private def lessAccessible(otherSym: Symbol, memberSym: Symbol): Boolean = (
(otherSym != NoSymbol)
+ && !otherSym.isProtected
&& !otherSym.isTypeParameterOrSkolem
&& !otherSym.isExistentiallyBound
&& (otherSym isLessAccessibleThan memberSym)
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index 5dd5b0b6be..c08519f005 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -1099,9 +1099,13 @@ trait Typers extends Modes with Adaptations {
case Apply(tree1, args) if (tree1 eq tree) && args.nonEmpty => // try handling the arguments
// println("typing args: "+args)
silent(_.typedArgs(args, mode)) match {
- case args: List[Tree] if args.forall(!_.containsError()) =>
- adaptToArguments(qual, name, args.asInstanceOf[List[Tree]], WildcardType)
- case _ =>
+ case xs: List[_] =>
+ val args = xs.asInstanceOf[List[Tree]]
+ if (args exists (_.containsError()))
+ reportError
+ else
+ adaptToArguments(qual, name, args, WildcardType)
+ case _ =>
reportError
}
case _ =>
diff --git a/src/compiler/scala/tools/nsc/util/JavaCharArrayReader.scala b/src/compiler/scala/tools/nsc/util/JavaCharArrayReader.scala
index 7d9433f4d3..0dd1f23570 100644
--- a/src/compiler/scala/tools/nsc/util/JavaCharArrayReader.scala
+++ b/src/compiler/scala/tools/nsc/util/JavaCharArrayReader.scala
@@ -58,7 +58,7 @@ class JavaCharArrayReader(buf: IndexedSeq[Char], start: Int, /* startline: int,
def last: Char = if (bp > start + 2) buf(bp - 2) else ' ' // XML literals
- def next: Char = {
+ def next(): Char = {
//cline = nextline
//ccol = nextcol
val buf = this.buf.asInstanceOf[collection.mutable.WrappedArray[Char]].array
diff --git a/src/library/scala/collection/IndexedSeqLike.scala b/src/library/scala/collection/IndexedSeqLike.scala
index 7e948208d2..96e9ca2dbb 100644
--- a/src/library/scala/collection/IndexedSeqLike.scala
+++ b/src/library/scala/collection/IndexedSeqLike.scala
@@ -58,7 +58,7 @@ trait IndexedSeqLike[+A, +Repr] extends SeqLike[A, Repr] {
def hasNext: Boolean = index < end
- def next: A = {
+ def next(): A = {
if (index >= end)
Iterator.empty.next
diff --git a/src/library/scala/collection/IndexedSeqOptimized.scala b/src/library/scala/collection/IndexedSeqOptimized.scala
index b9a60ae1f1..d5991eb9df 100755
--- a/src/library/scala/collection/IndexedSeqOptimized.scala
+++ b/src/library/scala/collection/IndexedSeqOptimized.scala
@@ -222,7 +222,7 @@ trait IndexedSeqOptimized[+A, +Repr] extends IndexedSeqLike[A, Repr] { self =>
def reverseIterator: Iterator[A] = new Iterator[A] {
private var i = self.length
def hasNext: Boolean = 0 < i
- def next: A =
+ def next(): A =
if (0 < i) {
i -= 1
self(i)
diff --git a/src/library/scala/collection/JavaConversions.scala b/src/library/scala/collection/JavaConversions.scala
index fad990e140..f929086062 100644
--- a/src/library/scala/collection/JavaConversions.scala
+++ b/src/library/scala/collection/JavaConversions.scala
@@ -465,8 +465,8 @@ object JavaConversions {
* @return A Scala mutable ConcurrentMap view of the argument.
*/
implicit def asScalaConcurrentMap[A, B](m: juc.ConcurrentMap[A, B]): mutable.ConcurrentMap[A, B] = m match {
- case cmw: ConcurrentMapWrapper[A, B] => cmw.underlying
- case _ => new JConcurrentMapWrapper(m)
+ case cmw: ConcurrentMapWrapper[a, b] => cmw.underlying
+ case _ => new JConcurrentMapWrapper(m)
}
/**
@@ -585,7 +585,7 @@ object JavaConversions {
elems.seq.foreach(ins.add(_))
}
def remove(i: Int) = underlying.remove(i)
- def clear = underlying.clear
+ def clear() = underlying.clear()
def result = this
}
@@ -600,8 +600,8 @@ object JavaConversions {
def remove = prev match {
case Some(e) =>
underlying match {
- case ms: mutable.Set[A] =>
- ms remove e.asInstanceOf[A]
+ case ms: mutable.Set[a] =>
+ ms remove e
prev = None
case _ =>
throw new UnsupportedOperationException("remove")
@@ -682,8 +682,8 @@ object JavaConversions {
prev match {
case Some(k) =>
underlying match {
- case mm: mutable.Map[A, _] =>
- mm remove k.asInstanceOf[A]
+ case mm: mutable.Map[a, _] =>
+ mm remove k
prev = None
case _ =>
throw new UnsupportedOperationException("remove")
diff --git a/src/library/scala/collection/LinearSeqLike.scala b/src/library/scala/collection/LinearSeqLike.scala
index 068c63432f..decb281a5f 100644
--- a/src/library/scala/collection/LinearSeqLike.scala
+++ b/src/library/scala/collection/LinearSeqLike.scala
@@ -50,7 +50,7 @@ trait LinearSeqLike[+A, +Repr <: LinearSeqLike[A, Repr]] extends SeqLike[A, Repr
def iterator: Iterator[A] = new Iterator[A] {
var these = self
def hasNext: Boolean = !these.isEmpty
- def next: A =
+ def next(): A =
if (hasNext) {
val result = these.head; these = these.tail; result
} else Iterator.empty.next
diff --git a/src/library/scala/collection/SeqLike.scala b/src/library/scala/collection/SeqLike.scala
index 3d7b0064d9..a0b595803b 100644
--- a/src/library/scala/collection/SeqLike.scala
+++ b/src/library/scala/collection/SeqLike.scala
@@ -148,7 +148,7 @@ trait SeqLike[+A, +Repr] extends IterableLike[A, Repr] with GenSeqLike[A, Repr]
private var _hasNext = true
def hasNext = _hasNext
- def next: Repr = {
+ def next(): Repr = {
if (!hasNext)
Iterator.empty.next
@@ -199,7 +199,7 @@ trait SeqLike[+A, +Repr] extends IterableLike[A, Repr] with GenSeqLike[A, Repr]
private var _hasNext = true
def hasNext = _hasNext
- def next: Repr = {
+ def next(): Repr = {
if (!hasNext)
Iterator.empty.next
diff --git a/src/library/scala/collection/SetLike.scala b/src/library/scala/collection/SetLike.scala
index fecbaa61f2..c657e6b243 100644
--- a/src/library/scala/collection/SetLike.scala
+++ b/src/library/scala/collection/SetLike.scala
@@ -213,7 +213,7 @@ self =>
idxs(len) = elms.size
def hasNext = _hasNext
- def next: This = {
+ def next(): This = {
if (!hasNext) Iterator.empty.next
val buf = self.newBuilder
diff --git a/src/library/scala/collection/immutable/ListMap.scala b/src/library/scala/collection/immutable/ListMap.scala
index 05a1cd2e8c..0933ef7c58 100644
--- a/src/library/scala/collection/immutable/ListMap.scala
+++ b/src/library/scala/collection/immutable/ListMap.scala
@@ -115,7 +115,7 @@ class ListMap[A, +B] extends Map[A, B] with MapLike[A, B, ListMap[A, B]] with Se
new Iterator[(A,B)] {
var self: ListMap[A,B] = ListMap.this
def hasNext = !self.isEmpty
- def next: (A,B) =
+ def next(): (A,B) =
if (!hasNext) throw new NoSuchElementException("next on empty iterator")
else { val res = (self.key, self.value); self = self.next; res }
}.toList.reverseIterator
diff --git a/src/library/scala/collection/immutable/Stream.scala b/src/library/scala/collection/immutable/Stream.scala
index fb77ce04a3..7fa973e82f 100644
--- a/src/library/scala/collection/immutable/Stream.scala
+++ b/src/library/scala/collection/immutable/Stream.scala
@@ -136,7 +136,7 @@ import Stream.cons
* val it3 = new Iterator[Int] {
* var i = -1
* def hasNext = true
- * def next: Int = { i += 1; i }
+ * def next(): Int = { i += 1; i }
* }
* loop("Iterator3: ", it3.next, it3)
* }}}
@@ -933,7 +933,7 @@ final class StreamIterator[+A](self: Stream[A]) extends Iterator[A] {
private var these = new LazyCell(self)
def hasNext: Boolean = these.v.nonEmpty
- def next: A =
+ def next(): A =
if (isEmpty) Iterator.empty.next
else {
val cur = these.v
diff --git a/src/library/scala/collection/immutable/TrieIterator.scala b/src/library/scala/collection/immutable/TrieIterator.scala
index c2cd0b2efd..7c36ed14ce 100644
--- a/src/library/scala/collection/immutable/TrieIterator.scala
+++ b/src/library/scala/collection/immutable/TrieIterator.scala
@@ -92,7 +92,7 @@ private[collection] abstract class TrieIterator[+T](elems: Array[Iterable[T]]) e
}
def hasNext = (subIter ne null) || depth >= 0
- def next: T = {
+ def next(): T = {
if (subIter ne null) {
val el = subIter.next
if (!subIter.hasNext)
diff --git a/src/library/scala/collection/immutable/Vector.scala b/src/library/scala/collection/immutable/Vector.scala
index 669c37174f..5c8046fa58 100644
--- a/src/library/scala/collection/immutable/Vector.scala
+++ b/src/library/scala/collection/immutable/Vector.scala
@@ -93,7 +93,7 @@ override def companion: GenericCompanion[Vector] = Vector
def reverseIterator: Iterator[A] = new Iterator[A] {
private var i = self.length
def hasNext: Boolean = 0 < i
- def next: A =
+ def next(): A =
if (0 < i) {
i -= 1
self(i)
diff --git a/src/library/scala/collection/mutable/Stack.scala b/src/library/scala/collection/mutable/Stack.scala
index 0b3852fe61..bd180fc0b4 100644
--- a/src/library/scala/collection/mutable/Stack.scala
+++ b/src/library/scala/collection/mutable/Stack.scala
@@ -26,11 +26,8 @@ object Stack extends SeqFactory[Stack] {
class StackBuilder[A] extends Builder[A, Stack[A]] {
val lbuff = new ListBuffer[A]
def +=(elem: A) = { lbuff += elem; this }
- def clear = lbuff.clear
- def result = {
- val lst = lbuff.result
- new Stack(lst)
- }
+ def clear() = lbuff.clear()
+ def result = new Stack(lbuff.result)
}
implicit def canBuildFrom[A]: CanBuildFrom[Coll, A, Stack[A]] = ReusableCBF.asInstanceOf[GenericCanBuildFrom[A]]
diff --git a/src/library/scala/collection/parallel/ParSeqLike.scala b/src/library/scala/collection/parallel/ParSeqLike.scala
index bb14e35f4f..d0f38b30dc 100644
--- a/src/library/scala/collection/parallel/ParSeqLike.scala
+++ b/src/library/scala/collection/parallel/ParSeqLike.scala
@@ -96,7 +96,7 @@ self =>
def hasNext = i < end
- def next: T = if (i < end) {
+ def next(): T = if (i < end) {
val x = self(i)
i += 1
x
diff --git a/src/library/scala/collection/parallel/immutable/ParHashMap.scala b/src/library/scala/collection/parallel/immutable/ParHashMap.scala
index 85084a945f..1fec522a93 100644
--- a/src/library/scala/collection/parallel/immutable/ParHashMap.scala
+++ b/src/library/scala/collection/parallel/immutable/ParHashMap.scala
@@ -103,7 +103,7 @@ self =>
val (fp, sp) = buff.splitAt(buff.length / 2)
Seq(fp, sp) map { b => new ParHashMapIterator(b.iterator, b.length) with SCPI }
}
- def next: (K, V) = {
+ def next(): (K, V) = {
i += 1
val r = triter.next
r
diff --git a/src/library/scala/collection/parallel/immutable/ParHashSet.scala b/src/library/scala/collection/parallel/immutable/ParHashSet.scala
index 76c6cea5c1..8332167b90 100644
--- a/src/library/scala/collection/parallel/immutable/ParHashSet.scala
+++ b/src/library/scala/collection/parallel/immutable/ParHashSet.scala
@@ -100,7 +100,7 @@ self =>
val (fp, sp) = buff.splitAt(buff.length / 2)
Seq(fp, sp) map { b => new ParHashSetIterator(b.iterator, b.length) with SCPI }
}
- def next: T = {
+ def next(): T = {
i += 1
triter.next
}
diff --git a/src/library/scala/collection/parallel/immutable/ParVector.scala b/src/library/scala/collection/parallel/immutable/ParVector.scala
index d1cf3d58ec..fdeaefc3ff 100644
--- a/src/library/scala/collection/parallel/immutable/ParVector.scala
+++ b/src/library/scala/collection/parallel/immutable/ParVector.scala
@@ -114,8 +114,8 @@ private[immutable] class LazyParVectorCombiner[T] extends Combiner[T, ParVector[
this
}
- def clear = {
- vectors.clear
+ def clear() = {
+ vectors.clear()
vectors += new VectorBuilder[T]
sz = 0
}
diff --git a/src/library/scala/collection/parallel/mutable/LazyCombiner.scala b/src/library/scala/collection/parallel/mutable/LazyCombiner.scala
index def6fa7742..3694f40477 100644
--- a/src/library/scala/collection/parallel/mutable/LazyCombiner.scala
+++ b/src/library/scala/collection/parallel/mutable/LazyCombiner.scala
@@ -8,17 +8,11 @@
package scala.collection.parallel.mutable
-
-
-
import scala.collection.generic.Growable
import scala.collection.generic.Sizing
import scala.collection.mutable.ArrayBuffer
import scala.collection.parallel.Combiner
-
-
-
/** Implements combining contents of two combiners
* by postponing the operation until `result` method is called. It chains
* the leaf results together instead of evaluating the actual collection.
@@ -27,14 +21,13 @@ import scala.collection.parallel.Combiner
* @tparam To the type of the collection the combiner produces
* @tparam Buff the type of the buffers that contain leaf results and this combiner chains together
*/
-trait LazyCombiner[Elem, +To, Buff <: Growable[Elem] with Sizing] extends Combiner[Elem, To]
-{
+trait LazyCombiner[Elem, +To, Buff <: Growable[Elem] with Sizing] extends Combiner[Elem, To] {
//self: collection.parallel.EnvironmentPassingCombiner[Elem, To] =>
val chain: ArrayBuffer[Buff]
val lastbuff = chain.last
def +=(elem: Elem) = { lastbuff += elem; this }
def result: To = allocateAndCopy
- def clear = { chain.clear }
+ def clear() = { chain.clear() }
def combine[N <: Elem, NewTo >: To](other: Combiner[N, NewTo]): Combiner[N, NewTo] = if (this ne other) {
if (other.isInstanceOf[LazyCombiner[_, _, _]]) {
val that = other.asInstanceOf[LazyCombiner[Elem, To, Buff]]
diff --git a/src/library/scala/collection/parallel/mutable/ParHashTable.scala b/src/library/scala/collection/parallel/mutable/ParHashTable.scala
index e5c0be36a1..9b8e233b95 100644
--- a/src/library/scala/collection/parallel/mutable/ParHashTable.scala
+++ b/src/library/scala/collection/parallel/mutable/ParHashTable.scala
@@ -42,7 +42,7 @@ trait ParHashTable[K, Entry >: Null <: HashEntry[K, Entry]] extends collection.m
es ne null
}
- def next: T = {
+ def next(): T = {
val res = es
es = es.next
scan()
diff --git a/src/library/scala/collection/parallel/mutable/ResizableParArrayCombiner.scala b/src/library/scala/collection/parallel/mutable/ResizableParArrayCombiner.scala
index 2cb0f541d8..eadc93d422 100644
--- a/src/library/scala/collection/parallel/mutable/ResizableParArrayCombiner.scala
+++ b/src/library/scala/collection/parallel/mutable/ResizableParArrayCombiner.scala
@@ -8,8 +8,6 @@
package scala.collection.parallel.mutable
-
-
import scala.collection.generic.Sizing
import scala.collection.mutable.ArraySeq
import scala.collection.mutable.ArrayBuffer
@@ -18,12 +16,8 @@ import scala.collection.parallel.TaskSupport
import scala.collection.parallel.unsupportedop
import scala.collection.parallel.Combiner
-
-
/** An array combiner that uses a chain of arraybuffers to store elements. */
-trait ResizableParArrayCombiner[T]
-extends LazyCombiner[T, ParArray[T], ExposedArrayBuffer[T]]
-{
+trait ResizableParArrayCombiner[T] extends LazyCombiner[T, ParArray[T], ExposedArrayBuffer[T]] {
//self: EnvironmentPassingCombiner[T, ParArray[T]] =>
import collection.parallel.tasksupport._
@@ -40,8 +34,7 @@ extends LazyCombiner[T, ParArray[T], ExposedArrayBuffer[T]]
new ParArray(arrayseq)
} else { // optimisation if there is only 1 array
- val pa = new ParArray(new ExposedArraySeq[T](chain(0).internalArray, size))
- pa
+ new ParArray(new ExposedArraySeq[T](chain(0).internalArray, size))
}
override def toString = "ResizableParArrayCombiner(" + size + "): " //+ chain
@@ -88,25 +81,11 @@ extends LazyCombiner[T, ParArray[T], ExposedArrayBuffer[T]]
}
def shouldSplitFurther = howmany > collection.parallel.thresholdFromSize(size, parallelismLevel)
}
-
}
-
object ResizableParArrayCombiner {
def apply[T](c: ArrayBuffer[ExposedArrayBuffer[T]]): ResizableParArrayCombiner[T] = {
new { val chain = c } with ResizableParArrayCombiner[T] // was: with EnvironmentPassingCombiner[T, ParArray[T]]
}
def apply[T](): ResizableParArrayCombiner[T] = apply(new ArrayBuffer[ExposedArrayBuffer[T]] += new ExposedArrayBuffer[T])
}
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/library/scala/collection/parallel/package.scala b/src/library/scala/collection/parallel/package.scala
index e22d34b4c2..36dfff4c4c 100644
--- a/src/library/scala/collection/parallel/package.scala
+++ b/src/library/scala/collection/parallel/package.scala
@@ -190,7 +190,7 @@ package parallel {
def size = sz
- def clear = {
+ def clear() = {
buckets = new Array[UnrolledBuffer[Buck]](bucketnumber)
sz = 0
}
diff --git a/src/library/scala/io/Source.scala b/src/library/scala/io/Source.scala
index 6a96d6f285..3c2df1b9b8 100644
--- a/src/library/scala/io/Source.scala
+++ b/src/library/scala/io/Source.scala
@@ -228,7 +228,7 @@ abstract class Source extends Iterator[Char] {
/** Returns next character.
*/
- def next: Char = positioner.next
+ def next(): Char = positioner.next
class Positioner(encoder: Position) {
def this() = this(RelaxedPosition)
@@ -245,7 +245,7 @@ abstract class Source extends Iterator[Char] {
/** default col increment for tabs '\t', set to 4 initially */
var tabinc = 4
- def next: Char = {
+ def next(): Char = {
ch = iter.next
pos = encoder.encode(cline, ccol)
ch match {
@@ -268,7 +268,7 @@ abstract class Source extends Iterator[Char] {
}
object RelaxedPositioner extends Positioner(RelaxedPosition) { }
object NoPositioner extends Positioner(Position) {
- override def next: Char = iter.next
+ override def next(): Char = iter.next
}
def ch = positioner.ch
def pos = positioner.pos
diff --git a/src/library/scala/ref/ReferenceWrapper.scala b/src/library/scala/ref/ReferenceWrapper.scala
index 868d96c84d..2d8099970f 100644
--- a/src/library/scala/ref/ReferenceWrapper.scala
+++ b/src/library/scala/ref/ReferenceWrapper.scala
@@ -14,19 +14,15 @@ package scala.ref
*/
trait ReferenceWrapper[+T <: AnyRef] extends Reference[T] with Proxy {
val underlying: java.lang.ref.Reference[_ <: T]
- override def get = {
- val ret = underlying.get
- if (ret eq null) None else Some(ret)
- }
+ override def get = Option(underlying.get)
def apply() = {
val ret = underlying.get
if (ret eq null) throw new NoSuchElementException
ret
}
- def clear = underlying.clear
+ def clear() = underlying.clear()
def enqueue = underlying.enqueue
def isEnqueued = underlying.isEnqueued
-
def self = underlying
}
diff --git a/src/library/scala/reflect/generic/Trees.scala b/src/library/scala/reflect/generic/Trees.scala
index 5940ebf23e..a094e33e7c 100755
--- a/src/library/scala/reflect/generic/Trees.scala
+++ b/src/library/scala/reflect/generic/Trees.scala
@@ -539,8 +539,9 @@ import Flags._
;
case Literal(_) =>
;
- case TypeTree() =>
- ;
+ // commented out to eliminate warning - this file destined for removal anyway
+ // case TypeTree() =>
+ // ;
case SingletonTypeTree(ref) =>
traverse(ref)
case SelectFromTypeTree(qualifier, selector) =>
diff --git a/src/library/scala/util/matching/Regex.scala b/src/library/scala/util/matching/Regex.scala
index 3bf81b17e0..12b4ad84bf 100644
--- a/src/library/scala/util/matching/Regex.scala
+++ b/src/library/scala/util/matching/Regex.scala
@@ -514,7 +514,7 @@ object Regex {
}
/** The next matched substring of `source` */
- def next: String = {
+ def next(): String = {
if (!hasNext) throw new NoSuchElementException
nextSeen = false
matcher.group
diff --git a/src/library/scala/xml/Utility.scala b/src/library/scala/xml/Utility.scala
index a96533e793..4d6712419c 100644
--- a/src/library/scala/xml/Utility.scala
+++ b/src/library/scala/xml/Utility.scala
@@ -258,14 +258,8 @@ object Utility extends AnyRef with parsing.TokenTests {
* @param attribHashCode
* @param children
*/
- def hashCode(pre: String, label: String, attribHashCode: Int, scpeHash: Int, children: Seq[Node]) = {
- val h = new util.MurmurHash[Node](pre.##)
- h.append(label.##)
- h.append(attribHashCode)
- h.append(scpeHash)
- children.foreach(h)
- h.hash
- }
+ def hashCode(pre: String, label: String, attribHashCode: Int, scpeHash: Int, children: Seq[Node]) =
+ scala.util.MurmurHash3.traversableHash(label +: attribHashCode +: scpeHash +: children, pre.##)
def appendQuoted(s: String): String = sbToString(appendQuoted(s, _))