Skip to content

Commit 0e0f130

Browse files
committed
Ensure immutability of passed collection items
1 parent bf20f88 commit 0e0f130

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

project-management/src/main/java/life/qbic/projectmanagement/application/api/AsyncProjectService.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,10 @@ record ProjectCreationRequest(ProjectDesign design, ProjectContacts contacts,
429429
* @since 1.10.0
430430
*/
431431
record SampleCreationRequest(String projectId, Collection<SampleRegistrationRequest> requests) {
432-
432+
public SampleCreationRequest(String projectId, Collection<SampleRegistrationRequest> requests) {
433+
this.projectId = projectId;
434+
this.requests = List.copyOf(requests);
435+
}
433436
}
434437

435438
/**
@@ -440,7 +443,10 @@ record SampleCreationRequest(String projectId, Collection<SampleRegistrationRequ
440443
* @since 1.10.0
441444
*/
442445
record SampleUpdateRequest(String projectId, Collection<SampleUpdate> requests) {
443-
446+
public SampleUpdateRequest(String projectId, Collection<SampleUpdate> requests) {
447+
this.projectId = projectId;
448+
this.requests = List.copyOf(requests);
449+
}
444450
}
445451

446452
/**

0 commit comments

Comments
 (0)