Skip to content
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

scala.xml.Node toString does not allow extending the Node class #6800

Closed
scabug opened this issue Dec 11, 2012 · 2 comments
Closed

scala.xml.Node toString does not allow extending the Node class #6800

scabug opened this issue Dec 11, 2012 · 2 comments

Comments

@scabug
Copy link

scabug commented Dec 11, 2012

With Scala 2.9.2 you could extend a scala.xml.Node and create your own class. When you use toString, the default case would print out the custom Node much like an Elem, since this was the catch all implementation.

Since this commit (see src/library/scala/xml/Utility.scala): scala/scala@e7ea29c

The behavior changed to printing Elem and throwing an exception when it was not one of the known sub-classes of Node.

This means the user can no longer extend the XML hierarchy with his own classes and use toString, since any XML tree that includes custom classes extending Node will throw exceptions on a toString.

@scabug
Copy link
Author

scabug commented Dec 11, 2012

Imported From: https://issues.scala-lang.org/browse/SI-6800?orig=1
Reporter: Thomas Santana (nebulorum)
Affected Versions: 2.10.0-RC5

@scabug
Copy link
Author

scabug commented Jul 17, 2015

@SethTisue said:
The scala-xml library is now community-maintained. Issues with it are now tracked at https://github.com/scala/scala-xml/issues instead of here in the Scala JIRA.

Interested community members: if you consider this issue significant, feel free to open a new issue for it on GitHub, with links in both directions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant