summaryrefslogtreecommitdiff
path: root/src/library
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #3470 from demobox/si-8215-follow-upAdriaan Moors2014-02-091-3/+4
|\ | | | | SI-8215: Correcting typo and splitting a long sentence in MatchIterator doc
| * SI-8215: Correcting typo and splitting a long sentence in MatchIterator docAndrew Phillips2014-02-051-3/+4
| | | | | | | | Follow-up to 9c0ca62
* | SI-8154 AnyRefMap iterates its way to ((null, null))Rex Kerr2014-02-091-15/+12
|/ | | | | | Changed logic to prevent mutation between hasNext and next from delivering invalid results. Also fixed superscripts in scaladoc.
* Merge pull request #3432 from havocp/patch-1Adriaan Moors2014-02-051-2/+38
|\ | | | | Improve ExecutionContext implicitNotFound and docs
| * Improve ExecutionContext implicitNotFound and docsHavoc Pennington2014-01-311-2/+38
| | | | | | | | | | | | | | | | | | | | | | It is not good practice to import a specific ExecutionContext all over the place; we shouldn't recommend that. People should allow callers to specify the context in most cases and only import the context in some central location in their code. While we are at it, add some more comprehensive docs to ExecutionContext which will hopefully give people enough understanding to make decisions about it.
* | Merge pull request #3453 from Ichoran/issue/4997Adriaan Moors2014-02-051-0/+1
|\ \ | | | | | | SI-4997 deprecate StringLike.linesIterator for StringLike.lines
| * | SI-4997 deprecate StringLike.linesIterator for StringLike.linesRex Kerr2014-01-311-0/+1
| | | | | | | | | | | | Deprecated. lines is by far more consistent with the rest of the naming in the library.
* | | PR #3233 cleanupPavel Pavlov2014-02-051-32/+31
| | | | | | | | | | | | | | | - `::.head` became a `val`; excessive accessor removed - SerializationProxy moved to `object List`
* | | Merge pull request #3439 from demobox/issue-8215Adriaan Moors2014-02-031-11/+28
|\ \ \ | | | | | | | | SI-8215: Document IllegalStateExceptions thrown by uninitialized MatchIterator from Regex (review by @heathermiller)
| * | | SI-8215 Documenting the possibility of IllegalStateExceptions when using ↵Andrew Phillips2014-02-011-2/+27
| | | | | | | | | | | | | | | | | | | | | | | | MatchIterator See https://groups.google.com/forum/#!topic/scala-language/2T2wKVQiyVg
| * | | SI-8215 Removing ASCII art class diagram in Scaladoc for RegexAndrew Phillips2014-02-011-9/+1
| |/ / | | | | | | | | | | | | The Content Hierarchy contains the same information, properly formatted. See https://groups.google.com/d/msg/scala-language/2T2wKVQiyVg/3-iu19XSTxwJ
* | | Merge pull request #3445 from retronym/topic/opt7Grzegorz Kossakowski2014-02-021-0/+46
|\ \ \ | | | | | | | | Grab bag of compiler optimizations
| * | | More overrides for SetNJason Zaugg2014-02-011-0/+46
| |/ /
* / / SI-7266 Stream leaks memoryRex Kerr2014-01-311-2/+6
|/ / | | | | | | | | | | Changed tail-generation function to mutable and clear it after it's used to allow any captured memory to be freed once the tail has been generated. (This is a case where a by-name parameter was used when a lazy val parameter was wanted instead. If we ever get lazy val parameters, we should switch to that.)
* / SI-8213 AnyRefMap.getOrElseUpdate is faultyRex Kerr2014-01-302-4/+26
|/ | | | | | Altered getOrElseUpdate to be robust to the map changing out from under it as a result of calling the default value method. Side-effects FTW! Made a comparable change in LongMap also, as it was also affected. And added a test to SetMapConsistencyTest.
* Fix misuse of underscores.Paul Phillips2014-01-251-4/+4
| | | | | | It's a language bug, but M[_] <: Foo[_] does not mean what anyone who writes it believes that it means. You have to give the type parameter a name, like M[X] <: Foo[X].
* Merge pull request #3388 from rklaehn/issue/7445Adriaan Moors2014-01-242-17/+19
|\ | | | | ListMap.tail is returning wrong result
| * SI-7445 ListMap.tail is returning wrong resultRuediger Klaehn2014-01-202-17/+19
| | | | | | | | | | | | | | Reverted the commit that introduced the bug, and modified HashMap to no longer assume that tail is O(1). Review by @Ichoran, @soc
* | Improve naming of ReadStdinSimon Ochsenreither2014-01-183-32/+32
|/ | | | | We don't need to say everything twice, methods are already prefixed with “read”.
* Merge pull request #3322 from rklaehn/issue/6253Ichoran2014-01-161-14/+511
|\ | | | | SI-6253 HashSet should implement union
| * SI-6253 HashSet should implement unionRüdiger Klaehn2014-01-161-14/+511
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implements of HashSet.union that reuses the two trees as much as possible when calculating the union of two sets. This leads to significant performance improvements as well as to much better structural sharing. There is a comprehensive correctness test for union since there was not a single test for HashSet.union before. In addition, there are some tests of the desirable properties of the new implementation (structural sharing and efficiency regarding calls of key.hashCode). The other operations diff and intersect, which are conceptually very similar to union, are also implemented along with comprehensive test cases for both correctness and structural sharing. Note that while it appears that there is some code duplication between the three methods, they are sufficiently different that it is not possible to merge them into one without sacrificing performance.
* | SI-4370 Range bug: Wrong result for Long.MinValue to Long.MaxValue by ↵Rex Kerr2014-01-151-20/+71
|/ | | | | | | | | | | | | | Int.MaxValue Fixed by rewriting the entire logic for the count method. This is necessary because the old code was making all kinds of assumptions about what numbers were, but the interface is completely generic. Those assumptions still made have been explicitly specified. Note that you have to make some or you end up doing a binary search, which is not exactly fast. The existing routine is 10-20% slower than the old (broken) one in the worst cases. This seems close enough to me to not bother special-casing Long and BigInt, though I note that this could be done for improved performance. Note that ranges that end up in Int ranges defer to Range for count. We can't assume that one is the smallest increment, so both endpoints and the step need to be Int. A new JUnit test has been added to verify that the test works. It secretly contains an alternate BigInt implementation, but that is a lot slower (>5x) than Long.
* Merge pull request #3318 from rklaehn/issue/6196Ichoran2014-01-152-0/+243
|\ | | | | SI-6196 - Set should implement filter
| * SI-6200 - HashMap should implement filterRüdiger Klaehn2014-01-151-0/+122
| | | | | | | | | | | | | | | | | | This is the exact same algorithm as in SI-6196, with only slight differences due to the two type arguments of HashMap. Filter is tested by the new comparative collection test by @Ichoran, but there is nevertheless a small correctness test in t6200 in addition to tests of the new desirable behavior.
| * SI-6196 - Set should implement filterRüdiger Klaehn2014-01-151-0/+121
| | | | | | | | | | | | | | | | | | | | | | | | Implements a version of filter and filterNot that reuses as much as possible from the existing tree instead of building an entirely new one like the builder-based filter does. This results in significant performance improvements on average. Adds a test of basic correctness of filter and filterNot as well as of the desirable properties of the new filter implementation. This is a collaboration between me and @Ichoran
* | Merge pull request #3362 from som-snytt/issue/7544-scaladocAdriaan Moors2014-01-151-3/+2
|\ \ | | | | | | SI-7544 StringContext.f docs update
| * | SI-7544 StringContext.f docs updateSom Snytt2014-01-131-3/+2
| | | | | | | | | | | | | | | Correct the scaladoc to reflect how f"%" is handled, namely, it's no longer taken as f"%%".
* | | Merge pull request #3366 from Ichoran/issue/6457Adriaan Moors2014-01-154-6/+8
|\ \ \ | | | | | | | | SI-6457 ImmutableSetFactory.empty results in StackOverflowError
| * | | SI-6457 ImmutableSetFactory.empty results in StackOverflowErrorRex Kerr2014-01-144-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ImmutableSetFactory relies upon empty to create its builder, which in turn relies upon its builder to create an empty. Added an emptyInstance method to hold the actual empty set (which also removes duplicated functionality for empty sets). No test, as the original pattern: object Factory extends collection.generic.ImmutableSetFactory[collection.immutable.Set] {} no longer compiles. This should be verified by whoever checks this commit, but this kind of change is hard to revert by accident. No reason to waste resources checking it forevermore.
* | | | Merge pull request #3316 from Ichoran/topic/big-decimal-correctnessAdriaan Moors2014-01-152-71/+410
|\ \ \ \ | | | | | | | | | | Quasi-comprehensive BigDecimal soundness/correctness fix.
| * | | | Quasi-comprehensive BigDecimal soundness/correctness fix.Rex Kerr2014-01-142-71/+410
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes issues SI-6153, SI-6173, SI-6456, SI-6699, and SI-8116, along with a number of other similar possible issues. Relevant changes include * Changes to avoid heap explosion when working with BigInt - to isWhole - to hashCode - to equals - to BigInt's equals * Changes to enable equality matching hashCode - Only for sufficiently small BigInt - For identical values with different precision * Changes to isValidDouble - Takes precision into account now - New methods added to test whether even if the Double is not represented exactly, it's a representation of a certain type - New companion methods added to allow intended expansion of Double (binary/decimal difference) * Changes to constructor - Null arguments are not allowed (these can throw NPEs later at awkward/unexpected times) * New JUnit test to test all these things * Fixed existing tests to expect new behavior * Modified scaladocs to explain the issues * Deprecated problematic methods * Made application of MathContext more consistent (it is where you expect it and not where you don't) These changes are coordinated, for the most part, hence the monolithic commit.
* | | | Merge pull request #3304 from non/bug/stream-flatten2-8100Adriaan Moors2014-01-151-8/+10
|\ \ \ \ | | | | | | | | | | SI-8100 - prevent possible SOE during Stream#flatten.
| * | | | SI-8100 - prevent possible SOE during Stream#flatten.Erik Osheim2013-12-241-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit changes stream flatten to avoid allocating a stack frame for every stream item. Previously, flattening a stream whose elements are mostly empty would result in a StackOverflowException. This commit also adds a test demonstrating the problem.
* | | | | Merge pull request #3293 from soc/SI-7469Adriaan Moors2014-01-154-24/+7
|\ \ \ \ \ | | | | | | | | | | | | Remove misc. @deprecated elements
| * | | | | SI-7469 Remove misc. @deprecated elementsSimon Ochsenreither2014-01-094-24/+7
| | | | | |
* | | | | | Merge pull request #3317 from qerub/si-8107-add-regex-quoteAdriaan Moors2014-01-153-4/+12
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-8107: Add Regex.quote
| * | | | | | SI-8107: Use Regex.quoteChristoffer Sawicki2013-12-292-4/+4
| | | | | | |
| * | | | | | SI-8107: Add Regex.quoteChristoffer Sawicki2013-12-291-0/+8
| | |/ / / / | |/| | | |
* | | | | | Merge pull request #3320 from Ichoran/issue/8081Adriaan Moors2014-01-151-2/+50
|\ \ \ \ \ \ | |_|_|_|_|/ |/| | | | | SI-8081 unzip/unzip3 return wrong static type when applied to Arrays
| * | | | | SI-8081 unzip/unzip3 return wrong static type when applied to ArraysRex Kerr2014-01-141-2/+50
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | Added unzip and unzip3 methods to ArrayOps so that we get proper return values. (No tests due to unfavorable effort/reward ratio for an ongoing test of something so simple.)
* | | | | Merge pull request #3315 from rklaehn/issue/7326Ichoran2014-01-151-1/+120
|\ \ \ \ \ | |_|_|_|/ |/| | | | Implements specialized subsetOf for HashSet
| * | | | Improved documentation of HashTrieSet internalsRüdiger Klaehn2014-01-141-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | Added some more general documentation about how levels work and how the bitmap field encodes the position of elems.
| * | | | Implements specialized subsetOf for HashSetRüdiger Klaehn2014-01-141-1/+84
| | |/ / | |/| | | | | | | | | | Fixes SI-7326. This also adds a basic test for subsetOf that was missing before.
* | | | Merge pull request #3323 from rklaehn/topic/hashset-comment-cleanup-2Ichoran2014-01-142-12/+0
|\ \ \ \ | |_|/ / |/| | | Removes TODO comments that are no longer applicable
| * | | Removes TODO comments that are no longer applicableRüdiger Klaehn2014-01-042-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - we do not want to use mutable updates because that would mean making vals vars, losing various guarantees for final fields of the java memory model - we do not want to add more subcasses of HashSet, because that would make callsites megamorphic. If anything, we should try to reduce the number of subclasses - checking for monomorphic call site is not worth it for a single virtual method call.
* | | | Merge pull request #3303 from Ichoran/issue/6615Adriaan Moors2014-01-131-1/+4
|\ \ \ \ | | | | | | | | | | Fixes SI-6615, NPE on slice of PagedSeq.
| * | | | SI-6615 PagedSeq's slice throws a NPE if it starts on a page that hasn't ↵Rex Kerr2013-12-311-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | been computed yet Made sure to addMore when roving forward on a slice into unpaged territory.
* | | | | Merge pull request #3302 from Ichoran/issue/6364Adriaan Moors2014-01-131-0/+6
|\ \ \ \ \ | | | | | | | | | | | | Resolves SI-6364, O(n) performance of wrapped set contains.
| * | | | | SI-6364 SetWrapper does not preserve performance / behaviorRex Kerr2013-12-311-0/+6
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | O(n) performance of wrapped set contains was the problem. Added overrides for contains and isEmpty to SetWrapper. Note that sets are invariant in Scala, while the Java signature is for any Object, so we trap a ClassCastException if one occurs. (Is this everything that could possibly go wrong? I think so, but am not as confident as I would like.)
* | | | | Merge pull request #3290 from soc/SI-7680Adriaan Moors2014-01-132-16/+49
|\ \ \ \ \ | | | | | | | | | | | | Update the ScalaDoc entry page of the Scala library