From 7012c00c5fca738a99d45adc2ea4713196778203 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Fri, 22 Mar 2019 13:52:06 +0400 Subject: [PATCH] #13 fix condition --- src/main/java/ru/ulstu/file/service/FileService.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/ru/ulstu/file/service/FileService.java b/src/main/java/ru/ulstu/file/service/FileService.java index ceb4503..810f853 100644 --- a/src/main/java/ru/ulstu/file/service/FileService.java +++ b/src/main/java/ru/ulstu/file/service/FileService.java @@ -87,8 +87,7 @@ public class FileService { public List saveOrCreate(List fileDtos) throws IOException { List files = new ArrayList<>(); for (FileDataDto file : fileDtos) { - if (file.getId() != null) files.add(update(file)); - else files.add(create(file)); + files.add(file.getId() != null ? update(file) : create(file)); } return files; }