summaryrefslogtreecommitdiff
path: root/src/library
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #5051 from kmizu/improve-api-docsAdriaan Moors2016-03-231-0/+1
|\ | | | | Improve documentation of `GenSeqLike#length`
| * Add scaladoc comment about the case when Exception will be thrown by ↵Kota Mizushima2016-03-241-0/+1
| | | | | | | | invocation of length method
* | Merge pull request #5047 from kmizu/resolve-several-warningsAdriaan Moors2016-03-223-9/+9
|\ \ | | | | | | Resolve several deprecation warnings
| * | Resolve warnings related to SyncVar#setKota Mizushima2016-03-183-9/+9
| |/ | | | | | | Replace it with SyncVar#put
* | Merge pull request #5034 from janekdb/topic/2.12.x-scaladoc-Predef-method-groupsSeth Tisue2016-03-211-0/+106
|\ \ | | | | | | Organise Predef methods into Scaladoc groups
| * | Organise Predef members into Scaladoc groupsJanek Bogucki2016-03-161-0/+106
| |/ | | | | | | | | By grouping members and providing descriptions the signal to noise ratio in Predef is usefully enhanced.
* | Merge pull request #5043 from dongjoon-hyun/fix_typos_in_spec_and_commentsJason Zaugg2016-03-211-1/+1
|\ \ | | | | | | Fix some typos in `spec` documents and comments.
| * | Fix some typos in `spec` documents and comments.Dongjoon Hyun2016-03-151-1/+1
| |/
* / Remove manual mixins in JFunctionN.v2.12.0-M3-dc9effeJason Zaugg2016-03-1822-263/+0
|/ | | | | | | | | | | | | | | | | | | These manual mixins were forwarding to the impl classes have just been removed. We can now rely on default methods instead. Update Tests: - Fix test/files/pos/t1237.scala, we can't have an outer field in an interface, always use the outer method. - Don't crash on meaningless trait early init fields test/files/neg/t2796.scala - Remove impl class relate parts of inner class test - Remove impl class relate parts of elidable test - Remove impl class related reflection test. - Remove test solely about trait impl classes renaming - Update check file with additional stub symbol error - Disable unstable parts of serialization test. - TODO explain, and reset the expectation
* Merge pull request #5037 from janekdb/topic/2.12.x-scaladoc-fix-Source-linksAdriaan Moors2016-03-141-10/+8
|\ | | | | Fix Scaladoc links in scala.io.Source
| * Fix Scaladoc links in scala.io.SourceJanek Bogucki2016-03-131-10/+8
| | | | | | | | | | The link to iter will work if the restriction to showing only public members is lifted in the visibility section.
* | Merge pull request #5040 from adriaanm/rebase-5031Jason Zaugg2016-03-151-1/+1
|\ \ | | | | | | Merge 2.11.x into 2.12.x [ci: last-only]
| * \ Merge 2.11.x into 2.12.xAdriaan Moors2016-03-141-1/+1
| |\ \ | | | | | | | | | | | | Resolved conflicts as in b0e05b67c7
| | * \ Merge pull request #4994 from dk14/patch-1Seth Tisue2016-03-041-1/+1
| | |\ \ | | | | | | | | | | explicitly specify insertion-order feature in docs
| | | * | explicitly specify insertion-order feature in docsdk142016-02-231-1/+1
| | | | |
* | | | | Merge pull request #5018 from ↵Seth Tisue2016-03-141-5/+31
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | janekdb/topic/2.12.x-scaladoc-advertise-deprecated-read-methods-less-Predef Remove mention of deprecated I/O methods from Predef main comment
| * | | | | Remove mention of deprecated I/O methods from Predef main commentJanek Bogucki2016-03-141-5/+31
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The read* functions are deprecated so should not be highlighted. Copied Scaladoc from Console on the assumption that few people will tarry for long once they have seen the existence of the print* methods. Linkified print* methods. Added note to printf encouraging use of f interpolator.
* | | | | Merge pull request #5013 from janekdb/2.12.x-Scaladoc-ConversionsSeth Tisue2016-03-143-49/+49
|\ \ \ \ \ | |/ / / / |/| | | | Format collection conversions Scaladoc as code blocks instead of bullets
| * | | | Format collection conversions Scaladoc as code blocks instead of bulletsJanek Bogucki2016-03-093-49/+49
| | |_|/ | |/| | | | | | | | | | | | | | - Makes the list of conversions easier to scan - Makes main comment formatting internally consistent
* | | | Merge pull request #4717 from Ichoran/issue/9347Adriaan Moors2016-03-146-3/+79
|\ \ \ \ | | | | | | | | | | SI-9347 Efficient head/tail, if possible, for immutable maps & sets
| * | | | SI-9347 Efficient head/tail, if possible, for immutable maps & setsRex Kerr2016-02-176-3/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most immutable collections, including sets and maps, have a better-than-O(n) method for removing an element. In those cases, tail and possibly head were overridden so the head/tail pattern can be used with less of a performance penalty. Speed improvements on head/tail pattern are (for sets/maps of size 1024, unless otherwise specified): ``` BitSet 190x HashSet 250x Set 400x Set2 9x Set4 12x HashMap 430x ListMap 2500x // size 128 Map 430x ``` Note: `ListMap` is actually `init`/`last` because it's maintained in reverse order. Altered ListMap docs to explain that reverse traversal is the fast way to do it. All tested sets/maps that were already fast are still fast. Test code is reproduced below, except it does ListSet with head/tail which doesn't show the improvement: ```scala object BenchTailSetMap { val th = new ichi.bench.Thyme val standard = 1 to 1024 val sets = Map[String, Set[Int]]( "Set" -> (Set.empty[Int] ++ standard), "Set4"-> Set(4, 7, 2, 1), "Set2"-> Set(3, 4), "HashSet" -> (collection.immutable.HashSet.empty[Int] ++ standard), "BitSet" -> (collection.immutable.BitSet.empty ++ standard), "SortedSet" -> (collection.immutable.SortedSet.empty[Int] ++ standard), "ListSet" -> (collection.immutable.ListSet.empty[Int] ++ standard) ) val pairs = standard.map(i => i -> i.toString) // ListMap implementation is HORRIBLE, O(n^3) tail! Cut down size. val maps = Map[String, Map[Int, String]]( "Map" -> (Map.empty[Int, String] ++ pairs), "HashMap" -> (collection.immutable.HashMap.empty[Int, String] ++ pairs), "SortedMap" -> (collection.immutable.SortedMap.empty[Int, String] ++ pairs), "ListMap" -> (collection.immutable.ListMap.empty[Int, String] ++ pairs.take(128)) ) def hts(s: Set[Int]) = { var si = s var x = 0 while (si.nonEmpty) { x += si.head si = si.tail } x } def htm(m: Map[Int, String]) = { var mi = m var x = 0 while (mi.nonEmpty) { x += mi.head._2.length mi = mi.tail } x } def run() { sets.toList.sortBy(_._1).foreach{ case (name, s) => th.pbench(hts(s), s.size, name) } maps.toList.sortBy(_._1).foreach{ case (name, m) => th.pbench(htm(m), m.size, name) } } } ```
* | | | | Scaladoc: Fix elidable threshold off-by-one comment and link elidableJanek Bogucki2016-03-091-8/+8
| |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | When -Xelide-below is 2000 (i.e. at least ASSERTION) the assert methods are not elided. - Fixed the above off-by-one error. - Made elidable a link
* | | | Fix typomathhun2016-03-091-2/+2
| | | |
* | | | Merge pull request #4934 from Shadow53/2.12.xSeth Tisue2016-03-011-0/+2
|\ \ \ \ | | | | | | | | | | Added Properties.isLinux to compliment the isWin and isMac methods
| * | | | Added Properties.isLinux to compliment the isWin and isMac methodsShadow532016-01-301-0/+2
| | | | |
* | | | | Merge remote-tracking branch 'origin/2.11.x' into ↵Jason Zaugg2016-02-2527-39/+49
|\ \ \ \ \ | |_|/ / / |/| | / / | | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | merge/2.11.x-to-2.12.x-20160225 Conflicts: scripts/jobs/integrate/bootstrap src/build/maven/scala-actors-pom.xml test/files/pos/t3420.flags Conflicts were trivial to resolve.
| * | | fix smhasher urlxuwei-k2016-02-152-2/+2
| | | | | | | | | | | | | | | | | | | | google code is dead http://google-opensource.blogspot.jp/2015/03/farewell-to-google-code.html
| * | | Fix off-by-one documentation error in Product<N>Janek Bogucki2016-02-1122-22/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sanity check: scala> case class P2(i: Int, j: Int) defined class P2 val p2 = P2(1, 3) p2.productElement(0) res0: Any = 1 p2.productElement(1) res1: Any = 3 p2.productElement(2) java.lang.IndexOutOfBoundsException: 2 at P2.productElement(<console>:10)
| * | | Merge pull request #4939 from szeiger/issue/9624Lukas Rytz2016-02-103-15/+25
| |\ \ \ | | | | | | | | | | SI-9624 Improve documentation for TraversableOnce
| | * | | SI-9624 Improve documentation for TraversableOnceStefan Zeiger2016-02-043-15/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Move the doc comment for `hasDefiniteSize` up from TraversableLike to GenTraversableOnce and improve it. - Add a note to `GenTraversableOnce.isEmpty` that implementations must not consume elements. - Clarify alternatives to subclassing TraversableOnce.
* | | | | Merge pull request #4894 from mmynsted/2.12.xJason Zaugg2016-02-121-1/+11
|\ \ \ \ \ | | | | | | | | | | | | Provide simpler commented example for Future.map
| * | | | | Making commented example simpler for mapMark Mynsted2016-01-191-1/+11
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding connection between map and for As described by SethTisue. Removing parentheses Fixing scaladoc
* | | | | Merge pull request #4896 from retronym/topic/indy-all-the-thingsJason Zaugg2016-02-123-0/+92
|\ \ \ \ \ | | | | | | | | | | | | Use invokedynamic for structural calls, symbol literals, lambda ser.
| * | | | | Use invokedynamic for structural calls, symbol literals, lamba ser.Jason Zaugg2016-01-293-0/+92
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous encodings created static fields in the enclosing class to host caches. However, this isn't an option once emit code in default methods of interfaces, as Java interfaces don't allow private static fields. We could continue to emit fields, and make them public when added to traits. Or, as chosen in this commit, we can emulate a call-site specific static field by using invokedynamic: when the call site is linked, our bootstrap methid can perform one-time computation, and we can capture the result in the CallSite. To implement this, I've allowed encoding of arbitrary invokedynamic calls in ApplyDynamic. The encoding is: ApplyDynamic( NoSymbol.newTermSymbol(TermName("methodName")).setInfo(invokedType) Literal(Constant(bootstrapMethodSymbol)) :: ( Literal(Constant(staticArg0)) :: Literal(Constant(staticArgN)) :: Nil ) ::: (dynArg0 :: dynArgN :: Nil) ) So far, static args may be `MethodType`, numeric or string literals, or method symbols, all of which can be converted to constant pool entries. `MethodTypes` are transformed to the erased JVM type and are converted to descriptors as String constants. I've taken advantage of this for symbol literal caching and for the structural call site cache. I've also included a test case that shows how a macro could target this (albeit using private APIs) to cache compiled regexes. I haven't managed to use this for LambdaMetafactory yet, not sure if the facility is general enough.
* | | | | Merge pull request #4957 from retronym/topic/merge-2.11.x-to-2.12.x-20160210Seth Tisue2016-02-112-7/+46
|\ \ \ \ \ | | | | | | | | | | | | Merge 2.11.x to 2.12.x [ci:last-only]
| * \ \ \ \ Merge branch '2.11.x' into topic/merge-2.11.x-to-2.12.x-20160210Jason Zaugg2016-02-102-7/+46
| |\ \ \ \ \ | | | |/ / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/library/scala/collection/Iterator.scala | `-- trivial conflicts only. Parens were added to the next() calls in 2.12.x, while in the meantime `{Concat,Join}Iterator` were optimized in 2.11.x
| | * | | | Merge pull request #4937 from szeiger/issue/9623-2.11Seth Tisue2016-02-081-6/+45
| | |\ \ \ \ | | | | | | | | | | | | | | SI-9623 Avoid unnecessary hasNext calls in JoinIterator & ConcatIterator
| | | * | | | SI-9623 Avoid unnecessary hasNext calls in JoinIterator & ConcatIteratorStefan Zeiger2016-02-011-6/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These iterator implementations are used to concatenate two (JoinIterator) or more (ConcatIterator) other iterators with `++`. They used to perform many unnecessary calls to the child iterators’ `hasNext` methods. This improved state machine-based implementation reduces that number to the bare minimum, i.e. iterating over concatenated iterators with `foreach` calls the children's `hasNext` methods a total of (number of children) + (number of elements) times, the same as when iterating over all children separately.
| | * | | | | bump copyright year to 2016Seth Tisue2016-02-031-1/+1
| | | |_|/ / | | |/| | |
* | | | | | Merge pull request #4924 from ShaneDelmore/SI-9452Lukas Rytz2016-02-102-34/+7
|\ \ \ \ \ \ | |/ / / / / |/| | | | | SI-9452: Extend BigDecimal with Ordered for java interop
| * | | | | Merge branch '2.12.x' into SI-9452Shane Delmore2016-02-0414-108/+177
| |\ \ \ \ \
| * | | | | | Extend BigInt with Ordered for java interopShane Delmore2016-02-011-17/+6
| | | | | | |
| * | | | | | Extend BigDecimal with Ordered for java interopShane Delmore2016-02-011-17/+1
| | |_|_|/ / | |/| | | |
* | | | | | SI-9620: add doc annotation to hide specific conversionsFelix Mulder2016-02-091-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit will introduce the doc annotation `@hideImplicitConversion`. By specifying which conversions to hide, the user can "toggle" which conversions are kept in the parsed entity. This implementation is a better workaround than hardcoding which ones to ignore when running scaladoc. Review: @VladUreche
* | | | | | Merge remote-tracking branch 'origin/2.12.x' into ↵Jason Zaugg2016-02-0414-108/+177
|\ \ \ \ \ \ | | |/ / / / | |/| | | | | | | | | | merge/2.11.x-to-2.12.x-20160203
| * | | | | Clarified and expanded which Builders were reusableRex Kerr2016-01-3014-108/+177
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This additionally fixes both SI-8648 and SI-9564. Added documentation to Builder to clarify that in general Builders are NOT reusable. Altered implementation of GrowingBuilder to use Growable instance's clear (not valid for a reusable builder, but this one isn't reusable). Added a new marker trait ReusableBuilder that specifies that these builders should be reusable. This trait overrides the clear and result methods while leaving them abstract in order to supply appropriate scaladoc. Made all Array builders Reusable in all cases (by setting capacity to 0 if the original array is returned). (Fixed a poor implmentation of Array[Unit] builder along the way.) Documented which other builders were already reusable (maps, sets, Vector, LazyBuilder, StringBuilder, ListBuffer, etc.).
* | | | | Merge commit 'cc6fea6' into merge/2.11.x-to-2.12.x-20160203Jason Zaugg2016-02-042-0/+5
|\ \ \ \ \ | | |/ / / | |/| | | | | | | | | | | | | | | | | | Conflicts: build.sbt scripts/jobs/integrate/bootstrap
| * | | | SI-9534 Use BoxedUnit in all cases for creating Array[Unit]Stefan Zeiger2016-01-271-0/+3
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | Calling `wrap` or one of the higher-dimension Array factory methods on the `Manifest` for `Unit` led to an exception because it tried to use `void` as a primitive type. Unlike all other primitive Scala types, `Unit` needs to be boxed. The basic `newArray` method was not affected by this bug because it was already special-cased. The fix is to also special-case `arrayClass`.
| * | | Link 'Future' scaladoc to 'Futures and Promises'Arnout Engelen2016-01-251-0/+2
| | | |
* | | | Merge commit 'bf599bc' into merge/2.11.x-to-2.12.x-20160203Jason Zaugg2016-02-0311-36/+53
|\| | | | |/ / |/| | | | | | | | | | | | | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/backend/opt/ConstantOptimization.scala src/compiler/scala/tools/nsc/transform/Constructors.scala src/compiler/scala/tools/nsc/typechecker/Contexts.scala src/scaladoc/scala/tools/nsc/doc/html/page/Template.scala src/scaladoc/scala/tools/nsc/doc/html/resource/lib/jquery.layout.js