8207690: Parsing API for classpath and similar path strings

Roger Riggs roger.riggs at oracle.com
Tue Sep 11 13:09:02 UTC 2018

Hi Alan,

On 9/11/18 5:24 AM, Alan Bateman wrote:
> On 10/09/2018 21:55, Roger Riggs wrote:
>> Nope! there's quoting on Windows that gets short changed with that 
>> work around.
>> Other opinions?, Suggestions?
> One suggestion is reduce this down to one method that returns a stream 
> rather than a collection. It could work lazily if you want. Something 
> like:
>   Stream<String> splitSearchPath(String input)
> is a lot more flexible (in my view) and the places where we use Path 
> objects can use .map(Path::of).

Streams are fine and easy to get from a List; but overall are a much 
higher overhead than the list itself.
And they can't be stored or re-used. Which would mean re-parsing the 
string again.
> In passing, I see the current patch changes the UCP constructor that 
> is used for supporting -Xbootclasspath/a. That that will to be checked 
> to see if it has any impact on startup.
It uses the internal api that returns a String[] and and should have the 
same performance profile
as the current impl.  This is definately a place where a Stream impl 
would have a negative impact.

Thanks, Roger

> -Alan

More information about the core-libs-dev mailing list