Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. Exception in thread "main" java.lang.ClassCastException: uk.ac.turingatemyhamster.vw152093.ExtendedNodeList cannot be cast to scala.collection.Traversable
  2. at scala.collection.generic.TraversableFactory$GenericCanBuildFrom.apply(TraversableFactory.scala:44)
  3. at scala.collection.TraversableLike$class.map(TraversableLike.scala:204)
  4. at uk.ac.turingatemyhamster.vw152093.ExtendedNodeList.map(Scrape.scala:32)
  5.  
  6. import collection.IndexedSeqLike
  7. import org.w3c.dom.NodeList
  8.  
  9. case class ExtendedNodeList(nl: NodeList) extends IndexedSeqLike[Node, List[Node]] { // <- line #44
  10. def length: Int = nl.getLength
  11. def apply(i: Int) = nl.item(i)
  12. def newBuilder = List.newBuilder
  13. }
  14.  
  15. ---------------
  16.  
  17. Triggered in:
  18.  
  19. myNodeList map foo
  20.  
  21. Not triggered in:
  22.  
  23. for(n <- myNodeList) foo(n)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement