Skip to content

scala.collection.mutable.Stack deprecated #147

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

ashawley
Copy link
Member

@ashawley ashawley commented May 3, 2017

Scala 2.12 produces warnings about deprecations, there are others, but this is a particular brutal one.

Convert uses of mutable.Stack to immutable.List and var.

I've tried to preserve binary compatability, by creating members that use collection.mutable.Stack.apply, but I don't get the deprecation warnings. Must be only the constructor has deprecation warnings? Regardless, the changes to avoid mima complaining is fraudulent binary compatability: I created members of the type mima wants, but the values are not actually used. So if users dependended on these members in their code, this would break. I don't think this is very likely, because the code smells very much like internal accounting.

Maybe we just change everything to List, break bincompat, add entries to mimaBinaryIssueFilters and call it fixed instead?

@ashawley ashawley force-pushed the stack-deprecated branch from 5d99ec4 to 207d6dc Compare May 5, 2017 15:58
@ashawley ashawley mentioned this pull request May 5, 2017
ashawley added 3 commits May 6, 2017 10:31
Using assertTrue and == won't show expected versus result.
shared/src/main/scala/scala/xml/dtd/impl/SubsetConstruction.scala:35: class Stack in package mutable is deprecated (since 2.12.0): Stack is an inelegant and potentially poorly-performing wrapper around List. Use a List assigned to a var instead.
    val rest = new mutable.Stack[immutable.BitSet]
                           ^
shared/src/main/scala/scala/xml/include/sax/XIncluder.scala:129: class Stack in package mutable is deprecated (since 2.12.0): Stack is an inelegant and potentially poorly-performing wrapper around List. Use a List assigned to a var instead.
  private val entities = new mutable.Stack[String]()
                                     ^
shared/src/main/scala/scala/xml/parsing/FactoryAdapter.scala:42: class Stack in package mutable is deprecated (since 2.12.0): Stack is an inelegant and potentially poorly-performing wrapper around List. Use a List assigned to a var instead.
  val attribStack = new mutable.Stack[MetaData]
                                ^
shared/src/main/scala/scala/xml/parsing/FactoryAdapter.scala:43: class Stack in package mutable is deprecated (since 2.12.0): Stack is an inelegant and potentially poorly-performing wrapper around List. Use a List assigned to a var instead.
  val hStack = new mutable.Stack[Node] // [ element ] contains siblings
                           ^
shared/src/main/scala/scala/xml/parsing/FactoryAdapter.scala:44: class Stack in package mutable is deprecated (since 2.12.0): Stack is an inelegant and potentially poorly-performing wrapper around List. Use a List assigned to a var instead.
  val tagStack = new mutable.Stack[String]
                             ^
shared/src/main/scala/scala/xml/parsing/FactoryAdapter.scala:45: class Stack in package mutable is deprecated (since 2.12.0): Stack is an inelegant and potentially poorly-performing wrapper around List. Use a List assigned to a var instead.
  var scopeStack = new mutable.Stack[NamespaceBinding]
                               ^
Maybe just whitelist binary incompatabilities instead
with mimaBinaryIssueFilters?

https://github.com/typesafehub/migration-manager/wiki/sbt-plugin
@ashawley ashawley force-pushed the stack-deprecated branch from 207d6dc to e0cbe97 Compare May 6, 2017 14:31
@SethTisue
Copy link
Member

Maybe we just change everything to List, break bincompat, add entries to mimaBinaryIssueFilters and call it fixed instead

I think breaking bincompat here would be fine.

@ashawley ashawley mentioned this pull request May 11, 2017
@SethTisue
Copy link
Member

replaced by #150

@SethTisue SethTisue closed this May 11, 2017
@ashawley ashawley deleted the stack-deprecated branch May 11, 2017 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants