diff options
Diffstat (limited to 'src')
24 files changed, 71 insertions, 71 deletions
diff --git a/src/library/scala/Array.scala b/src/library/scala/Array.scala index 1848127395..6ab82d998e 100644 --- a/src/library/scala/Array.scala +++ b/src/library/scala/Array.scala @@ -399,7 +399,7 @@ object Array extends FallbackArrayBuilding { def range(start: Int, end: Int, step: Int): Array[Int] = { if (step == 0) throw new IllegalArgumentException("zero step") val b = newBuilder[Int] - b.sizeHint(immutable.Range.count(start, end, step, false)) + b.sizeHint(immutable.Range.count(start, end, step, isInclusive = false)) var i = start while (if (step < 0) end < i else i < end) { diff --git a/src/library/scala/collection/SeqLike.scala b/src/library/scala/collection/SeqLike.scala index 307ee3f2a8..a83a6fe6a1 100644 --- a/src/library/scala/collection/SeqLike.scala +++ b/src/library/scala/collection/SeqLike.scala @@ -335,7 +335,7 @@ trait SeqLike[+A, +Repr] extends Any with IterableLike[A, Repr] with GenSeqLike[ if (from > l) -1 else if (tl < 1) clippedFrom else if (l < tl) -1 - else SeqLike.kmpSearch(thisCollection, clippedFrom, l, that.seq, 0, tl, true) + else SeqLike.kmpSearch(thisCollection, clippedFrom, l, that.seq, 0, tl, forward = true) } else { var i = from @@ -372,7 +372,7 @@ trait SeqLike[+A, +Repr] extends Any with IterableLike[A, Repr] with GenSeqLike[ if (end < 0) -1 else if (tl < 1) clippedL else if (l < tl) -1 - else SeqLike.kmpSearch(thisCollection, 0, clippedL+tl, that.seq, 0, tl, false) + else SeqLike.kmpSearch(thisCollection, 0, clippedL+tl, that.seq, 0, tl, forward = false) } /** Tests whether this $coll contains a given sequence as a slice. @@ -778,7 +778,7 @@ object SeqLike { case _ => // We had better not index into S directly! val iter = S.iterator.drop(m0) - val Wopt = kmpOptimizeWord(W, n0, n1, true) + val Wopt = kmpOptimizeWord(W, n0, n1, forward = true) val T = kmpJumpTable(Wopt, n1-n0) val cache = new Array[AnyRef](n1-n0) // Ring buffer--need a quick way to do a look-behind var largest = 0 @@ -851,7 +851,7 @@ object SeqLike { else if (s1 - s0 < t1 - t0) -1 // Source is too short to find target else { // Nontrivial search - val ans = kmpSearch(source, s0, s1, target, t0, t1, true) + val ans = kmpSearch(source, s0, s1, target, t0, t1, forward = true) if (ans < 0) ans else ans - math.min(slen, sourceOffset) } } @@ -883,7 +883,7 @@ object SeqLike { else if (fixed_s1 - s0 < t1 - t0) -1 // Source is too short to find target else { // Nontrivial search - val ans = kmpSearch(source, s0, fixed_s1, target, t0, t1, false) + val ans = kmpSearch(source, s0, fixed_s1, target, t0, t1, forward = false) if (ans < 0) ans else ans - s0 } } diff --git a/src/library/scala/collection/concurrent/TrieMap.scala b/src/library/scala/collection/concurrent/TrieMap.scala index 491770dcf6..4eeacd7377 100644 --- a/src/library/scala/collection/concurrent/TrieMap.scala +++ b/src/library/scala/collection/concurrent/TrieMap.scala @@ -41,7 +41,7 @@ private[collection] final class INode[K, V](bn: MainNode[K, V], g: Gen) extends @tailrec private def GCAS_Complete(m: MainNode[K, V], ct: TrieMap[K, V]): MainNode[K, V] = if (m eq null) null else { // complete the GCAS val prev = /*READ*/m.prev - val ctr = ct.readRoot(true) + val ctr = ct.readRoot(abort = true) prev match { case null => @@ -723,7 +723,7 @@ extends scala.collection.concurrent.Map[K, V] private def RDCSS_ROOT(ov: INode[K, V], expectedmain: MainNode[K, V], nv: INode[K, V]): Boolean = { val desc = RDCSS_Descriptor(ov, expectedmain, nv) if (CAS_ROOT(ov, desc)) { - RDCSS_Complete(false) + RDCSS_Complete(abort = false) /*READ*/desc.committed } else false } @@ -1027,7 +1027,7 @@ private[collection] class TrieMapIterator[K, V](var level: Int, private var ct: val (arr1, arr2) = stack(d).drop(stackpos(d) + 1).splitAt(rem / 2) stack(d) = arr1 stackpos(d) = -1 - val it = newIterator(level + 1, ct, false) + val it = newIterator(level + 1, ct, _mustInit = false) it.stack(0) = arr2 it.stackpos(0) = -1 it.depth = 0 diff --git a/src/library/scala/collection/generic/GenTraversableFactory.scala b/src/library/scala/collection/generic/GenTraversableFactory.scala index 0b8c9835da..0e1a5534c0 100644 --- a/src/library/scala/collection/generic/GenTraversableFactory.scala +++ b/src/library/scala/collection/generic/GenTraversableFactory.scala @@ -216,7 +216,7 @@ extends GenericCompanion[CC] { if (step == zero) throw new IllegalArgumentException("zero step") val b = newBuilder[T] - b sizeHint immutable.NumericRange.count(start, end, step, false) + b sizeHint immutable.NumericRange.count(start, end, step, isInclusive = false) var i = start while (if (step < zero) end < i else i < end) { b += i diff --git a/src/library/scala/collection/immutable/Range.scala b/src/library/scala/collection/immutable/Range.scala index 480c88ddcf..243e3fcb91 100644 --- a/src/library/scala/collection/immutable/Range.scala +++ b/src/library/scala/collection/immutable/Range.scala @@ -332,7 +332,7 @@ object Range { } } def count(start: Int, end: Int, step: Int): Int = - count(start, end, step, false) + count(start, end, step, isInclusive = false) class Inclusive(start: Int, end: Int, step: Int) extends Range(start, end, step) { // override def par = new ParRange(this) diff --git a/src/library/scala/collection/immutable/RedBlackTree.scala b/src/library/scala/collection/immutable/RedBlackTree.scala index 19414f8e10..37b8ecfbc4 100644 --- a/src/library/scala/collection/immutable/RedBlackTree.scala +++ b/src/library/scala/collection/immutable/RedBlackTree.scala @@ -48,7 +48,7 @@ object RedBlackTree { * Count all the nodes with keys greater than or equal to the lower bound and less than the upper bound. * The two bounds are optional. */ - def countInRange[A](tree: Tree[A, _], from: Option[A], to:Option[A])(implicit ordering: Ordering[A]) : Int = + def countInRange[A](tree: Tree[A, _], from: Option[A], to:Option[A])(implicit ordering: Ordering[A]) : Int = if (tree eq null) 0 else (from, to) match { // with no bounds use this node's count @@ -61,7 +61,7 @@ object RedBlackTree { // right will all be greater than or equal to the lower bound. So 1 for this node plus // count the subtrees by stripping off the bounds that we don't need any more case _ => 1 + countInRange(tree.left, from, None) + countInRange(tree.right, None, to) - + } def update[A: Ordering, B, B1 >: B](tree: Tree[A, B], k: A, v: B1, overwrite: Boolean): Tree[A, B1] = blacken(upd(tree, k, v, overwrite)) def delete[A: Ordering, B](tree: Tree[A, B], k: A): Tree[A, B] = blacken(del(tree, k)) @@ -252,7 +252,7 @@ object RedBlackTree { if (ordering.lt(tree.key, from)) return doFrom(tree.right, from) val newLeft = doFrom(tree.left, from) if (newLeft eq tree.left) tree - else if (newLeft eq null) upd(tree.right, tree.key, tree.value, false) + else if (newLeft eq null) upd(tree.right, tree.key, tree.value, overwrite = false) else rebalance(tree, newLeft, tree.right) } private[this] def doTo[A, B](tree: Tree[A, B], to: A)(implicit ordering: Ordering[A]): Tree[A, B] = { @@ -260,7 +260,7 @@ object RedBlackTree { if (ordering.lt(to, tree.key)) return doTo(tree.left, to) val newRight = doTo(tree.right, to) if (newRight eq tree.right) tree - else if (newRight eq null) upd(tree.left, tree.key, tree.value, false) + else if (newRight eq null) upd(tree.left, tree.key, tree.value, overwrite = false) else rebalance(tree, tree.left, newRight) } private[this] def doUntil[A, B](tree: Tree[A, B], until: A)(implicit ordering: Ordering[A]): Tree[A, B] = { @@ -268,7 +268,7 @@ object RedBlackTree { if (ordering.lteq(until, tree.key)) return doUntil(tree.left, until) val newRight = doUntil(tree.right, until) if (newRight eq tree.right) tree - else if (newRight eq null) upd(tree.left, tree.key, tree.value, false) + else if (newRight eq null) upd(tree.left, tree.key, tree.value, overwrite = false) else rebalance(tree, tree.left, newRight) } private[this] def doRange[A, B](tree: Tree[A, B], from: A, until: A)(implicit ordering: Ordering[A]): Tree[A, B] = { @@ -278,8 +278,8 @@ object RedBlackTree { val newLeft = doFrom(tree.left, from) val newRight = doUntil(tree.right, until) if ((newLeft eq tree.left) && (newRight eq tree.right)) tree - else if (newLeft eq null) upd(newRight, tree.key, tree.value, false) - else if (newRight eq null) upd(newLeft, tree.key, tree.value, false) + else if (newLeft eq null) upd(newRight, tree.key, tree.value, overwrite = false) + else if (newRight eq null) upd(newLeft, tree.key, tree.value, overwrite = false) else rebalance(tree, newLeft, newRight) } @@ -290,7 +290,7 @@ object RedBlackTree { if (n > count) return doDrop(tree.right, n - count - 1) val newLeft = doDrop(tree.left, n) if (newLeft eq tree.left) tree - else if (newLeft eq null) updNth(tree.right, n - count - 1, tree.key, tree.value, false) + else if (newLeft eq null) updNth(tree.right, n - count - 1, tree.key, tree.value, overwrite = false) else rebalance(tree, newLeft, tree.right) } private[this] def doTake[A, B](tree: Tree[A, B], n: Int): Tree[A, B] = { @@ -300,7 +300,7 @@ object RedBlackTree { if (n <= count) return doTake(tree.left, n) val newRight = doTake(tree.right, n - count - 1) if (newRight eq tree.right) tree - else if (newRight eq null) updNth(tree.left, n, tree.key, tree.value, false) + else if (newRight eq null) updNth(tree.left, n, tree.key, tree.value, overwrite = false) else rebalance(tree, tree.left, newRight) } private[this] def doSlice[A, B](tree: Tree[A, B], from: Int, until: Int): Tree[A, B] = { @@ -311,8 +311,8 @@ object RedBlackTree { val newLeft = doDrop(tree.left, from) val newRight = doTake(tree.right, until - count - 1) if ((newLeft eq tree.left) && (newRight eq tree.right)) tree - else if (newLeft eq null) updNth(newRight, from - count - 1, tree.key, tree.value, false) - else if (newRight eq null) updNth(newLeft, until, tree.key, tree.value, false) + else if (newLeft eq null) updNth(newRight, from - count - 1, tree.key, tree.value, overwrite = false) + else if (newRight eq null) updNth(newLeft, until, tree.key, tree.value, overwrite = false) else rebalance(tree, newLeft, newRight) } @@ -501,28 +501,28 @@ object RedBlackTree { } private[this] var index = 0 private[this] var lookahead: Tree[A, B] = start map startFrom getOrElse findLeftMostOrPopOnEmpty(root) - + /** - * Find the leftmost subtree whose key is equal to the given key, or if no such thing, + * Find the leftmost subtree whose key is equal to the given key, or if no such thing, * the leftmost subtree with the key that would be "next" after it according * to the ordering. Along the way build up the iterator's path stack so that "next" * functionality works. */ private[this] def startFrom(key: A) : Tree[A,B] = if (root eq null) null else { - @tailrec def find(tree: Tree[A, B]): Tree[A, B] = + @tailrec def find(tree: Tree[A, B]): Tree[A, B] = if (tree eq null) popNext() else find( if (ordering.lteq(key, tree.key)) goLeft(tree) else goRight(tree) - ) + ) find(root) } - + private[this] def goLeft(tree: Tree[A, B]) = { pushNext(tree) tree.left } - + private[this] def goRight(tree: Tree[A, B]) = tree.right } diff --git a/src/library/scala/collection/immutable/TreeMap.scala b/src/library/scala/collection/immutable/TreeMap.scala index 1093177172..5085039da5 100644 --- a/src/library/scala/collection/immutable/TreeMap.scala +++ b/src/library/scala/collection/immutable/TreeMap.scala @@ -128,7 +128,7 @@ class TreeMap[A, +B] private (tree: RB.Tree[A, B])(implicit val ordering: Orderi * @param value the value to be associated with `key` * @return a new $coll with the updated binding */ - override def updated [B1 >: B](key: A, value: B1): TreeMap[A, B1] = new TreeMap(RB.update(tree, key, value, true)) + override def updated [B1 >: B](key: A, value: B1): TreeMap[A, B1] = new TreeMap(RB.update(tree, key, value, overwrite = true)) /** Add a key/value pair to this map. * @tparam B1 type of the value of the new binding, a supertype of `B` @@ -168,7 +168,7 @@ class TreeMap[A, +B] private (tree: RB.Tree[A, B])(implicit val ordering: Orderi */ def insert [B1 >: B](key: A, value: B1): TreeMap[A, B1] = { assert(!RB.contains(tree, key)) - new TreeMap(RB.update(tree, key, value, true)) + new TreeMap(RB.update(tree, key, value, overwrite = true)) } def - (key:A): TreeMap[A, B] = diff --git a/src/library/scala/collection/immutable/TreeSet.scala b/src/library/scala/collection/immutable/TreeSet.scala index 26c3d44bbb..e25d16408a 100644 --- a/src/library/scala/collection/immutable/TreeSet.scala +++ b/src/library/scala/collection/immutable/TreeSet.scala @@ -109,7 +109,7 @@ class TreeSet[A] private (tree: RB.Tree[A, Unit])(implicit val ordering: Orderin * @param elem a new element to add. * @return a new $coll containing `elem` and all the elements of this $coll. */ - def + (elem: A): TreeSet[A] = newSet(RB.update(tree, elem, (), false)) + def + (elem: A): TreeSet[A] = newSet(RB.update(tree, elem, (), overwrite = false)) /** A new `TreeSet` with the entry added is returned, * assuming that elem is <em>not</em> in the TreeSet. @@ -119,7 +119,7 @@ class TreeSet[A] private (tree: RB.Tree[A, Unit])(implicit val ordering: Orderin */ def insert(elem: A): TreeSet[A] = { assert(!RB.contains(tree, elem)) - newSet(RB.update(tree, elem, (), false)) + newSet(RB.update(tree, elem, (), overwrite = false)) } /** Creates a new `TreeSet` with the entry removed. diff --git a/src/library/scala/collection/mutable/FlatHashTable.scala b/src/library/scala/collection/mutable/FlatHashTable.scala index 2ca12549ef..49a9427588 100644 --- a/src/library/scala/collection/mutable/FlatHashTable.scala +++ b/src/library/scala/collection/mutable/FlatHashTable.scala @@ -230,7 +230,7 @@ trait FlatHashTable[A] extends FlatHashTable.HashUtils[A] { private def checkConsistent() { for (i <- 0 until table.length) if (table(i) != null && !containsElem(entryToElem(table(i)))) - assert(false, i+" "+table(i)+" "+table.mkString) + assert(assertion = false, i+" "+table(i)+" "+table.mkString) } diff --git a/src/library/scala/collection/mutable/TreeSet.scala b/src/library/scala/collection/mutable/TreeSet.scala index 9113d8221b..147bc85383 100644 --- a/src/library/scala/collection/mutable/TreeSet.scala +++ b/src/library/scala/collection/mutable/TreeSet.scala @@ -67,7 +67,7 @@ class TreeSet[A] private (treeRef: ObjectRef[RB.Tree[A, Null]], from: Option[A], } override def +=(elem: A): this.type = { - treeRef.elem = RB.update(treeRef.elem, elem, null, false) + treeRef.elem = RB.update(treeRef.elem, elem, null, overwrite = false) this } diff --git a/src/library/scala/collection/parallel/ParIterableLike.scala b/src/library/scala/collection/parallel/ParIterableLike.scala index f0b0fd2aa0..961556faff 100644 --- a/src/library/scala/collection/parallel/ParIterableLike.scala +++ b/src/library/scala/collection/parallel/ParIterableLike.scala @@ -823,7 +823,7 @@ self: ParIterableLike[T, Repr, Sequential] => tasksupport.executeAndWaitResult(new Zip(combinerFactory(() => bf(repr).asCombiner), splitter, thatseq.splitter) mapResult { _.resultWithTaskSupport }) } else setTaskSupport(seq.zip(that)(bf2seq(bf)), tasksupport) - def zipWithIndex[U >: T, That](implicit bf: CanBuildFrom[Repr, (U, Int), That]): That = this zip immutable.ParRange(0, size, 1, false) + def zipWithIndex[U >: T, That](implicit bf: CanBuildFrom[Repr, (U, Int), That]): That = this zip immutable.ParRange(0, size, 1, inclusive = false) def zipAll[S, U >: T, That](that: GenIterable[S], thisElem: U, thatElem: S)(implicit bf: CanBuildFrom[Repr, (U, S), That]): That = if (bf(repr).isCombiner && that.isParSeq) { val thatseq = that.asParSeq diff --git a/src/library/scala/collection/parallel/ParIterableViewLike.scala b/src/library/scala/collection/parallel/ParIterableViewLike.scala index aaf83e49af..0567e7b396 100644 --- a/src/library/scala/collection/parallel/ParIterableViewLike.scala +++ b/src/library/scala/collection/parallel/ParIterableViewLike.scala @@ -131,7 +131,7 @@ self => override def zip[U >: T, S, That](that: GenIterable[S])(implicit bf: CanBuildFrom[This, (U, S), That]): That = newZippedTryParSeq(that).asInstanceOf[That] override def zipWithIndex[U >: T, That](implicit bf: CanBuildFrom[This, (U, Int), That]): That = - newZipped(ParRange(0, splitter.remaining, 1, false)).asInstanceOf[That] + newZipped(ParRange(0, splitter.remaining, 1, inclusive = false)).asInstanceOf[That] override def zipAll[S, U >: T, That](that: GenIterable[S], thisElem: U, thatElem: S)(implicit bf: CanBuildFrom[This, (U, S), That]): That = newZippedAllTryParSeq(that, thisElem, thatElem).asInstanceOf[That] diff --git a/src/library/scala/collection/parallel/ParSeqViewLike.scala b/src/library/scala/collection/parallel/ParSeqViewLike.scala index 22773464ed..f3dbe20e67 100644 --- a/src/library/scala/collection/parallel/ParSeqViewLike.scala +++ b/src/library/scala/collection/parallel/ParSeqViewLike.scala @@ -147,7 +147,7 @@ self => override def map[S, That](f: T => S)(implicit bf: CanBuildFrom[This, S, That]): That = newMapped(f).asInstanceOf[That] override def zip[U >: T, S, That](that: GenIterable[S])(implicit bf: CanBuildFrom[This, (U, S), That]): That = newZippedTryParSeq(that).asInstanceOf[That] override def zipWithIndex[U >: T, That](implicit bf: CanBuildFrom[This, (U, Int), That]): That = - newZipped(ParRange(0, splitter.remaining, 1, false)).asInstanceOf[That] + newZipped(ParRange(0, splitter.remaining, 1, inclusive = false)).asInstanceOf[That] override def reverse: This = newReversed.asInstanceOf[This] override def reverseMap[S, That](f: T => S)(implicit bf: CanBuildFrom[This, S, That]): That = reverse.map(f) diff --git a/src/library/scala/collection/parallel/mutable/ParTrieMap.scala b/src/library/scala/collection/parallel/mutable/ParTrieMap.scala index 61a50a124d..60f4709a8c 100644 --- a/src/library/scala/collection/parallel/mutable/ParTrieMap.scala +++ b/src/library/scala/collection/parallel/mutable/ParTrieMap.scala @@ -136,7 +136,7 @@ extends TrieMapIterator[K, V](lev, ct, mustInit) } def dup = { - val it = newIterator(0, ct, false) + val it = newIterator(0, ct, _mustInit = false) dupTo(it) it.iterated = this.iterated it diff --git a/src/library/scala/sys/process/ProcessBuilder.scala b/src/library/scala/sys/process/ProcessBuilder.scala index 3a86f6dc3c..5d89e45001 100644 --- a/src/library/scala/sys/process/ProcessBuilder.scala +++ b/src/library/scala/sys/process/ProcessBuilder.scala @@ -305,10 +305,10 @@ object ProcessBuilder extends ProcessBuilderImpl { protected def toSource: ProcessBuilder /** Writes the output stream of this process to the given file. */ - def #> (f: File): ProcessBuilder = toFile(f, false) + def #> (f: File): ProcessBuilder = toFile(f, append = false) /** Appends the output stream of this process to the given file. */ - def #>> (f: File): ProcessBuilder = toFile(f, true) + def #>> (f: File): ProcessBuilder = toFile(f, append = true) /** Writes the output stream of this process to the given OutputStream. The * argument is call-by-name, so the stream is recreated, written, and closed each diff --git a/src/library/scala/sys/process/ProcessBuilderImpl.scala b/src/library/scala/sys/process/ProcessBuilderImpl.scala index 49fea6f464..91e267d5e4 100644 --- a/src/library/scala/sys/process/ProcessBuilderImpl.scala +++ b/src/library/scala/sys/process/ProcessBuilderImpl.scala @@ -69,7 +69,7 @@ private[process] trait ProcessBuilderImpl { import io._ // spawn threads that process the input, output, and error streams using the functions defined in `io` - val inThread = Spawn(writeInput(process.getOutputStream), true) + val inThread = Spawn(writeInput(process.getOutputStream), daemon = true) val outThread = Spawn(processOutput(process.getInputStream), daemonizeThreads) val errorThread = if (p.redirectErrorStream) Nil @@ -93,26 +93,26 @@ private[process] trait ProcessBuilderImpl { def #&&(other: ProcessBuilder): ProcessBuilder = new AndBuilder(this, other) def ###(other: ProcessBuilder): ProcessBuilder = new SequenceBuilder(this, other) - def run(): Process = run(false) + def run(): Process = run(connectInput = false) def run(connectInput: Boolean): Process = run(BasicIO.standard(connectInput)) - def run(log: ProcessLogger): Process = run(log, false) + def run(log: ProcessLogger): Process = run(log, connectInput = false) def run(log: ProcessLogger, connectInput: Boolean): Process = run(BasicIO(connectInput, log)) - def !! = slurp(None, false) - def !!(log: ProcessLogger) = slurp(Some(log), false) - def !!< = slurp(None, true) - def !!<(log: ProcessLogger) = slurp(Some(log), true) + def !! = slurp(None, withIn = false) + def !!(log: ProcessLogger) = slurp(Some(log), withIn = false) + def !!< = slurp(None, withIn = true) + def !!<(log: ProcessLogger) = slurp(Some(log), withIn = true) - def lines: Stream[String] = lines(false, true, None) - def lines(log: ProcessLogger): Stream[String] = lines(false, true, Some(log)) - def lines_! : Stream[String] = lines(false, false, None) - def lines_!(log: ProcessLogger): Stream[String] = lines(false, false, Some(log)) + def lines: Stream[String] = lines(withInput = false, nonZeroException = true, None) + def lines(log: ProcessLogger): Stream[String] = lines(withInput = false, nonZeroException = true, Some(log)) + def lines_! : Stream[String] = lines(withInput = false, nonZeroException = false, None) + def lines_!(log: ProcessLogger): Stream[String] = lines(withInput = false, nonZeroException = false, Some(log)) - def ! = run(false).exitValue() + def ! = run(connectInput = false).exitValue() def !(io: ProcessIO) = run(io).exitValue() - def !(log: ProcessLogger) = runBuffered(log, false) - def !< = run(true).exitValue() - def !<(log: ProcessLogger) = runBuffered(log, true) + def !(log: ProcessLogger) = runBuffered(log, connectInput = false) + def !< = run(connectInput = true).exitValue() + def !<(log: ProcessLogger) = runBuffered(log, connectInput = true) /** Constructs a new builder which runs this command with all input/output threads marked * as daemon threads. This allows the creation of a long running process while still diff --git a/src/library/scala/sys/process/ProcessImpl.scala b/src/library/scala/sys/process/ProcessImpl.scala index bfd3551a65..c64ba246fc 100644 --- a/src/library/scala/sys/process/ProcessImpl.scala +++ b/src/library/scala/sys/process/ProcessImpl.scala @@ -17,7 +17,7 @@ private[process] trait ProcessImpl { /** Runs provided code in a new Thread and returns the Thread instance. */ private[process] object Spawn { - def apply(f: => Unit): Thread = apply(f, false) + def apply(f: => Unit): Thread = apply(f, daemon = false) def apply(f: => Unit, daemon: Boolean): Thread = { val thread = new Thread() { override def run() = { f } } thread.setDaemon(daemon) diff --git a/src/library/scala/xml/Attribute.scala b/src/library/scala/xml/Attribute.scala index 0224913cf6..234281163d 100644 --- a/src/library/scala/xml/Attribute.scala +++ b/src/library/scala/xml/Attribute.scala @@ -94,7 +94,7 @@ abstract trait Attribute extends MetaData { sb append key append '=' val sb2 = new StringBuilder() - Utility.sequenceToXML(value, TopScope, sb2, true) + Utility.sequenceToXML(value, TopScope, sb2, stripComments = true) Utility.appendQuoted(sb2.toString, sb) } } diff --git a/src/library/scala/xml/Equality.scala b/src/library/scala/xml/Equality.scala index 02db22a78a..20f2405967 100644 --- a/src/library/scala/xml/Equality.scala +++ b/src/library/scala/xml/Equality.scala @@ -86,8 +86,8 @@ trait Equality extends scala.Equals { * to maintain a semblance of order. */ override def hashCode() = basisForHashCode.## - override def equals(other: Any) = doComparison(other, false) - final def xml_==(other: Any) = doComparison(other, true) + override def equals(other: Any) = doComparison(other, blithe = false) + final def xml_==(other: Any) = doComparison(other, blithe = true) final def xml_!=(other: Any) = !xml_==(other) /** The "blithe" parameter expresses the caller's unconcerned attitude diff --git a/src/library/scala/xml/Node.scala b/src/library/scala/xml/Node.scala index dcd4c15969..7b1a97e8f2 100755 --- a/src/library/scala/xml/Node.scala +++ b/src/library/scala/xml/Node.scala @@ -163,7 +163,7 @@ abstract class Node extends NodeSeq { /** * Same as `toString('''false''')`. */ - override def toString(): String = buildString(false) + override def toString(): String = buildString(stripComments = false) /** * Appends qualified name of this node to `StringBuilder`. diff --git a/src/library/scala/xml/PrettyPrinter.scala b/src/library/scala/xml/PrettyPrinter.scala index 98807a40a4..720fe79b1d 100755 --- a/src/library/scala/xml/PrettyPrinter.scala +++ b/src/library/scala/xml/PrettyPrinter.scala @@ -147,7 +147,7 @@ class PrettyPrinter(width: Int, step: Int) { case _ => val test = { val sb = new StringBuilder() - Utility.serialize(node, pscope, sb, false) + Utility.serialize(node, pscope, sb, stripComments = false) if (doPreserve(node)) sb.toString else TextBuffer.fromString(sb.toString).toText(0).data } diff --git a/src/library/scala/xml/dtd/ElementValidator.scala b/src/library/scala/xml/dtd/ElementValidator.scala index e73e209daa..ad74acb77e 100644 --- a/src/library/scala/xml/dtd/ElementValidator.scala +++ b/src/library/scala/xml/dtd/ElementValidator.scala @@ -99,21 +99,21 @@ class ElementValidator() extends Function1[Node,Boolean] { */ def check(nodes: Seq[Node]): Boolean = contentModel match { case ANY => true - case EMPTY => getIterable(nodes, false).isEmpty - case PCDATA => getIterable(nodes, true).isEmpty + case EMPTY => getIterable(nodes, skipPCDATA = false).isEmpty + case PCDATA => getIterable(nodes, skipPCDATA = true).isEmpty case MIXED(ContentModel.Alt(branches @ _*)) => // @todo val j = exc.length def find(Key: String): Boolean = branches exists { case ContentModel.Letter(ElemName(Key)) => true ; case _ => false } - getIterable(nodes, true) map (_.name) filterNot find foreach { + getIterable(nodes, skipPCDATA = true) map (_.name) filterNot find foreach { exc ::= MakeValidationException fromUndefinedElement _ } (exc.length == j) // - true if no new exception case _: ELEMENTS => dfa isFinal { - getIterable(nodes, false).foldLeft(0) { (q, e) => + getIterable(nodes, skipPCDATA = false).foldLeft(0) { (q, e) => (dfa delta q).getOrElse(e, throw ValidationException("element %s not allowed here" format e)) } } diff --git a/src/library/scala/xml/parsing/MarkupParser.scala b/src/library/scala/xml/parsing/MarkupParser.scala index 8129165b1b..d289414c26 100755 --- a/src/library/scala/xml/parsing/MarkupParser.scala +++ b/src/library/scala/xml/parsing/MarkupParser.scala @@ -199,11 +199,11 @@ trait MarkupParser extends MarkupParserCommon with TokenTests * // this is a bit more lenient than necessary... * }}} */ def prolog(): (Option[String], Option[String], Option[Boolean]) = - prologOrTextDecl(true) + prologOrTextDecl(isProlog = true) /** prolog, but without standalone */ def textDecl(): (Option[String], Option[String]) = - prologOrTextDecl(false) match { case (x1, x2, _) => (x1, x2) } + prologOrTextDecl(isProlog = false) match { case (x1, x2, _) => (x1, x2) } /** {{{ * [22] prolog ::= XMLDecl? Misc* (doctypedecl Misc*)? @@ -799,12 +799,12 @@ trait MarkupParser extends MarkupParserCommon with TokenTests val defdecl: DefaultDecl = ch match { case '\'' | '"' => - DEFAULT(false, xAttributeValue()) + DEFAULT(fixed = false, xAttributeValue()) case '#' => nextch() xName match { - case "FIXED" => xSpace() ; DEFAULT(true, xAttributeValue()) + case "FIXED" => xSpace() ; DEFAULT(fixed = true, xAttributeValue()) case "IMPLIED" => IMPLIED case "REQUIRED" => REQUIRED } diff --git a/src/library/scala/xml/persistent/CachedFileStorage.scala b/src/library/scala/xml/persistent/CachedFileStorage.scala index c0fad30da6..fc510b5f18 100644 --- a/src/library/scala/xml/persistent/CachedFileStorage.scala +++ b/src/library/scala/xml/persistent/CachedFileStorage.scala @@ -76,7 +76,7 @@ abstract class CachedFileStorage(private val file1: File) extends Thread with Lo log("[load]\nloading "+theFile) val src = Source.fromFile(theFile) log("parsing "+theFile) - val res = ConstructingParser.fromSource(src, false).document().docElem(0) + val res = ConstructingParser.fromSource(src,preserveWS = false).document.docElem(0) switch() log("[load done]") res.child.iterator @@ -94,7 +94,7 @@ abstract class CachedFileStorage(private val file1: File) extends Thread with Lo // @todo: optimize val storageNode = <nodes>{ nodes.toList }</nodes> val w = Channels.newWriter(c, "utf-8") - XML.write(w, storageNode, "utf-8", true, null) + XML.write(w, storageNode, "utf-8", xmlDecl = true, doctype = null) log("writing to "+theFile) |