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

Xhtml.toXhtml on trunk will crash for <div></div>

2 replies
ymnk
Joined: 2008-08-20,
User offline. Last seen 4 years 7 weeks ago.

Hi there,

As the Subject says, Xhtml.toXhtml on trunk will fail with the stacktrace in
processing as follows,

$ scala
Welcome to Scala version 2.8.0.r17745-b20090516020906 (Java
HotSpot(TM) Client VM, Java 1.6.0_06).
Type in expressions to have them evaluated.
Type :help for more information.

scala> scala.xml.Xhtml.toXhtml()
java.util.NoSuchElementException
at scala.collection.generic.IterableTemplate$class.head(IterableTemplate.scala:96)
at scala.runtime.BoxedArray.scala$collection$generic$VectorTemplate$$super$head(BoxedArray.scala:24)
at scala.collection.generic.VectorTemplate$class.head(VectorTemplate.scala:136)
at scala.runtime.BoxedArray.head(BoxedArray.scala:24)
at scala.collection.generic.Tra...
scala>

The attached patch will fix it.

PS. That patch has fixed yet another bug, which fails to generate the string.

Sincerely,
--
Atsuhiko Yamanaka
JCraft,Inc.
1-14-20 HONCHO AOBA-KU,
SENDAI, MIYAGI 980-0014 Japan.
Tel +81-22-723-2150
+1-415-578-3454
Fax +81-22-224-8773
Skype callto://jcraft/

Jorge Ortiz
Joined: 2008-12-16,
User offline. Last seen 29 weeks 3 days ago.
Re: Xhtml.toXhtml on trunk will crash for <div></div>
Did you submit this as a bug report on Trac?

http://lampsvn.epfl.ch/trac/scala/

--j

On Sat, May 16, 2009 at 10:54 PM, Atsuhiko Yamanaka <atsuhiko [dot] yamanaka [at] gmail [dot] com> wrote:
Hi there,

As the Subject says, Xhtml.toXhtml on trunk will fail with the stacktrace in
processing <div></div> as follows,

$ scala
Welcome to Scala version 2.8.0.r17745-b20090516020906 (Java
HotSpot(TM) Client VM, Java 1.6.0_06).
Type in expressions to have them evaluated.
Type :help for more information.

scala> scala.xml.Xhtml.toXhtml(<div></div>)
java.util.NoSuchElementException
      at scala.collection.generic.IterableTemplate$class.head(IterableTemplate.scala:96)
      at scala.runtime.BoxedArray.scala$collection$generic$VectorTemplate$$super$head(BoxedArray.scala:24)
      at scala.collection.generic.VectorTemplate$class.head(VectorTemplate.scala:136)
      at scala.runtime.BoxedArray.head(BoxedArray.scala:24)
      at scala.collection.generic.Tra...
scala>

The attached patch will fix it.

PS. That patch has fixed yet another bug, which fails to generate the string.


Sincerely,
--
Atsuhiko Yamanaka
JCraft,Inc.
1-14-20 HONCHO AOBA-KU,
SENDAI, MIYAGI 980-0014 Japan.
Tel +81-22-723-2150
  +1-415-578-3454
Fax +81-22-224-8773
Skype callto://jcraft/

ymnk
Joined: 2008-08-20,
User offline. Last seen 4 years 7 weeks ago.
Re: Xhtml.toXhtml on trunk will crash for <div></div>

Hi,

On Wed, May 20, 2009 at 4:35 PM, Jorge Ortiz wrote:
> Did you submit this as a bug report on Trac?
>
> http://lampsvn.epfl.ch/trac/scala/

I filed it as
https://lampsvn.epfl.ch/trac/scala/ticket/2001

Sincerely,
--
Atsuhiko Yamanaka
JCraft,Inc.
1-14-20 HONCHO AOBA-KU,
SENDAI, MIYAGI 980-0014 Japan.
Tel +81-22-723-2150
+1-415-578-3454
Fax +81-22-224-8773
Skype callto://jcraft/

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