Skip to content
This repository was archived by the owner on Aug 1, 2025. It is now read-only.

Commit fcc2f55

Browse files
committed
delete unnecessary code
1 parent a8c891b commit fcc2f55

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/main/java/org/brapi/test/BrAPITestServer/service/core/ListService.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -268,15 +268,13 @@ private void updateEntity(ListEntity entity, @Valid ListNewRequest list) throws
268268
entity.setListOwnerPerson(person);
269269
}
270270

271-
if (entity.getData() != null) {
272-
entity.getData().stream().forEach((item) -> {
273-
item.setList(null);
274-
});
275-
}
276-
277271
if (list.getData() != null) {
278272
// Clear existing items
279-
entity.getData().clear();
273+
if (entity.getData() == null) {
274+
entity.setData(new ArrayList<>());
275+
} else {
276+
entity.getData().clear();
277+
}
280278

281279
// Add new items
282280
ListIterator<String> iter = list.getData().listIterator();

0 commit comments

Comments
 (0)