1

Let me say that I have a single string concatenated uris.

http://...[sp]http://...[sp]http://...

I'm trying to convert each split string to URIs.

Stream.of(string.split("\\s")).map(uri -> URI::new);

Compiler complains.

Cannot infer type-variable(s) R

What did I do wrong?

Tagir Valeev
  • 92,683
  • 18
  • 210
  • 320
Jin Kwon
  • 18,308
  • 12
  • 99
  • 160
  • 1
    A guess: URI has several constructors, all of which take only String parameters. All those ctor patterns match your input of a stream of Strings, so it can't choose which one. – markspace Dec 23 '14 at 04:14
  • @markspace Confirmed. I don't understand what the constructor with a single String is not chosen. – Jin Kwon Dec 23 '14 at 04:19

1 Answers1

1
Stream.of(s.split("//s")).map(URI::new);

click here for an example

Community
  • 1
  • 1
Ramesh-X
  • 4,170
  • 6
  • 46
  • 60