SCANGRADLE-376 Fix gradle9 GH Job on Peachee#445
SCANGRADLE-376 Fix gradle9 GH Job on Peachee#445asya-vorobeva wants to merge 1 commit intomasterfrom
Conversation
|
|
This PR is stale because it has been open 7 days with no activity. If there is no activity in the next 7 days it will be closed automatically |
e03b83a to
5a8595a
Compare
5a8595a to
6bfe0b8
Compare
|
|
This PR is stale because it has been open 7 days with no activity. If there is no activity in the next 7 days it will be closed automatically |
| List<JavaCompile> javaCompileTaskList = new ArrayList<>(javaCompileTaskCollection); | ||
| if (javaCompileTaskList.isEmpty()) { |
There was a problem hiding this comment.
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.
6bfe0b8 to
f420099
Compare
|
There was a problem hiding this comment.
Conclusion: Clean, targeted fix. Snapshotting the TaskCollection into an ArrayList before any operations on it is the correct way to avoid ConcurrentModificationException in Gradle 9, and moving the snapshot creation before the isEmpty() check ensures even that first call operates on the stable copy.




Fix ConcurrentModificationException in JavaCompilerUtils.