summaryrefslogtreecommitdiff
path: root/src/library/scala/collection/immutable/PagedSeq.scala
Commit message (Collapse)AuthorAgeFilesLines
* Lower-case spelling of @deprecated messagesSimon Ochsenreither2016-05-281-2/+2
|
* Remove unused imports and other minor cleanupsSimon Ochsenreither2015-12-181-1/+0
| | | | | | | | | | - 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".
* Merge commit '8eb1d4c' into merge-2.11-to-2.12-nov-24Lukas Rytz2015-11-241-1/+2
|\
| * [SI-9503] Deprecate scala.collection.immutable.PagedSeqjvican2015-11-041-1/+2
| |
* | Merge commit '03aaf05' into merge-2.11-to-2.12-sep-22Lukas Rytz2015-09-221-2/+2
|\|
| * 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.
* | Merge commit '7ba38a0' into merge/2.11.x-to-2.12.x-20150129Jason Zaugg2015-01-291-2/+6
|\| | | | | | | | | | | | | | | Conflicts: build.number src/compiler/scala/tools/nsc/transform/ExtensionMethods.scala src/library/scala/collection/Iterator.scala versions.properties
| * SI-6519 PagedSeq is not lazy enoughRex Kerr2014-11-211-2/+6
| | | | | | | | | | | | This was actually an issue with `length` of all things--it wasn't stopping scanning when it was past the end of what was requested. It'd just gratuitously read everything. Also fixed an overflow bug with isDefinedAt along the way (start + index > Int.MaxValue would always return true despite never working).
* | Prefer scala.Serializable to j.io.SerializableJason Zaugg2014-09-061-1/+1
|/ | | | | | | | | | | The former extends the latter, and exists as a platorm agnostic serialization marker trait. It is of less value now that we have jettisoned the MSIL backend, but while it still exists we ought ought to use it. I achieved this by replacing wildcard import of `java.io._` with selective imports, leaving `Serializable` to bind to `scala.Serializable`.
* SI-6615 PagedSeq's slice throws a NPE if it starts on a page that hasn't ↵Rex Kerr2013-12-311-1/+4
| | | | | | been computed yet Made sure to addMore when roving forward on a slice into unpaged territory.
* Collections library tidying and deprecation. Separate parts are listed below.Rex Kerr2013-11-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Collections library tidying, part one: scripting. Everything in scala.collection.scripting is deprecated now, along with the << method that is implemented in a few other classes. Scripting does not seem used at all, and anyone who did can easily write a wrapper that does the same thing. Deprecated *Proxy collections. The only place proxies were used in the library was in swing.ListView, and that was easy to change to a lazy val. Proxy itself is used in ScalaNumberProxy and such, so it was left undeprecated. Deprecated Synchronized* traits from collections. Synchronizability does not compose well, and it requires careful examination of every method (which has not actually been done). Places where the Scala codebase needs to be fixed (eventually) include: scala.reflect.internal.util.Statistics$QuantMap scala.tools.nsc.interactive.Global (several places) Deprecated LinkedList (including Double- and -Like variants). Interface is idiosyncratic and dangerously low-level. Although some low-level functionality of this sort would be useful, this doesn't seem to be the ideal implementation. Also deprecated the extractFirst method in Queue as it exposes LinkedList. Cannot shift internal representations away from LinkedList at this time because of that method. Deprecated non-finality of several toX collection methods. Improved documentation of most toX collection methods to describe what the expectation is for their behavior. Additionally deprecated overriding of - toIterator in IterableLike (should always forward to iterator) - toTraversable in TraversableLike (should always return self) - toIndexedSeq in immutable.IndexedSeq (should always return self) - toMap in immutable.Map (should always return self) - toSet in immutable.Set (should always return self) Did not do anything with IterableLike.toIterable or Seq/SeqLike.toSeq since for some odd reason immutable.Range overrides those. Deprecated Forwarders from collections. Forwarding, without an automatic mechanism to keep up to date with changes in the forwarded class, is inherently unreliable. Absent a mechanism to keep current, they're deprecated. ListBuffer is the only class in the collections library that uses forwarders, and that functionality can be rolled into ListBuffer itself. Deprecating immutable set/map adaptors. They're a bad idea (barring compiler support) for the same reason that all the other adaptors are a bad idea: they get out of date and probably have a variety of performance bugs. Deprecated inheritance from leaf classes in immutable collections. Inheriting from leaf-classes in immutable collections is rarely a good idea since whenever you use any interesting collections method you'll revert to the original class. Also, the methods are often designed to work with only particular behavior, and an override would be difficult (at best) to make work. Fortunately, people seem to have realized this and there are few to no cases of people extending PagedSeq and TreeSet and the like. Note that in many cases the classes will become sealed not final. Deprecated overriding of methods and inheritance from various mutable collections. Some mutable collections seem unsuited for overriding since to override anything interesting you would need vast knowledge of internal data structures and/or access to private methods. These include - ArrayBuilder.ofX classes. - ArrayOps - Some methods of BitSet (moved others from private to protected final) - Some methods of HashTable and FlatHashTable - Some methods of HashMap and HashSet (esp += and -= which just forward) - Some methods of other maps and sets (LinkedHashX, ListMap, TreeSet) - PriorityQueue - UnrolledBuffer This is a somewhat aggressive deprecation, the theory being better to try it out now and back off if it's too much than not attempt the change and be stuck with collections that can neither be safely inherited nor have implementation details changed. Note that I have made no changes--in this commit--which would cause deprecation warnings in any of the Scala projects available on Maven (at least as gathered by Adriaan). There are deprecation warnings induced within the library (esp. for classes/traits that should become static) and the compiler. I have not attempted to fix all the deprecations in the compiler as some of them touch the IDE API (but these mostly involved Synchronized which is inherently unsafe, so this should be fixed eventually in coordination with the IDE code base(s)). Updated test checks to include new deprecations. Used a higher level implementation for messages in JavapClass.
* Absolutized paths involving the scala package.Paul Phillips2013-05-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Confusing, now-it-happens now-it-doesn't mysteries lurk in the darkness. When scala packages are declared like this: package scala.collection.mutable Then paths relative to scala can easily be broken via the unlucky presence of an empty (or nonempty) directory. Example: // a.scala package scala.foo class Bar { new util.Random } % scalac ./a.scala % mkdir util % scalac ./a.scala ./a.scala:4: error: type Random is not a member of package util new util.Random ^ one error found There are two ways to play defense against this: - don't use relative paths; okay sometimes, less so others - don't "opt out" of the scala package This commit mostly pursues the latter, with occasional doses of the former. I created a scratch directory containing these empty directories: actors annotation ant api asm beans cmd collection compat concurrent control convert docutil dtd duration event factory forkjoin generic hashing immutable impl include internal io logging macros man1 matching math meta model mutable nsc parallel parsing partest persistent process pull ref reflect reify remote runtime scalap scheduler script swing sys text threadpool tools transform unchecked util xml I stopped when I could compile the main src directories even with all those empties on my classpath.
* More explicit empty paren lists in method calls.Jason Zaugg2013-02-241-2/+2
|
* Brings all copyrights (in comments) up-to-date, from 2011/12 to 2013Heather Miller2012-11-021-1/+1
|
* More relative path elimination.Paul Phillips2012-09-151-1/+1
| | | | | | | | | | | | | | | | Some names I missed in 55b609458fd . How one might know when one is done: mkdir scratch && cd scratch mkdir annotation beans collection compat concurrent io \ math parallel ref reflect runtime scala sys testing \ text tools util xml scalac $(find ../src/library -name '*.scala') Until recently that would fail with about a billion errors. When it compiles, that's when you're done. And that's where this commit takes us, for src/library at least.
* Eliminate breaking relative names in source.Paul Phillips2012-09-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These things are killing me. Constructions like package scala.foo.bar.baz import foo.Other DO NOT WORK in general. Such files are not really in the "scala" package, because it is not declared package scala package foo.bar.baz And there is a second problem: using a relative path name means compilation will fail in the presence of a directory of the same name, e.g. % mkdir reflect % scalac src/reflect/scala/reflect/internal/util/Position.scala src/reflect/scala/reflect/internal/util/Position.scala:9: error: object ClassTag is not a member of package reflect import reflect.ClassTag ^ src/reflect/scala/reflect/internal/util/Position.scala:10: error: object base is not a member of package reflect import reflect.base.Attachments ^ As a rule, do not use relative package paths unless you have explicitly imported the path to which you think you are relative. Better yet, don't use them at all. Unfortunately they mostly work because scala variously thinks everything scala.* is in the scala package and/or because you usually aren't bootstrapping and it falls through to an existing version of the class already on the classpath. Making the paths explicit is not a complete solution - in particular, we remain enormously vulnerable to any directory or package called "scala" which isn't ours - but it greatly limts the severity of the problem.
* removes array tagsEugene Burmako2012-06-081-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before 2.10 we had a notion of ClassManifest that could be used to retain erasures of abstract types (type parameters, abstract type members) for being used at runtime. With the advent of ClassManifest (and its subtype Manifest) it became possible to write: def mkGenericArray[T: Manifest] = Array[T]() When compiling array instantiation, scalac would use a ClassManifest implicit parameter from scope (in this case, provided by a context bound) to remember Ts that have been passed to invoke mkGenericArray and use that information to instantiate arrays at runtime (via Java reflection). When redesigning manifests into what is now known as type tags, we decided to explore a notion of ArrayTags that would stand for abstract and pure array creators. Sure, ClassManifests were perfectly fine for this job, but they did too much - technically speaking, one doesn't necessarily need a java.lang.Class to create an array. Depending on a platform, e.g. within JavaScript runtime, one would want to use a different mechanism. As tempting as this idea was, it has also proven to be problematic. First, it created an extra abstraction inside the compiler. Along with class tags and type tags, we had a third flavor of tags - array tags. This has threaded the additional complexity though implicits and typers. Second, consequently, when redesigning tags multiple times over the course of Scala 2.10.0 development, we had to carry this extra abstraction with us, which exacerbated the overall feeling towards array tags. Finally, array tags didn't fit into the naming scheme we had for tags. Both class tags and type tags sound logical, because, they are descriptors for the things they are supposed to tag, according to their names. However array tags are the odd ones, because they don't actually tag any arrays. As funny as it might sound, the naming problem was the last straw that made us do away with the array tags. Hence this commit.
* removes tags and their incantations from PredefEugene Burmako2012-06-081-0/+1
| | | | | | All tags and reflection-related stuff requires a prefix, be it scala.reflect for simple tags (ArrayTags and ClassTags), or scala.reflect.basis/scala.reflect.runtime.universe for type tags.
* Fixes SI-4478.Simon Ochsenreither2012-05-021-1/+1
| | | | | | | | | | - Replaced/simplified usages of "wrt". - Added backticks to $Coll definitions, so stuff like "immutable.Stack" hopefully stops being interpreted as the end of a sentence and shown like that in the summary line of ScalaDoc's method description. See collection.immutable.Stack's sortBy. Additionally, it looks nicer this way. - Fixes the typo mentioned in SI-5666.
* migrates stdlib and compiler to tagsEugene Burmako2012-04-231-5/+5
| | | | | * all usages of ClassManifest and Manifest are replaced with tags * all manifest tests are replaced with tag tests
* Dropped about 1.5 Mb off scala-library.jar.Paul Phillips2011-11-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit and the two subsequent commits were contributed by: Todd Vierling <tv@duh.org>. I combined some commits and mangled his commit messages, but all the credit is his. This pursues the same approach to classfile reduction seen in r19989 when AbstractFunctionN was introduced, but applies it to the collections. Thanks to -Xlint it's easy to verify that the private types don't escape. Design considerations as articulated by Todd: * Don't necessarily create concrete types for _everything_. Where a subtrait only provides a few additional methods, don't bother; instead, use the supertrait's concrete class and retain the "with". For example, "extends AbstractSeq[A] with LinearSeq[A]". * Examine all classes with .class file size greater than 10k. Named classes and class names ending in $$anon$<num> are candidates for analysis. * If a return type is currently inferred where an anon subclass would be returned, make the return type explicit. Don't allow the library-private abstract classes to leak into the public namespace [and scaladoc].
* Improves PagedSeq API documentation.Heather Miller2011-09-171-37/+42
|
* Fixes #4490 and #4467.Kato Kazuyoshi2011-06-181-13/+13
|
* Updated copyright notices to 2011Antonio Cunei2011-01-201-1/+1
|
* Fixes #3647, closes #3647, adds a test case for...Aleksandar Pokopec2010-11-191-4/+3
| | | | | | | | Fixes #3647, closes #3647, adds a test case for it, and a missing test case for #3935. No review.
* Removed more than 3400 svn '$Id' keywords and r...Antonio Cunei2010-05-121-1/+0
| | | | | Removed more than 3400 svn '$Id' keywords and related junk.
* Immutable up to Queue docs. no reviewAleksandar Pokopec2010-04-131-3/+9
|
* As a brief diversion from real work, implemente...Paul Phillips2010-04-061-3/+3
| | | | | | | | | As a brief diversion from real work, implemented Damerau–Levenshtein and ran it on trunk to elicit obvious misspellings. Unfortunately they're mostly in places like compiler comments which real people never see, but I fixed them anyway. All those English Lit majors who peruse our sources are sure to be pleased. No review.
* Updated copyright notices to 2010Antonio Cunei2009-12-071-1/+1
|
* More world-shaking deprecation work.Paul Phillips2009-11-201-1/+1
| | | | | | | object, updating some @deprecated messages to give realistic alternatives, properly resolving the semantic mismatch between List.-- and diff, its once-recommended but inequivalent alternative.
* Removed everything deprecated in 2.7.3 or earli...Paul Phillips2009-11-121-1/+1
| | | | | | Removed everything deprecated in 2.7.3 or earlier except the lower case primitive type aliases, plus associated fixes.
* renamed Vector to IndexedSeqTiark Rompf2009-10-211-1/+1
|
* add @since annotationsstepancheg2009-09-261-0/+3
|
* Collections refactoring.Martin Odersky2009-09-251-2/+3
|
* [no content change] Fixed all SVN properties: m...Gilles Dubochet2009-09-241-1/+1
| | | | | | | | [no content change] Fixed all SVN properties: mimes, EOL, executable. Id expansion is consistently enabled for Scala/Java/C# sources in 'src/' and consistently disabled and removed from everywhere else: there should not be any dead Id tags anymore.
* new arrays are done.Martin Odersky2009-09-211-4/+4
|
* some changes and additions to move to new arrays.Martin Odersky2009-09-041-1/+1
|
* A variety of work on scala.io.{ File, Source } ...Paul Phillips2009-08-161-1/+1
| | | | | | | | | | | | | A variety of work on scala.io.{ File, Source } with changes including: getLines() now takes a line separator argument (defaults to platform line.separator) and drops the newlines. scala.io.File adds several convenience methods. The mechanisms for configuring Source are more consistent. This is not complete, performance issues remain to be investigated.
* More work and documentation for GenericRanges, ...Paul Phillips2009-06-241-4/+7
| | | | | | More work and documentation for GenericRanges, plus minor findbugs noticed issues.
* In "Iterable" and in all its subclasses, "itera...Gilles Dubochet2009-05-271-4/+4
| | | | | | In "Iterable" and in all its subclasses, "iterator" replaces "elements" (and assorted changes).
* Further refinement of fix for #1960.Paul Phillips2009-05-081-5/+5
|
* massive new collections checkin.Martin Odersky2009-05-081-1/+1
|
* Updated (all) copyright notices to 2009Antonio Cunei2009-01-131-1/+1
|
* drop svn:executable flags from scala sourcesstepancheg2008-05-291-0/+0
|
* (1) Removed generation of $tag method for inter...Martin Odersky2008-04-071-0/+245
(1) Removed generation of $tag method for interfaces (2) improved type inference for clsoures (3) redesign of CharSequence and regex.