Skip to content

Commit

Permalink
Defensive copy in addClasspathEntry so that it won't attempt to add a…
Browse files Browse the repository at this point in the history
…n element to a read-only list
  • Loading branch information
sambsnyd committed Mar 4, 2024
1 parent 10a7498 commit 01b44eb
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ B addClasspathEntry(Path entry) {
if (this.classpath.isEmpty()) {
this.classpath = Collections.singletonList(entry);
} else {
this.classpath = new ArrayList<>(classpath);
this.classpath.add(entry);
}
return (B) this;
Expand All @@ -382,7 +383,7 @@ public B classpath(String... artifactNames) {
return (B) this;
}

@SuppressWarnings("UnusedReturnValue")
@SuppressWarnings({"UnusedReturnValue", "unused"})
public B classpathFromResources(ExecutionContext ctx, String... classpath) {
this.artifactNames = Collections.emptyList();
this.classpath = dependenciesFromResources(ctx, classpath);
Expand Down

0 comments on commit 01b44eb

Please sign in to comment.