| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
- 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.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Provide simpler commented example for Future.map
|
| | |_|/ /
| |/| | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Adding connection between map and for
As described by SethTisue.
Removing parentheses
Fixing scaladoc
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Use invokedynamic for structural calls, symbol literals, lambda ser.
|
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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 2.11.x to 2.12.x [ci:last-only]
|
| |\ \ \ \ \
| | | |/ / /
| | |/| | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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
|
| | |\ \ \ \
| | | | | | |
| | | | | | | |
SI-9623 Avoid unnecessary hasNext calls in JoinIterator & ConcatIterator
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
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.
|
| | | |_|/ /
| | |/| | | |
|
|\ \ \ \ \ \
| |/ / / / /
|/| | | | | |
SI-9452: Extend BigDecimal with Ordered for java interop
|
| |\ \ \ \ \ |
|
| | | | | | | |
|
| | |_|_|/ /
| |/| | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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/2.11.x-to-2.12.x-20160203
|
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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.).
|
|\ \ \ \ \
| | |/ / /
| |/| | |
| | | | |
| | | | |
| | | | | |
Conflicts:
build.sbt
scripts/jobs/integrate/bootstrap
|
| | |/ /
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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`.
|
| | | | |
|
|\| | |
| |/ /
|/| |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| |\ \
| | | |
| | | | |
Fix Scaladoc overloaded method link to Duration companion object
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The links were being skipped with a warning before this commit.
The key change was to remove the result type and add an asterisk.
|
| |\ \ \
| | | | |
| | | | | |
SI-9605 Searching does not use binary search for Array
|
| | |/ /
| | | |
| | | |
| | | | |
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".
|
| |/ /
| | |
| | |
| | |
| | | |
Docs for >> operation of integer types (from Byte to Long) had a wrong
direction saying that it is bit-shift left.
|
| |\ \
| | | |
| | | | |
Document JavaConverters conversion from java.util.Properties to Map
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Also
- Fix grammar on duplicated DecorateAsJava comment by copying over from
JavaConverters
- Remove author tags
|
| |\ \ \
| | | | |
| | | | | |
add doc for log, sqrt
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | | |
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"
|
| | |/ /
| |/| |
| | | |
| | | |
| | | |
| | | | |
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).
|
|\ \ \ \
| | | | |
| | | | | |
SI-9507 Make ArrayStack an IndexedSeqOptimized
|
| | | | |
| | | | |
| | | | |
| | | | | |
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.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
[SI-9454] Add isAlive method into sys.process.Process trait
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
- 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".
|
|/ / / / / |
|
|\ \ \ \ \
| | |/ / /
| |/| | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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
|
| |/ / /
|/| | | |
|
|\| | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| |\ \ \
| | | | |
| | | | | |
SI-9497 Fix SetLike#clear() default implementation
|
| | | | |
| | | | |
| | | | |
| | | | | |
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.
|
| |\ \ \ \
| | | | | |
| | | | | | |
[SI-9503] Deprecate scala.collection.immutable.PagedSeq
|
| | | | | | |
|
| | |_|/ /
| |/| | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
- 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
|
| |\ \ \ \
| | |_|/ /
| |/| | | |
Conform foreach tparam to majority naming convention
|
| | |/ /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
'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.)
|