Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/java/org/sonarqube/gradle/JavaCompilerUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ private JavaCompilerUtils() {

public static Optional<JavaCompilerConfiguration> extractJavaCompilerConfigurationFromCompileTasks(Project project) {
TaskCollection<JavaCompile> javaCompileTaskCollection = project.getTasks().withType(JavaCompile.class);
if (javaCompileTaskCollection.isEmpty()) {
List<JavaCompile> javaCompileTaskList = new ArrayList<>(javaCompileTaskCollection);
if (javaCompileTaskList.isEmpty()) {
Comment on lines +45 to +46

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am little skeptical of this solution because of bad past experiences with copying, and underlying iteration, over lazy collection provided by Gradle but let's give it a try. Worst case, it behaves exactly the same as before.

return Optional.empty();
}
List<JavaCompile> javaCompileTaskList = new ArrayList<>(javaCompileTaskCollection);
List<JavaCompilerConfiguration> jdkHomesUsedByCompileTasks = javaCompileTaskList.stream()
.map(JavaCompilerUtils::extractConfiguration)
.collect(Collectors.toList());
Expand Down
Loading