summaryrefslogtreecommitdiff
path: root/src/library
Commit message (Collapse)AuthorAgeFilesLines
...
| | * | | 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
| * | Merge pull request #4886 from janekdb/2.11.x-scaladoc-Duration-linksSeth Tisue2016-01-141-2/+2
| |\ \ | | | | | | | | Fix Scaladoc overloaded method link to Duration companion object
| | * | Fix Scaladoc overloaded method link to Duration companion objectJanek Bogucki2016-01-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | The links were being skipped with a warning before this commit. The key change was to remove the result type and add an asterisk.
| * | | Merge pull request #4902 from ruippeixotog/issue/9605Seth Tisue2016-01-131-6/+6
| |\ \ \ | | | | | | | | | | SI-9605 Searching does not use binary search for Array
| | * | | SI-9605 Searching does not use binary search for ArrayRui Gonçalves2016-01-121-6/+6
| | |/ / | | | | | | | | | | | | Binary search should be used for every `IndexedSeqLike` instance and not only for `IndexedSeq`. According the Scaladoc, it is `IndexedSeqLike` that guarantees "constant-time or near constant-time element access and length computation".
| * / / SI-8641 Fix right shift docs for integer typesLinas Medziunas2016-01-035-20/+20
| |/ / | | | | | | | | | | | | Docs for >> operation of integer types (from Byte to Long) had a wrong direction saying that it is bit-shift left.
| * | Merge pull request #4882 from janekdb/2.11.x-scaladoc-tables-1Lukas Rytz2015-12-182-6/+11
| |\ \ | | | | | | | | Document JavaConverters conversion from java.util.Properties to Map
| | * | Document JavaConverters conversion from java.util.Properties to MapJanek Bogucki2015-12-122-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also - Fix grammar on duplicated DecorateAsJava comment by copying over from JavaConverters - Remove author tags
| * | | Merge pull request #4831 from martijnhoekstra/patch-4Seth Tisue2015-12-171-0/+12
| |\ \ \ | | | | | | | | | | add doc for log, sqrt
| | * | | change phrasing around eulers number for `log(x)`martijnhoekstra2015-12-111-3/+1
| | | | |
| | * | | add doc for log, sqrtmartijnhoekstra2015-10-301-0/+14
| | | | | | | | | | | | | | | | | | | | It's useful to know that log is the natural logarithm, not 10log or 2log or so. Also did sqrt "while I was at it"
| * | | | SI-9581 Fix overflow on Vector take and drop methodsRui Gonçalves2015-12-061-2/+2
| | |/ / | |/| | | | | | | | | | | | | | | | | | Fixes the index/length comparison in `Vector#take` and `Vector#drop` so that they handle all possible integer values. Given the collection's invariants `startIndex >= endIndex` and `0 >= startIndex, endIndex`, it is sufficient to change the arithmetic in the comparison as done in this commit to avoid overflows. As cases when `n <= 0` are handled beforehand, `endIndex - n` cannot overflow, contrary to `startIndex + n`. If without the danger of overflows the condition yields true, on the other hand, `startIndex + n` cannot overflow as it is smaller than `endIndex` (as the previous formulation of the condition shows).
* | | | Merge pull request #4870 from ruippeixotog/issue/9507Jason Zaugg2016-01-191-3/+4
|\ \ \ \ | | | | | | | | | | SI-9507 Make ArrayStack an IndexedSeqOptimized
| * | | | SI-9507 Make ArrayStack an IndexedSeqOptimizedRui Gonçalves2015-11-271-3/+4
| | | | | | | | | | | | | | | | | | | | Just like `ArraySeq`, `ArrayBuffer` and all other collections that use an array as underlying data structure, `ArrayStack` should also be an instance of `IndexedSeq` and `IndexedSeqOptimized`. As expected by both of the traits, `ArrayStack` has constant-time random element access and length computation.
* | | | | Merge pull request #4875 from slothspot/ticket/9454Lukas Rytz2015-12-182-9/+14
|\ \ \ \ \ | | | | | | | | | | | | [SI-9454] Add isAlive method into sys.process.Process trait
| * | | | | [SI-9454] Add isAlive method into sys.process.Process traitDmitry Melnichenko2015-12-112-9/+14
| | | | | |
* | | | | | Remove unused imports and other minor cleanupsSimon Ochsenreither2015-12-1864-264/+177
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Language imports are preceding other imports - Deleted empty file: InlineErasure - Removed some unused private[parallel] methods in scala/collection/parallel/package.scala This removes hundreds of warnings when compiling with "-Xlint -Ywarn-dead-code -Ywarn-unused -Ywarn-unused-import".
* | | | | | SI-9583: Update SystemProperties.empty to return a mutable.Map to fix buildersShane Delmore2015-12-101-1/+1
|/ / / / /
* | | | | Merge commit '5e99f82' into merge-2.11-to-2.12-nov-27Lukas Rytz2015-11-272-2/+2
|\ \ \ \ \ | | |/ / / | |/| | |
| * | | | Apply some static code analysis recommendationsJanek Bogucki2015-11-262-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a batch of code inspection recommendations generated by IntelliJ 14.1.5. Categories of fix, Unnecessary public modifier in interface Replace filter+size with count Replace filter+nonEmpty with exists Replace filter+headOption with find Replace `if (x != null) Some(x) else None` with Option(x) Replace getOrElse null with orNull Drop redundant semicolons Replace anon fun with PF Replace anon fun with method
* | | | | Clarify source of f functionCasey Leask2015-11-261-1/+1
| |/ / / |/| | |
* | | | Merge commit '8eb1d4c' into merge-2.11-to-2.12-nov-24Lukas Rytz2015-11-2436-280/+278
|\| | |
| * | | Fix List Scaladoc time & space formattingJanek Bogucki2015-11-221-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Performance section got sucked into a wormhole and popped up in the example tag. The laws of physics differ in the attributes block resulting in the loss of the line break between the Time and Space paragraphs. Fixed by moving the section out of the example tag.
| * | | Merge pull request #4810 from ruippeixotog/fix-mutable-setlike-clearAdriaan Moors2015-11-121-1/+3
| |\ \ \ | | | | | | | | | | SI-9497 Fix SetLike#clear() default implementation
| | * | | SI-9497 Fix SetLike#clear() default implementationRui Gonçalves2015-10-211-1/+3
| | | | | | | | | | | | | | | | | | | | When dealing with mutable collections, it is not safe to assume iterators will remain consistent when the collection is modified mid-traversal. The bug reported in SI-9497 is very similar to SI-7269, "ConcurrentModificationException when filtering converted Java HashMap". Then, only the `retain` method was fixed. This commit fixes `clear`, which had the same problem.
| * | | | Merge pull request #4804 from jvican/issue/9503Adriaan Moors2015-11-121-1/+2
| |\ \ \ \ | | | | | | | | | | | | [SI-9503] Deprecate scala.collection.immutable.PagedSeq
| | * | | | [SI-9503] Deprecate scala.collection.immutable.PagedSeqjvican2015-11-041-1/+2
| | | | | |
| * | | | | Improve collections documentation and prefer () to {}vsalvis2015-10-275-88/+85
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Remove some duplicate method documentation that is now inherited - Whitespace edits - Rewording of method docs - Clearer usage examples - tparam alignment for some usecase tags - Prefer () to { } for do nothing bodies
| * | | | Merge pull request #4803 from janekdb/2.11.x-conform-foreach-tparamSeth Tisue2015-10-2727-169/+170
| |\ \ \ \ | | |_|/ / | |/| | | Conform foreach tparam to majority naming convention
| | * | | Conform foreach tparam to majority naming conventionvsalvis2015-10-2127-169/+170
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'U' is the common choice for the foreach function result tparam. This command summarises the naming diversity before and after this change. $ fgrep -r 'def foreach[' *|cut -f2 -d:|cut -f1 -d'('|tr -s ' '|sed 's/override //g'|sort|uniq -c|sort -nr Before, 80 def foreach[U] 6 def foreach[C] 6 def foreach[B] 4 final def foreach[U] 3 def foreach[S] 2 inline final def foreach[U] 2 def foreach[A] 1 inline final def foreach[specialized 1 final def foreach[B] 1 * def foreach[U] 1 def foreach[Q] 1 def foreach[D] 1 def foreach[A,B,U] After, 98 def foreach[U] 5 final def foreach[U] 2 inline final def foreach[U] 1 inline final def foreach[specialized 1 * def foreach[U] 1 def foreach[A,B,U] (@ symbols removed.)