-
Couldn't load subscription status.
- Fork 92
merged fix from Guillem Salas for bug https://issues.scala-lang.org/brow... #19
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
Changes from 1 commit
2de8a3b
2d34d9c
619be11
0ffa4cb
52076e5
cc59fba
d1b0496
739fc04
aa7f7c7
8372cea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,4 @@ | ||
| addSbtPlugin("org.scala-lang.modules" % "scala-module-plugin" % "1.0.1") | ||
| addSbtPlugin("org.scala-lang.modules" % "scala-module-plugin" % "1.0.1") | ||
|
|
||
| addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.4.0") | ||
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -91,13 +91,20 @@ class XMLEventReader(src: Source) | |
| def text(pos: Int, txt: String) = setEvent(EvText(txt)) | ||
|
|
||
| override def run() { | ||
| curInput = input | ||
| interruptibly { this.initialize.document() } | ||
| setEvent(POISON) | ||
| try { | ||
| curInput = input | ||
| interruptibly { | ||
| this.initialize.document() | ||
| } | ||
| setEvent(POISON) | ||
| } catch { | ||
| case e: Throwable => setEvent(new EvError(e)) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should probably only catch |
||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| case class EvError(e: Throwable) extends XMLEvent | ||
| // An iterator designed for one or more producers to generate | ||
| // elements, and a single consumer to iterate. Iteration will continue | ||
| // until closeIterator() is called, after which point producers | ||
|
|
@@ -138,11 +145,16 @@ trait ProducerConsumerIterator[T >: Null] extends Iterator[T] { | |
|
|
||
| // consumer/iterator interface - we need not synchronize access to buffer | ||
| // because we required there to be only one consumer. | ||
| def hasNext = !eos && (buffer != null || fillBuffer) | ||
|
|
||
| def hasNext() = { | ||
| if (buffer.isInstanceOf[EvError]) | ||
| throw buffer.asInstanceOf[EvError].e | ||
| !eos && (buffer != null || fillBuffer) | ||
| } | ||
| def next() = { | ||
| if (eos()) throw new NoSuchElementException("ProducerConsumerIterator") | ||
| if (buffer == null) fillBuffer() | ||
| if (eos) throw new NoSuchElementException("ProducerConsumerIterator") | ||
| if (buffer.isInstanceOf[EvError]) | ||
| throw buffer.asInstanceOf[EvError].e | ||
| if (buffer == null) fillBuffer | ||
|
|
||
| drainBuffer() | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should go in your local git excludes file, as it's specific to your setup, not this project