summaryrefslogtreecommitdiff
path: root/src/library/scala/collection/mutable/BufferProxy.scala
Commit message (Collapse)AuthorAgeFilesLines
* Lower-case spelling of @deprecated messagesSimon Ochsenreither2016-05-281-2/+2
|
* SI-8251 Remove ListBuffer.readOnly as deprecatedSom Snytt2014-11-201-2/+0
| | | | Complete the story arc.
* Collections library tidying and deprecation. Separate parts are listed below.Rex Kerr2013-11-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+1
|
* Remove unused imports in library.Paul Phillips2012-11-191-3/+0
|
* Brings all copyrights (in comments) up-to-date, from 2011/12 to 2013Heather Miller2012-11-021-1/+1
|
* Address doc comment rot in the standard library.Jason Zaugg2012-05-131-1/+1
| | | | | | | | | | | | | | | | | | | | | - Match @param/@tparam names to the actual parameter name - Use @tparam for type parameters - Whitespace is required between `*` and `@` - Fix incorrect references to @define macros. - Use of monospace `` and {{{}}} (much more needed) - Remove `@param p1 ...` stubs, which appear in the generated docss. - But, retainsed `@param p1` stubs, assuming they will be filtered from the generated docs by SI-5795. - Avoid use of the shorthand `@param doc for the solitary param` (which works, but isn't recognized by the code inspection in IntelliJ I used to sweep through the problems) The remaining warnings from `ant docs` seem spurious, I suspect they are an unintended consequence of documenting extension methods. [scaladoc] /Users/jason/code/scala/src/library/scala/collection/TraversableOnce.scala:181: warning: Variable coll undefined in comment for method reduceOption in class Tuple2Zipped [scaladoc] def reduceOption[A1 >: A](op: (A1, A1) => A1): Option[A1] = reduceLeftOption(op) [scaladoc] ^
* 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.
* Removing the code which has been deprecated sin...Paul Phillips2011-08-151-20/+0
| | | | | | | Removing the code which has been deprecated since 2.8.0. Contributed by Simon Ochsenreither, although deleting code is such fun one hesitates to call it a contribution. Still, we will. Closes SI-4860, no review.
* 3rd round of clean ups (see r25285, r25292)michelou2011-07-151-3/+2
|
* Fixes #4490 and #4467.Kato Kazuyoshi2011-06-181-1/+1
|
* Adds "since" field to @deprecated.Paul Phillips2011-04-141-2/+2
| | | | | | for the patch, as it's a change I've always wanted. Moving up in the glamorous world of scala commits! No review.
* Refactoring the collections api to support diff...Aleksandar Pokopec2011-04-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactoring the collections api to support differentiation between referring to a sequential collection and a parallel collection, and to support referring to both types of collections. New set of traits Gen* are now superclasses of both their * and Par* subclasses. For example, GenIterable is a superclass of both Iterable and ParIterable. Iterable and ParIterable are not in a subclassing relation. The new class hierarchy is illustrated below (simplified, not all relations and classes are shown): TraversableOnce --> GenTraversableOnce ^ ^ | | Traversable --> GenTraversable ^ ^ | | Iterable --> GenIterable <-- ParIterable ^ ^ ^ | | | Seq --> GenSeq <-- ParSeq (the *Like, *View and *ViewLike traits have a similar hierarchy) General views extract common view functionality from parallel and sequential collections. This design also allows for more flexible extensions to the collections framework. It also allows slowly factoring out common functionality up into Gen* traits. From now on, it is possible to write this: import collection._ val p = parallel.ParSeq(1, 2, 3) val g: GenSeq[Int] = p // meaning a General Sequence val s = g.seq // type of s is Seq[Int] for (elem <- g) { // do something without guarantees on sequentiality of foreach // this foreach may be executed in parallel } for (elem <- s) { // do something with a guarantee that foreach is executed in order, sequentially } for (elem <- p) { // do something concurrently, in parallel } This also means that some signatures had to be changed. For example, method `flatMap` now takes `A => GenTraversableOnce[B]`, and `zip` takes a `GenIterable[B]`. Also, there are mutable & immutable Gen* trait variants. They have generic companion functionality.
* Updated copyright notices to 2011Antonio Cunei2011-01-201-1/+1
|
* removed warnings (deprecation,unchecked)michelou2010-06-291-3/+7
|
* 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.
* docs. no reviewAleksandar Pokopec2010-04-101-19/+22
|
* Work on mutable collections docs.Aleksandar Pokopec2010-04-091-12/+12
|
* TraversableOnce. Review by odersky.Paul Phillips2010-03-271-6/+5
|
* Updated copyright notices to 2010Antonio Cunei2009-12-071-1/+1
|
* Simplifiations in collections libraries, enable...Martin Odersky2009-11-201-3/+3
| | | | | | Simplifiations in collections libraries, enabled by introduction of Self type in TraversableLike.
* added `locally' to Predef.Martin Odersky2009-11-091-0/+4
| | | | | | added overloaded hashes to Predef. some small changes.
* ++: replaced by ++=:Martin Odersky2009-10-141-7/+2
|
* Changed mutable +: to +=:Martin Odersky2009-10-131-1/+1
|
* add @since annotationsstepancheg2009-09-261-0/+1
|
* Collections refactoring.Martin Odersky2009-09-251-10/+11
|
* Fixed build.Philipp Haller2009-09-221-1/+1
|
* Finished re-integrating mutable collections.Philipp Haller2009-09-221-1/+1
|
* fixed headers/comments/svn props, made some pro...michelou2009-09-151-8/+8
| | | | | | fixed headers/comments/svn props, made some progress with serializable classes
* Reintegrated DoubleLinkedList, SynchronizedBuff...Philipp Haller2009-09-081-9/+11
| | | | | | Reintegrated DoubleLinkedList, SynchronizedBuffer, ArrayStack, BufferProxy.
* The creation of scala.collection.mutable.Iterab...Paul Phillips2009-07-201-6/+6
| | | | | | | | | | | | The creation of scala.collection.mutable.Iterable in 2.8 means that all the other classes in scala.collection.mutable are impacted - what they once thought was scala.Iterable is now mutable Iterable. This meant such things as Stack ++= List(1,2,3) would no longer compile. This patch qualifies the relevant Iterables as collection.Iterables, though based on inspecting other classes, it's likely they should actually be Traversables.
* In "Iterable" and in all its subclasses, "itera...Gilles Dubochet2009-05-271-6/+6
| | | | | | In "Iterable" and in all its subclasses, "iterator" replaces "elements" (and assorted changes).
* separated mutable and immutable mapsMartin Odersky2009-05-121-2/+2
|
* massive new collections checkin.Martin Odersky2009-05-081-0/+2
|
* Updated (all) copyright notices to 2009Antonio Cunei2009-01-131-1/+1
|
* Added rich string builder (a random access sequ...Sean McDirmid2007-07-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | | Added rich string builder (a random access sequence, mutable buffer). Fleshed out compat.StringBuilder some more to support this. Rolled back buffered iterator to its simple "head" method form, added advanced buffer iterator for multi-lookahead peak (call buffered.advanced for advanced version) Made string a random access seq. Deprecated utility fromString methods for strings that no longer make sense (better alternatives in RichString). Also, ensured that many seq operations return strings. Changed deprecated accesses from XML library. Made Stream a sub-class of Seq.Projection rather than a direct subclass of Seq to support the lazy nature of Seq. Deprecated type aliases in Predef, deprecated direct access to Integer through Predef. Added to to Range.
* [1] upgraded buffered iterator to have unbounde...Sean McDirmid2007-05-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | [1] upgraded buffered iterator to have unbounded lookahead [2] down-graded some custom iterators that could not implement this behavior (compatible because the signatures only indicate Iterator) [3] added RollBackIterator for iterators that can be backed up (useful for scanning) [4] DefaultBufferedIterator for a nice default implementaiton of BufferedIterator [5] Added RandomAccessSeq for Seq's that can be indexed in linear time (e.g., Array), optimized seq methods for these seqs. Got the appropriate classes to inherit from this trait [6] Enhanced projections so they are iterables. An operation on a projection is also a projection (if possible) [7] Various small enhancements to the JCL
* Removed Pair(...), Triple(...).Martin Odersky2007-02-211-1/+1
|
* changed tuple syntax to (...)Martin Odersky2007-02-131-1/+1
|
* changed pair(...) to {...}Martin Odersky2007-02-051-1/+1
|
* Fxied bug 909;Martin Odersky2007-01-221-1/+1
| | | | | Updated collection library
* improved comments in scala/collection/*.scalamichelou2006-10-111-1/+2
|
* removed leading/trailing tabs/blanks in collect...michelou2006-10-041-126/+130
| | | | | removed leading/trailing tabs/blanks in collection/mutable/*.scala
* (no commit message)Martin Odersky2006-03-101-1/+1
|
* Small refactoring in some collection classesmihaylov2006-03-031-2/+2
|
* Use 'mixin class' instead of 'trait'mihaylov2006-03-031-1/+1
|
* Rearranged header and updated copyright messagemihaylov2006-03-021-2/+4
|
* Switching to the new build system and to the ne...Gilles Dubochet2005-12-191-0/+147
Switching to the new build system and to the new build system. This is a MAJOR commit, so be careful when updating.