summaryrefslogtreecommitdiff
path: root/src/library
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #2803 from adriaanm/rebase-2728Adriaan Moors2013-08-161-18/+16
|\ | | | | SI-7658 Prevent StackOverflowError in ScalaRunTime.stringOf
| * Remove unused private[scala] def ScalaRunTime.checkZipSimon Ochsenreither2013-08-081-14/+0
| |
| * SI-7658 Prevent StackOverflowError in ScalaRunTime.stringOfSimon Ochsenreither2013-08-081-4/+16
| |
* | Merge pull request #2798 from som-snytt/issue/7544-errmsgAdriaan Moors2013-08-161-1/+2
|\ \ | | | | | | SI-7544 Interpolation message for %% literal
| * | StringContext#checkLengths reports bad args countSom Snytt2013-08-061-1/+2
| |/ | | | | | | | | | | Since interpolator args are of type Any, it's easy to write s(args) instead of s(args: _*). I wonder if Xlint would have warned me about that.
* | Merge pull request #2831 from soc/SI-7624Grzegorz Kossakowski2013-08-1510-1762/+625
|\ \ | | | | | | SI-7624 Fix -feature and some -Xlint warnings
| * | SI-7624 Fix -Xlint warnings in AnyVal-related codeSimon Ochsenreither2013-08-159-1762/+624
| | | | | | | | | | | | | | | | | | | | | | | | The changes are actually pretty small: scala.language.implicitConversions is moved around so that it is only emitted to the source file if there is an actual implicit conversion. The rest of the diff are mostly the new generated source files reflecting that change.
| * | SI-7624 Fix -feature warnings and build with -featureSimon Ochsenreither2013-08-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I added a language.existential import to LazyCombiner.scala which should not be necessary, but causes a spurious warning otherwise: scala/src/library/scala/collection/parallel/mutable/LazyCombiner.scala:33: warning: the existential type scala.collection.parallel.mutable.LazyCombiner[_$1,_$2,_$3] forSome { type _$1; type _$2; type _$3 <: scala.collection.generic.Growable[_$1] with scala.collection.generic.Sizing }, which cannot be expressed by wildcards, should be enabled by making the implicit value scala.language.existentials visible. if (other.isInstanceOf[LazyCombiner[_, _, _]]) { ^ I created ticket SI-7750 to track this issue.
* | | Merge pull request #2819 from som-snytt/issue/regextract-charAdriaan Moors2013-08-141-0/+38
|\ \ \ | | | | | | | | SI-7737 Regex matches Char
| * | | SI-7737 Regex matches CharSom Snytt2013-08-101-0/+38
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | Enables Char extraction by regex. ``` val r = """(\p{Lower})""".r "cat"(0) match { case r(x) => true } val nc = """\p{Lower}""".r "cat"(0) match { case nc() => true } ```
* | | Merge pull request #2791 from som-snytt/issue/7265-2.11Adriaan Moors2013-08-141-4/+3
|\ \ \ | | | | | | | | SI-7265 javaSpecVersion, adjust isJava... tests for 2.11
| * | | SI-7265 javaSpecVersion, adjust isJava... testsSom Snytt2013-08-011-4/+3
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make this and related properties public, because they are useful. This change ought to have been committed at 2.11 and then backported with restrictions, rather than vice-versa. Note that they are defined in the order, version, vendor and name, which is the order from the underlying javadoc. It would be a neat feature of the PR validator, as previously imagined, to run a "pending" test and then, on success and merge, to move it automatically to the canonical suite.
* | | Merge pull request #2780 from lcycon/lcycon-deprecate_lockAdriaan Moors2013-08-141-0/+1
|\ \ \ | |_|/ |/| | Add deprecation warning to scala.concurrent.Lock class
| * | Add deprecation warning to lock classLuke Cycon2013-07-291-0/+1
| | |
* | | Make map2Conserve occupy constant stack space in spirit of SI-2411George Leontiev2013-08-081-0/+2
| |/ |/| | | | | | | | | | | | | | | | | | | I recently discovered a StackOverflowError, caused by this function: https://gist.github.com/folone/7b2f2e2a16314ab28109 The circumstances are pretty extreme, still having a tail-recursive function seems to be a good idea. The function behaves the same way old function did (supported by tests), which is not really how map2 behaves. I did not change this behavior to not introduce any regression. I actually tried to make it behave like map2, and it does introduce regression.
* | Merge remote-tracking branch 'scala/2.10.x' into merge-2.10.xGrzegorz Kossakowski2013-07-293-33/+221
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bincompat-backward.whitelist.conf bincompat-forward.whitelist.conf src/compiler/scala/reflect/reify/phases/Reshape.scala src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala src/compiler/scala/tools/nsc/transform/Mixin.scala src/compiler/scala/tools/nsc/typechecker/RefChecks.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala src/library/scala/concurrent/impl/Promise.scala src/reflect/scala/reflect/internal/StdAttachments.scala test/files/neg/macro-override-macro-overrides-abstract-method-b.check test/files/run/t7569.check
| * \ Merge pull request #2674 from richdougherty/2.10.x-si7336-try2Adriaan Moors2013-07-122-24/+197
| |\ \ | | | | | | | | SI-7336 Link flatMapped promises to avoid memory leaks
| | * | SI-7336 - Link flatMapped promises to avoid memory leaksRich Dougherty2013-07-062-24/+197
| | | |
| * | | Merge pull request #2666 from som-snytt/issue/7265-spec-at-leastAdriaan Moors2013-07-121-10/+25
| |\ \ \ | | | | | | | | | | SI-7265 General test for spec version
| | * | | SI-7265 General test for spec versionSom Snytt2013-07-041-10/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test for isJavaAtLeast uses the specification.version. The method argument must have the form "major.minor". The scaladoc is updated to reflect the new reality and a test is added under junit. Note that this implementation aims to be a simple compromise between the functional and imperative camps, that is, to be free of both closures and while loops. And to elicit no cruft like regexes and wrappers for strings. No doubt even more could be done in this department, but we don't wish to spoil the fun on codegolf.stackexchange.com. However, we might decide to sponsor a new site: codereviewpingpong.com For 2.10.x, javaSpecVersion is provided as a private member. The active test is under `run` and the `junit` test must bide its time in `pending`. For 2.11, the private members can be public and the app test replaced with the unit test.
| * | | | fix typo in BigInt/BigDecimal deprecation messagesSeth Tisue2013-07-082-2/+2
| | |/ / | |/| |
* | | | Merge pull request #2733 from soc/SI-6811-textGrzegorz Kossakowski2013-07-271-0/+8
|\ \ \ \ | | | | | | | | | | SI-6811 Deprecate scala.text
| * | | | SI-6811 Deprecate scala.textSimon Ochsenreither2013-07-141-0/+8
| | | | |
* | | | | Merge pull request #2751 from soc/SI-7592-defaultmapmodelGrzegorz Kossakowski2013-07-271-0/+1
|\ \ \ \ \ | | | | | | | | | | | | SI-7592 Deprecate s.c.m.DefaultMapModel
| * | | | | SI-7592 Deprecate s.c.m.DefaultMapModelSimon Ochsenreither2013-07-191-0/+1
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | “This class is used internally.” — No, it isn't. It isn't used anywhere else either and it doesn't add much benefit, considering that it lacks documentation and has no tests at all.
* | | | | Merge pull request #2766 from xuwei-k/request/mergeable-either-value-classGrzegorz Kossakowski2013-07-271-1/+1
|\ \ \ \ \ | | | | | | | | | | | | MergeableEither extends AnyVal
| * | | | | MergeableEither extends AnyValxuwei-k2013-07-241-1/+1
| |/ / / /
* / / / / fix Promise scaladocxuwei-k2013-07-271-2/+2
|/ / / /
* / / / Fix typo in DocumentationValerian2013-07-141-1/+1
|/ / /
* | | Merge pull request #2709 from yllan/fix-docsAdriaan Moors2013-07-101-2/+2
|\ \ \ | | | | | | | | Fix docs inconsistent (cmp -> ord).
| * | | Fix docs inconsistent (cmp -> ord).yllan2013-07-061-2/+2
| | | | | | | | | | | | | | | | The parameter name is 'ord', but mentioned in docs with 'cmp'.
* | | | Merge pull request #2704 from adriaanm/modularizeAdriaan Moors2013-07-09110-10627/+0
|\ \ \ \ | | | | | | | | | | Separate jars for XML, Parser Combinators. Use released JLine.
| * | | | Spin off parser combinators to scala-parser-combinators.jar.Adriaan Moors2013-07-0525-2727/+0
| | | | |
| * | | | Spin off src/library/scala/xml to src/xml/scala/xml.Adriaan Moors2013-07-0585-7900/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: - Remove the last vestiges of xml from Predef and Contexts. - Change build to compile scala.xml to scala-xml.jar. - Deploy scala-xml module to maven. - Update partest accordingly. Note: An older compiler cannot use the new standard library to compile projects that use XML. Thus, skipping locker will break the build until we use 2.11.0-M4 for STARR. In the future build process, where we drop locker, we would have to release a milestone that supports the old and the new approach to xml. As soon as we'd be using that new milestone for starr, we could drop support for the old approach.
* | | | | Merge pull request #2688 from yllan/SI-7614Grzegorz Kossakowski2013-07-062-2/+52
|\ \ \ \ \ | |_|/ / / |/| | | | SI-7614 Minimize the times of evaluation f in TraversableOnce.maxBy/minBy
| * | | | SI-7614 Minimize the times of evaluation f in TraversableOnce.maxBy/minBy.yllan2013-07-062-2/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the previous implementation, maxBy/minBy will evaluate most of its elements with f twice to get the ordering. That results (2n - 2) evaluations of f. I save both the element and result of evaluation to a tuple so that it doesn't need to re-evaluate f on next comparison. Thus only n evaluations of f, that is the optimal. Note that the original implementation always returns the first matched if more than one element evaluated to same largest/smallest value of f. I document this behavior explicitly in this commit as well.
* | | | | Merge pull request #2695 from xuwei-k/bigint-bigdecimal-typoAdriaan Moors2013-07-032-2/+2
|\ \ \ \ \ | |_|/ / / |/| | | | fix typo
| * | | | fix typoxuwei-k2013-06-302-2/+2
| | | | |
* | | | | Merge pull request #2693 from lexspoon/semmle-lintAdriaan Moors2013-07-012-6/+6
|\ \ \ \ \ | | | | | | | | | | | | Lint-like fixes found by Semmle
| * | | | | Seals some case class hierarchies.Lex Spoon2013-06-262-6/+6
| | | | | |
* | | | | | Merge pull request #2694 from adriaanm/masterGrzegorz Kossakowski2013-07-011-135/+42
|\ \ \ \ \ \ | | | | | | | | | | | | | | Merge 2.10.x into master
| * \ \ \ \ \ Merge 2.10.x into masterAdriaan Moors2013-06-281-135/+42
| |\ \ \ \ \ \ | | |_|_|/ / / | |/| | | / / | | | |_|/ / | | |/| | | | | | | | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/typechecker/Duplicators.scala src/library/scala/concurrent/Future.scala test/files/jvm/scala-concurrent-tck.scala
| | * | | | Merge pull request #2511 from ↵Adriaan Moors2013-06-241-137/+44
| | |\ \ \ \ | | | |_|_|/ | | |/| | | | | | | | | | | | | | | viktorklang/wip-cleaner-Future-method-implementations-2.10-√ General SIP-14 Future method implementation cleanup
| | | * | | Cleaning up method implementations in FutureViktor Klang2013-06-191-137/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Optimizations: 1) Avoiding isDefinedAt + apply and using applyOrElse to allow for optimizations later 2) Reducing method sizes to be more JIT + inliner friendly 3) Reusing core combinators to reuse inliner/JIT optimizations and be more code-cache friendly
| | * | | | [backport] SI-7498 ParTrieMap.foreach no longer crashesAleksandar Prokopec2013-06-091-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the `split` method of the `ParTrieMap` iterator threw an exception when splitting a splitter that iterated over nodes whose hash codes collide. This was due to reusing the iterator of the list of colliding keys rather than creating a new splitter. This commit changes the `subdivide` method to create a new iterator using the factory method of the current trie map iterator rather than returning a `LinearSeqLike` iterator.
* | | | | | SI-7591 Minor cleanupsSimon Ochsenreither2013-07-011-4/+0
| |_|_|_|/ |/| | | |
* | | | | Merge pull request #2681 from soc/SI-7590Adriaan Moors2013-06-282-11/+17
|\ \ \ \ \ | | | | | | | | | | | | SI-7590 TreeSet should fail fast if Ordering is null
| * | | | | SI-7590 TreeSet should fail fast if Ordering is nullSimon Ochsenreither2013-06-252-11/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While migrating scala.tools.nsc.util.TreeSet to scala.collection.mutable.TreeSet, I messed up initialization order and realized that TreeSet accepts null as an Ordering and only fails much later. This change makes mutable.TreeSet and immutable.TreeSet fail immediately.
* | | | | | Merge pull request #2676 from soc/SI-7511Adriaan Moors2013-06-289-68/+147
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-7511 Remove indirection of numeric methods
| * | | | | | SI-7511 Remove indirection of numeric methodsSimon Ochsenreither2013-06-239-68/+147
| | |_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Methods on `Rich<AnyVal>`s like `abs`, `doubleValue`, `floatValue`, `longValue`, `intValue`, `byteValue`, `shortValue`, `min`, `max`, `signum` are slow because they go through multiple indirections including typeclasses and boxing. For instance, take `1L.abs`: Instead of just computing and returning the result (like it is done in `RichInt`), this is what happens: - `RichLong` inherits `abs` by extending `ScalaNumberProxy[T]` - `ScalaNumberProxy[T]` has an abstract `protected implicit def num: Numeric[T]` - This method is implemented in `RichLong` and points to `scala.math.Numeric.LongIsIntegral` - The actual method `abs` now calls `num.abs(self)`