Skip to content

Weird error when working with StreamConverters #87

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

Closed
nartamonov opened this issue Apr 6, 2017 · 13 comments
Closed

Weird error when working with StreamConverters #87

nartamonov opened this issue Apr 6, 2017 · 13 comments
Assignees
Labels

Comments

@nartamonov
Copy link

Hi all! Following semantically correct code throws weird runtime error:

import scala.compat.java8.StreamConverters._
import java.util.stream.Collectors

val sampleItems = Iterator.fill(120)("a").toVector
val subset = sampleItems.slice(0, 40)
val subsetAsStream = subset.seqStream

// Throws
// java.lang.NullPointerException:
// at scala.compat.java8.converterImpl.StepsAnyVector.next(StepsVector.scala:66)
// at scala.compat.java8.collectionImpl.AnyStepper.forEachRemaining(Stepper.scala:230)
// at scala.compat.java8.collectionImpl.AnyStepper.forEachRemaining$(Stepper.scala:230)
// at scala.compat.java8.converterImpl.StepsLikeIndexed.forEachRemaining(StepsLikeIndexed.scala:28)
// at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
// at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
// at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
// at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
// at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
val subsetAsJList = subsetAsStream.collect(Collectors.toList())
@SethTisue
Copy link
Member

still reproducible. more compactly, it's Vector.fill(120)("a").slice(0, 40).seqStream.collect(Collectors.toList())

@SethTisue
Copy link
Member

looks like a subtle bug in StepsVector

@SethTisue
Copy link
Member

Rex says scold him if he doesn't get to it this week.

@SethTisue
Copy link
Member

ping @Ichoran

@SethTisue
Copy link
Member

SethTisue commented Jun 26, 2018

Rex, you are SCOLDED 🔥

@Ichoran
Copy link
Contributor

Ichoran commented Jun 27, 2018

@SethTisue - Thanks! Unfortunately I'm at a conference all week and will forget it ever happened before I get back home. You will probably have to scold me again next week!

@SethTisue
Copy link
Member

SethTisue commented Jun 27, 2018

I'm good at scolding. And I like it, a little.

@SethTisue
Copy link
Member

@Ichoran scold scold scold

@Ichoran
Copy link
Contributor

Ichoran commented Jul 12, 2018

Okay, okay! I'll get to it this weekend. (Where the "'ll" should be interpreted as "intend to, with fairly high (~85%) probability of success".)

@Ichoran
Copy link
Contributor

Ichoran commented Jul 16, 2018

Didn't quite get finished. I'll wrap it up tonight if I get any more time.

@Ichoran
Copy link
Contributor

Ichoran commented Jul 17, 2018

I won't get time to finish until Wednesday night.

@Ichoran
Copy link
Contributor

Ichoran commented Jul 19, 2018

Argh, place I intended to work closed an hour early. I think I'm very close.

@Ichoran
Copy link
Contributor

Ichoran commented Jul 28, 2018

@SethTisue - #117 (I forgot the magic words that would link it automatically to the issue.)

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

No branches or pull requests

3 participants