summaryrefslogtreecommitdiff
path: root/src/library
Commit message (Collapse)AuthorAgeFilesLines
* 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 #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
| |/ |/|
* | 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 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).
* | 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
* | 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.)
* | Merge pull request #4800 from sjrd/remove-lingering-printlnLukas Rytz2015-10-212-4/+1
|\ \ | |/ |/| Remove two lingering `println`s in non-debug methods of the library.
| * Remove two lingering `println`s in non-debug methods of the library.Sébastien Doeraene2015-10-132-4/+1
| |
* | Merge pull request #4798 from performantdata/issue/9513Seth Tisue2015-10-151-1/+18
|\ \ | | | | | | SI-9513 decrement "deleted" count in OpenHashMap.put() when slot reused
| * | Document some OpenHashMap internal methods.Performant Data LLC2015-10-101-0/+13
| | |
| * | SI-9513 decrement "deleted" count in OpenHashMap.put() when slot reusedPerformant Data LLC2015-10-101-1/+5
| |/
* | Merge pull request #4788 from dk14/patch-1Seth Tisue2015-10-141-1/+1
|\ \ | | | | | | explicitly specify insertion-order feature in docs
| * | explicitly specify insertion-order feature in docsdk142015-10-061-1/+1
| |/
* / Rename forall, exists and find predicate and operator params.Janek Bogucki2015-10-099-71/+86
|/ | | | | | | | | | | | Align parameters names to use p for predicates and op for combining operations. Based on #4760. Extended to include, - Tuple2Zipped - Tuple3Zipped - Either The original author was vsalvis.
* Use InternalCallbackExecutor in Future.sequencePaul Draper2015-10-021-1/+1
| | | | | Previously _.result() was invoked in the "real" ExecutionContext, but this is an unnecessary use of the context.
* Fix typo in Process.scalaRyan Zhang2015-09-291-2/+2
|
* Merge pull request #4716 from Ichoran/issue/9388Lukas Rytz2015-09-212-42/+73
|\ | | | | SI-9388 Fix Range behavior around Int.MaxValue
| * SI-9388 Fix Range behavior around Int.MaxValueRex Kerr2015-09-192-42/+73
| | | | | | | | | | | | | | | | | | | | terminalElement (the element _after_ the last one!) was used to terminate foreach loops and sums of non-standard instances of Numeric. Unfortunately, this could result in the end wrapping around and hitting the beginning again, making the first element bad. This patch fixes the behavior by altering the loop to end after the last element is encountered. The particular flavor was chosen out of a few possibilities because it gave the best microbenchmarks on both large and small ranges. Test written. While testing, a bug was also uncovered in NumericRange, and was also fixed. In brief, the logic around sum is rather complex since division is not unique when you have overflow. Floating point has its own complexities, too. Also updated incorrect test t4658 that insisted on incorrect answers (?!) and added logic to make sure it at least stays self-consistent, and fixed the range.scala test which used the same wrong (overflow-prone) formula that the Range collection did.
* | Merge pull request #4758 from lrytz/pagedSeqNpeSeth Tisue2015-09-211-2/+2
|\ \ | | | | | | Fix NPE in PagedSeq.slice at end of seq
| * | Fix NPE in PagedSeq.slice at end of seqTomas Janousek2015-09-211-2/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | See https://github.com/scala/scala-parser-combinators/issues/70 Basically the same thing as SI-6615, including the fact everything works okay if the PagedSeq is printed before calling slice. It might seem strange that this allows taking slices that start beyond the end, but - this was possible anyway if one forced the entire sequence, and - it is reasonable to be able to take a slice at the very end (not beyond it) and get an empty sequence, which is exactly what StreamReader in scala-parser-combinators does and gets an NPE.
* / bump copyright year in `scala -version`Seth Tisue2015-09-181-2/+2
|/ | | | | | | a little piece of #4644 I missed. fixes this: % scala -version Scala code runner version 2.11.7 -- Copyright 2002-2013, LAMP/EPFL
* Merge pull request #4738 from janekdb/2.11.x-urls-driftedSeth Tisue2015-09-153-6/+5
|\ | | | | Improve drifted URLs
| * Improve drifted URLsJanek Bogucki2015-09-093-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Any.scala: Link to the guide instead of the SIP. - AnyVal.scala: Remove SIP link and align guide link to Any.scala. - Commands.scala: Use a less out of date team link. - Logic.scala: Link was broken. Substitute found. - Process.scala: Links were 403 & 404. Fixed as this is a code sample. - TypeMaps.scala: Move old EPFL Trac to JIRA. - RedBlackTree.scala: Replaced broken link with substitutes based on site maintainer input [1]. [1] When asked where Data-Set-RBTree.html had gone Don@UNSW advised "I think it's on the Haskell wiki now. It was Chris Okazaki's version". The closest I could find to what this document probably was is this paper by Hinze edited by Okasaki, http://www.cs.ox.ac.uk/ralf.hinze/publications/WAAAPL99b.ps.gz The paper cites the Okasaki document so I included a link to that as well. The Haskell Wiki does have a link to a RB document but that's broken too, https://wiki.haskell.org/Research_papers/Data_structures > Constructing red-black trees
* | Merge pull request #4728 from janekdb/2.11.x-urls-docs-codehaus-citeseerSeth Tisue2015-09-154-3/+6
|\ \ | | | | | | Update links to docs, codehaus and citeseer
| * | Update links to docs, codehaus and citeseerJanek Bogucki2015-09-044-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | docs.scala-lang.org - Align some links to new layout for docs.scala-lang.org - Include link to concrete parallel collection performance characteristics codehaus - Subsitute a link to a JIRA email for the 404 JRUBY-3576 JIRA link in Codec.scala. jira.codehaus.org is not redirecting this. citeseer - Replace the citeseer link with a direct link to a PDF which is not behind a login challenge.
* | | Merge pull request #4742 from janekdb/2.11.x-scaladoc-in-context-ListSeth Tisue2015-09-151-1/+1
|\ \ \ | | | | | | | | Restore missing element type to List class documentation
| * | | Restore missing element type to List class documentationJanek Bogucki2015-09-111-1/+1
| | |/ | |/| | | | | | | | | | | | | | | | | | | See line 18, git show cb1c0c src/library/scala/collection/immutable/List.scala|head -20|cat -n This shows the type reference prior to removal.