mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
#159 Possible NPE bug in URL resolver
This commit is contained in:
parent
be5928c827
commit
b723924e85
@ -73,6 +73,9 @@ public class ResolverForClasspath implements ContentResolver {
|
||||
@Override
|
||||
public List<Content<?>> resolve(URI uri) {
|
||||
List<Path> paths = resolvePaths(uri);
|
||||
if (paths==null) {
|
||||
return List.of();
|
||||
}
|
||||
List<Content<?>> contents = paths.stream().map(PathContent::new).collect(Collectors.toList());
|
||||
return contents;
|
||||
|
||||
|
@ -64,8 +64,8 @@ public class URLContent implements Content<URL> {
|
||||
InputStreamReader inputStreamReader = new InputStreamReader(inputStream, StandardCharsets.UTF_8);
|
||||
BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
|
||||
Stream<String> lines = bufferedReader.lines();
|
||||
String buffdata = lines.collect(Collectors.joining());
|
||||
this.buffer = ByteBuffer.wrap(buffdata.getBytes(StandardCharsets.UTF_8)).asCharBuffer().asReadOnlyBuffer();
|
||||
String buffdata = lines.map(l -> l+"\n").collect(Collectors.joining());
|
||||
return CharBuffer.wrap(buffdata);
|
||||
}
|
||||
|
||||
return buffer;
|
||||
|
Loading…
Reference in New Issue
Block a user