summaryrefslogtreecommitdiff
path: root/src/library
Commit message (Collapse)AuthorAgeFilesLines
* 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
| * | | | | SI-7680 Update the ScalaDoc entry page of the Scala librarySimon Ochsenreither2013-12-192-16/+49
| | |_|/ / | |/| | |
* | | | | Merge pull request #3335 from swartzrock/masterIchoran2014-01-124-45/+42
|\ \ \ \ \ | | | | | | | | | | | | Fixes #3330 with Scaladoc changes only
| * | | | | Fixes #3330 with Scaladoc changes onlyJason Swartz2014-01-074-45/+42
| | |_|/ / | |/| | |
* | | | | Merge pull request #3124 from DarkDimius/fix-7443Adriaan Moors2014-01-092-6/+48
|\ \ \ \ \ | | | | | | | | | | | | Fix SI-7443 Range.sum ignoring Numeric argument and always assuming default 'plus' implementation
| * | | | | SI-7443 Use typeclass instance for {Range,NumericRange}.sumDmitry Petrashko2013-12-292-6/+48
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously both Range and NumeriRange used formula for sum of elements of arithmetic series and thus always assumed that provided Numeric is regular one. Bug is now fixed by conservatively checking if Numeric is one of default ones and the formula still holds.
* | | | | Merge pull request #3347 from retronym/topic/abs-part-fun-manual-spec-no-moreGrzegorz Kossakowski2014-01-091-12/+0
|\ \ \ \ \ | | | | | | | | | | | | Remove temporary binary compat scaffolding from AbstractPartiionFun.
| * | | | | Remove temporary binary compat scaffolding from AbstractPartiionFun.Jason Zaugg2014-01-091-12/+0
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | These were only needed during the transition period when we removed specialization on AnyRef from `AbstractPartialFunction`. It's time to cast away the crutches.
* | | | | Merge pull request #3336 from OlivierBlanvillain/patch-1Jason Zaugg2014-01-091-1/+1
|\ \ \ \ \ | | | | | | | | | | | | Fix typo in documentation
| * | | | | Fix typo in documentationOlivier Blanvillain2014-01-081-1/+1
| |/ / / /
* | | | | Merge pull request #3338 from gourlaysama/t7491Jason Zaugg2014-01-091-6/+6
|\ \ \ \ \ | | | | | | | | | | | | SI-7491 fix typo in scala.App documentation
| * | | | | SI-7491 deprecate overriding App.main and clarify documentationAntoine Gourlay2014-01-081-6/+6
| |/ / / / | | | | | | | | | | | | | | | App.main should never be overridden, so let's enforce it.
* / / / / SI-7859 fix AnyVal.scala scaladoc.xuwei-k2014-01-091-1/+1
|/ / / / | | | | | | | | | | | | Value class member need not be public in 2.11+
* | | | Merge pull request #3289 from soc/SI-7492-reduxJason Zaugg2014-01-081-4/+4
|\ \ \ \ | | | | | | | | | | SI-7492 Make scala.runtime.MethodCache private[scala]
| * | | | SI-7492 Make scala.runtime.MethodCache private[scala]Simon Ochsenreither2013-12-191-4/+4
| |/ / / | | | | | | | | | | | | | | | | These are internal implementation details which shouldn't be exposed to users (and might go away when support for invokedynamic is added).
* | | | Merge pull request #3325 from clhodapp/fix/double.absJason Zaugg2014-01-081-0/+4
|\ \ \ \ | | | | | | | | | | Fix (postfix abs for -0.0)
| * | | | SI-8102 -0.0.abs must equal 0.0clhodapp2014-01-061-0/+4
| | |/ / | |/| | | | | | | | | | | | | | | | | | SI-8102 points out that -0.0.abs returns -0.0 (in error). The same issue exists for -0.0f. This commit fixes the issue for both by delegating to math.abs.
* | | | Merge pull request #3301 from Ichoran/issue/7837Jason Zaugg2014-01-081-2/+2
|\ \ \ \ | |/ / / |/| | | Resolves SI-7837, failure in quickSort.
| * | | SI-7837 quickSort, along with Ordering[K], may result in stackoverflow ↵Rex Kerr2013-12-311-2/+2
| | |/ | |/| | | | | | | | | | | | | | | | | | | because the code uses '==' instead of 'equiv' == instead of equiv (from Ordering) was used by mistake. Fixed. Also created a test to make sure that == is not used by throwing an exception if it is (as suggested by Jason).
* | | Merge pull request #3313 from OlivierBlanvillain/upstreamJason Zaugg2014-01-034-4/+4
|\ \ \ | | | | | | | | Fix typos in documentation