This page is no longer maintained — Please continue to the home page at www.scala-lang.org

[scala-bts] #4087: LoggedNodeFactory's example is incorrect and/or outdated

No replies
Scala 2
Joined: 2009-03-05,
User offline. Last seen 42 years 45 weeks ago.

---------------------+------------------------------------------------------
Reporter: dcsobral | Owner: scala-xml_team
Type: defect | Status: new
Priority: normal | Component: XML support
Keywords: |
---------------------+------------------------------------------------------
=== How to reproduce ===
Try to compile the code given in {{{LoggedNodeFactory}}}'s scaladoc:

{{{
object testLogged extends Application {
val x = new scala.xml.nobinding.NoBindingFactoryAdapter
with scala.xml.LoggedNodeFactory[scala.xml.Elem]()
with scala.util.logging.ConsoleLogger;
Console.println("Start");
val doc = x.loadXML(new
org.xml.sax.InputSource("http://lamp.epfl.ch/~buraq"));
Console.println("End");
Console.println(doc);
}
}}}

=== What is the expected behavior? ===

It will compile.

=== What do you see instead? ===

It gives

{{{
:3: error: traits or objects may not have parameters
with scala.xml.LoggedNodeFactory[scala.xml.Elem]()
^
}}}

and, upon removing the extraneous {{{()}}}, it then gives

{{{
:6: error: value nobinding is not a member of package xml
val x = new scala.xml.nobinding.NoBindingFactoryAdapter
^
}}}

=== Additional information ===

Example extracted from today (15/12/2010) nightly's scaladoc. I have no
experience with the classes involved here, so I have no idea whether the
problem is trivial or not.

=== What versions of the following are you using? ===
- Scala: 2.9.0.r0-b20101211173807
- Java: Java HotSpot(TM) Client VM, Java 1.6.0_19
- Operating system: Windows Vista 64 bits

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland