Don't collect stream to list - return stream

This commit is contained in:
BoykoAlex
2017-10-28 17:56:01 -04:00
parent 7617470e29
commit 6ac37ca64e

View File

@@ -95,16 +95,13 @@ public class GradleProjectClasspath extends JandexClasspath {
@Override
public Stream<Path> getClasspathEntries() throws Exception {
EclipseProject root = getRootProject();
List<Path> classpathList = Stream.concat(gradleProject.getClasspath().stream().map(dep -> dep.getFile().toPath()),
return Stream.concat(gradleProject.getClasspath().stream().map(dep -> dep.getFile().toPath()),
gradleProject.getProjectDependencies().stream()
.map(d -> findPeer(root, d.getTargetProject().getName()))
.filter(o -> o.isPresent())
.map(o -> o.get())
.map(p -> p.getProjectDirectory().toPath().resolve(p.getOutputLocation().getPath()))
)
.collect(Collectors.toList());
return classpathList.stream();
);
}
private Optional<? extends EclipseProject> findPeer(EclipseProject root, String name) {