summaryrefslogtreecommitdiff
path: root/src/library
Commit message (Collapse)AuthorAgeFilesLines
* Fixed incorrect example in StringContext.raw docDan Garrette2014-07-211-1/+1
| | | As pointed out by @som-snytt, \u0023 is #, not \u0025.
* Remove "throws InvalidEscapeException" from StringContext.raw docDan Garrette2014-07-211-2/+0
| | | Since StringContext.raw doesn't escape its input, it does not call `treatEscapes` and cannot throw the InvalidEscapeException.
* SI-8738 Regression in range equalityRex Kerr2014-07-201-9/+10
| | | | | | Missed the case of comparing a non-empty range to an empty one. Fixed by checking nonEmpty/isEmpty on other collection. Added a test to verify the behavior.
* SI-8590 Expand doc comments for ExecutionContextPhilipp Haller2014-07-141-12/+60
| | | | | | | - link to Java API docs for ForkJoinPool-based default implementation - add example for creating an execution context from a `java.util.concurrent.ExecutorService` - add tags for parameters and return values - expand doc comment for `prepare`
* Merge pull request #3866 from Blaisorblade/issue/8677-backportLukas Rytz2014-07-091-1/+1
|\ | | | | SI-8677 Duration: Zero - Inf should be MinusInf
| * [backport] SI-8677 Duration: Zero - Inf should be MinusInfPaolo G. Giarrusso2014-07-041-1/+1
| | | | | | | | | | Fixes #8677. Add basic tests. This is a backport from 2.12.x of dead39dc5f21c6eac41788e93426c50ddd398c24.
* | Merge pull request #3842 from Ichoran/issue/8335Adriaan Moors2014-07-041-4/+2
|\ \ | | | | | | SI-8335 List.++ avoidably burns memory
| * | SI-8335 List.++ avoidably burns memoryRex Kerr2014-06-271-4/+2
| | | | | | | | | | | | Changed to check the identity of the CanBuildFrom instead of the identity of the generated builder to shortcut building. Should reduce memory churn on ++ a little.
* | | Merge pull request #3840 from Ichoran/issue/8638Adriaan Moors2014-07-041-21/+27
|\ \ \ | |_|/ |/| | SI-8638 Empty UnrolledBuffer hangs on prepend.
| * | SI-8638 Empty UnrolledBuffer hangs on prepend.Rex Kerr2014-06-271-21/+27
| |/ | | | | | | | | | | Tracked down bug to incorrect recursion in insertAll. Fixed by adding a missing case (which incidentally will provide better performance when adding to the end of a block). No specific tests, as this is caught by quasi-complete collections tests.
* | Merge pull request #3841 from Ichoran/issue/5200Adriaan Moors2014-07-032-12/+12
|\ \ | | | | | | SI-5200 Incorrect advice for implementing mutable.Set in scaladoc
| * | SI-5200 Incorrect advice for implementing mutable.Set in scaladocRex Kerr2014-06-272-12/+12
| |/ | | | | | | Fixed advice; it was already there in mutable.SetLike but a case sensitivity error kept it from appearing.
* | Merge pull request #3839 from Ichoran/issue/7115Adriaan Moors2014-07-033-1/+24
|\ \ | | | | | | SI-7115 JMapWrapper.get can incorrectly return Some(null)
| * | SI-7115 JMapWrapper.get can incorrectly return Some(null)Rex Kerr2014-06-273-1/+24
| |/ | | | | | | | | | | | | | | This isn't incorrect. Trying to use a single-threaded interface in a concurrent context is supposed to break in various unpleasant ways. Documentation has been added to encourage one to avoid wrapping a concurrent map in the generic wrapper (which assumes a single thread), and pointing out that synchronized maps do not maintain synchronization for non-atomic operations (including get). More docs.
* | Merge pull request #3834 from Ichoran/issue/7577Adriaan Moors2014-07-034-3/+4
|\ \ | | | | | | SI-7577 Incorrect documentation: current default isn't Vector
| * | SI-7577 Incorrect documentation: current default isn't VectorRex Kerr2014-06-264-3/+4
| | | | | | | | | | | | Fixed documentation to specify List in four cases where it was wrong or missing.
* | | SI-8690 BufferedSource.mkString mistakenly skipped the first char.Antoine Gourlay2014-06-291-1/+1
| |/ |/| | | | | | | | | | | mkString is overriden in BufferedSource for performance, but the implementation always used the wrong reader. This seems to be a typo (`allReader` is declared 5 lines earlier but never used, `charReader` is used in its place).
* | Merge pull request #3835 from Ichoran/issue/7562Jason Zaugg2014-06-271-2/+8
|\ \ | | | | | | SI-7562 Regex.findAllIn does not report all matches
| * | SI-7562 Regex.findAllIn does not report all matchesRex Kerr2014-06-261-2/+8
| |/ | | | | | | Changed findAllIn docs to clarify that it finds non-overlapping matches.
* | Merge pull request #3758 from gourlaysama/wip/t7372Ichoran2014-06-261-6/+6
|\ \ | |/ |/| SI-7372 fix wrong insertion point for binary & linear search.
| * SI-7372 make binarySearch methods use the same parameters for the same things.Antoine Gourlay2014-06-121-5/+5
| | | | | | | | | | | | | | | | The public facing binarySearch method used an inclusive 'from' parameter, while the internal @tailrec one used an *exclusive* 'from' parameter. No wonder there was an off-by-one error somewhere. This makes both methods use the same exclusive 'from' parameter.
| * SI-7372 fix wrong insertion point for binary & linear search.Antoine Gourlay2014-06-041-2/+2
| | | | | | | | | | It should return the position the value would have if it was a part of the sequence. Somehow even the test was wrong.
* | Merge pull request #3806 from clhodapp/fix/SI-6967Adriaan Moors2014-06-251-19/+29
|\ \ | | | | | | SI-6967 Fix ClassTag unapply for primitives
| * | SI-6967 Fix ClassTag unapply for primitivesclhodapp2014-06-101-19/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit fixes the behavior of ClassTag's Any-accepting unapply overload. Previously, ClassTag had overloads of unapply that accepted all of the Java primitive aliases (language-supported magic classes extending AnyVal), as well as an implementation that accepted an Any. All of the AnyVal-accepting (more specific) versions of the methods worked correctly. However, the Any-accepting version incorrectly handled these types. For example, ClassTag.Int.unapply(3) would return Some(3) (through the Int-accepting overload), while ClassTag.Int.unapply(3: Any) would return None (through the Any-accepting overload). This commit unifies these behaviors, making ClassTag.Int.unapply(3: Any) return Some(3). It accomplishes this by adding a pattern match on the type of that method's argument, which will delegate to one of the more-specifically-typed overloads if possible. It also improves the formatting of the code a bit. One thing to note (though I doubt anyone will ever do this based on this message) is that the AnyVal-subtype-accepting overloads should be removed in Scala 2.12, as they are unneeded. I placed a note to this effect into the code.
* | | Merge pull request #3805 from Ichoran/issue/6409Adriaan Moors2014-06-251-0/+8
|\ \ \ | | | | | | | | SI-6409 Stream flatMap leaks memory if mapper returns many empties
| * | | SI-6409 Stream flatMap leaks memory if mapper returns many emptiesRex Kerr2014-05-301-0/+8
| |/ / | | | | | | | | | Added Scaladoc explaining that this is necessary behavior, but closed ticket as wontfix.
* | | Merge pull request #3800 from som-snytt/issue/8503Adriaan Moors2014-06-101-2/+5
|\ \ \ | | | | | | | | SI-8503 -version is info setting
| * | | SI-8503 -version is info settingSom Snytt2014-05-291-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And the Scala runner exits with 0 for info settings. Producing the version string is consolidated. The compiler driver uses the default settings hook to short-circuit on -version. That's to avoid creating the compiler; really it should check shouldStopWithInfo first, as the runner does.
* | | | Merge pull request #3787 from tvierling/concurrent-doc-nitsAdriaan Moors2014-06-054-9/+33
|\ \ \ \ | | | | | | | | | | Add documentation to parts of scala.concurrent.
| * | | | Add documentation to parts of scala.concurrent.Todd Vierling2014-06-034-9/+33
| | |_|/ | |/| |
* | | | Merge pull request #3743 from ruippeixotog/issue/8553Ichoran2014-06-041-1/+1
|\ \ \ \ | |/ / / |/| | | SI-8553 WrappedArray throws exception on lastIndexWhere when index out of range
| * | | SI-8553 WrappedArray throws exception on lastIndexWhere when index out of rangeRui Gonçalves2014-05-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds a check in `IndexedSeqOptimized#lastIndexWhere(A => Boolean, Int)` to begin searching in the end of the collection if `end` is greater than the collection's length. Discussed in https://groups.google.com/d/topic/scala-internals/-MacXivbY0Q/discussion.
* | | | Merge pull request #3795 from som-snytt/issue/8475Adriaan Moors2014-06-031-6/+7
|\ \ \ \ | | | | | | | | | | SI-8475 GroupedIterator is also lazy when padded
| * | | | SI-8475 GroupedIterator is also lazy when paddedSom Snytt2014-05-271-6/+7
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | This is the related case which dnlgtm in the previous fix. The old code seems to be tilting for laziness, but we have to fill the buffer with the current group anyway, so there is no reason to be coy about calling ArrayBuffer.length.
* | | | Merge pull request #3786 from tvierling/deprecate-fixes-2.11.xAdriaan Moors2014-06-032-2/+2
|\ \ \ \ | |_|_|/ |/| | | Deprecate AVLTree and concurrent.Lock in 2.11.2
| * | | To have effect, @deprecated needs to be an annotation.Todd Vierling2014-05-242-2/+2
| | | |
* | | | Merge pull request #3791 from S11001001/ticket/8346Ichoran2014-05-293-6/+24
|\ \ \ \ | |_|/ / |/| | | SI-8346 Rebuild invariant sets in #toSet, avoiding CCE
| * | | SI-8346: Rebuild invariant sets in #toSet, avoiding CCE.Stephen Compall2014-05-243-6/+24
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SI-3953 caused several types of sets' operations to trivially throw `ClassCastException` after using inherited covariant #toSet method, by doing an unchecked cast that is only safe for intrinsically covariant set data structures like `HashSet`, but totally unsafe for others like `TreeSet` or `Enumeration.ValueSet`. This change moves the cast to the leaves of the class hierarchy where that is safe, and incidentally undeprecates overriding Set#toSet.
* | | Merge pull request #3733 from retronym/topic/pr-3712-resubmitJason Zaugg2014-05-271-1/+3
|\ \ \ | |/ / |/| | SI-8475 Fix off by one in GroupedIterator when Streaming
| * | SI-8475 Fix off by one in GroupedIterator when StreamingJean-Remi Desjardins2014-05-091-1/+3
| | | | | | | | | | | | This also affected sliding and grouped since they defer to GroupedIterator
* | | Merge pull request #3748 from retronym/ticket/8587Jason Zaugg2014-05-202-8/+7
|\ \ \ | | | | | | | | SI-8587 Explicitly document forall/exists for empty collections
| * | | SI-8587 Explicitly document forall/exists for empty collectionsJason Zaugg2014-05-142-8/+7
| | |/ | |/| | | | | | | | | | | | | This behaviour isn't always intuitive for newcomers. Also changes inadvertant doc comment to an impl. comment.
* / | SI-8507 Avoid lazy val in StringContextSom Snytt2014-05-131-47/+50
|/ / | | | | | | | | | | | | | | | | This mild refactor eliminates the lazy val StringBuilder and arguably makes the code easier to read. There is a small unit test but no benchmark to prove anything useful about performance. The ticket notes contention due to lazy implementation.
* | Merge pull request #3704 from gourlaysama/wip/t8504Jason Zaugg2014-05-081-1/+1
|\ \ | | | | | | SI-8504 fix NPE in the Java wrapper for a Scala Map.
| * | SI-8504 fix NPE in the Java wrapper for a Scala Map.Antoine Gourlay2014-04-291-1/+1
| |/ | | | | | | MapWrapper blindly calls .hashCode on keys that can very well be null.
* | Merge pull request #3706 from gourlaysama/wip/t8550Jason Zaugg2014-05-081-1/+1
|\ \ | | | | | | SI-8550 fix scaladoc for the default s.c.LinearSeq.
| * | SI-8550 fix scaladoc for the default s.c.LinearSeq.Antoine Gourlay2014-04-301-1/+1
| |/ | | | | | | | | The default LinearSeq is a List (LinearSeq.newBuilder delegates to immutable.LinearSeq.newBuilder, whose default is List).
* / SI-8549 Enforce serialization stability for selected collectionsJason Zaugg2014-05-051-0/+3
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To date, we've been hesidant to offer any guarantees about Java serialization of standard library types among heteregenous Scala versions. Nonetheless, we have added `SerialVersionUID` annotations to parts of the standard library, to offer some stability. This protects against two winds of change: automatic calculation of this UID might differ between JVM versions, or it might differ due to otherwise immaterial changes to the library in Scala releases. With this commit, we strengthen the guarantees. Classes marked with `SerialVersionUID` will be serialization compatible within minor releases of Scala. This is backed up by the enclosed test. After major releases, we reserve the right to break this. But the test will serve to avoid *accidental* changes. Specifically, the test case checks: - deserialize(serialize(x)) == x - serialize(x) is stable over time I have included values of all types marked with `@SerialVersionUID` in the library. For some types, I've added variations in the values to exercise different subclasses, such as `Set1` / `Set2`. This found that that the serialized form of predefined `ClassTags` included the cached identity hash code and failed the stability test. This wasn't an issue for correctness as they also provide `readResolve`, but I marked those fields as `@transient` in any case to comply with the test expectations. That whole area is good example of a serialization worst-practice: using anonymous classes in code like: val Object: Manifest[java.lang.Object] = new PhantomManifest[...](...) { private def readResolve(): Any = Manifest.AnyVal } ... will lead to instability if these declarations are shifted around in the file. Named classes would be preferred. I've noted this in a TODO comment for 2.12.
* Correction in the documentation.kurnevsky2014-04-081-1/+2
|
* SI-8428 Refactor ConcatIteratorJason Zaugg2014-03-241-5/+5
| | | | | Make the head iterator a constructor parameter, for easier construction and implementation of ++.