From 994638b7482a5be944d220736c5e9960bd1b054d Mon Sep 17 00:00:00 2001 From: jamal-khey Date: Fri, 29 Sep 2023 13:13:13 +0200 Subject: [PATCH] fix sonar style issus Signed-off-by: jamal-khey --- .../modification/server/NetworkModificationController.java | 6 ++---- .../server/service/NetworkModificationService.java | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/gridsuite/modification/server/NetworkModificationController.java b/src/main/java/org/gridsuite/modification/server/NetworkModificationController.java index 5211456c8..ae1004484 100644 --- a/src/main/java/org/gridsuite/modification/server/NetworkModificationController.java +++ b/src/main/java/org/gridsuite/modification/server/NetworkModificationController.java @@ -54,10 +54,9 @@ public ResponseEntity> getNetworkModifications(@Paramete @Parameter(description = "Only metadata") @RequestParam(name = "onlyMetadata", required = false, defaultValue = "false") Boolean onlyMetadata, @Parameter(description = "Stashed modifications") @RequestParam(name = "stashed", required = false) Boolean stashed, @Parameter(description = "Return 404 if group is not found or an empty list") @RequestParam(name = "errorOnGroupNotFound", required = false, defaultValue = "true") Boolean errorOnGroupNotFound) { - if(stashed == null) { + if (stashed == null) { return ResponseEntity.ok().body(networkModificationService.getAllNetworkModificationsWithMetaData(groupUuid, errorOnGroupNotFound)); - } - else { + } else { return ResponseEntity.ok().body(networkModificationService.getNetworkModifications(groupUuid, onlyMetadata, errorOnGroupNotFound, stashed)); } } @@ -215,7 +214,6 @@ public ResponseEntity createModificationInGroup(@RequestBody ModificationI return ResponseEntity.ok().body(networkModificationService.createModificationInGroup(modificationsInfos)); } - @PutMapping(value = "/groups/{groupUuid}/duplications", produces = MediaType.APPLICATION_JSON_VALUE) @Operation(summary = "Duplicate all modifications in a group and append them at the end of another modifications group") @ApiResponse(responseCode = "200", description = "The modifications have been duplicated") diff --git a/src/main/java/org/gridsuite/modification/server/service/NetworkModificationService.java b/src/main/java/org/gridsuite/modification/server/service/NetworkModificationService.java index 49a4d9074..71b202cea 100644 --- a/src/main/java/org/gridsuite/modification/server/service/NetworkModificationService.java +++ b/src/main/java/org/gridsuite/modification/server/service/NetworkModificationService.java @@ -80,7 +80,7 @@ public List getAllNetworkModificationsWithMetaData(UUID group //put metadata in a hashmap Map metaDataMap = metaData.stream().collect(Collectors.toMap(ModificationInfos::getUuid, m -> m)); - modificationInfosMap.forEach((uuid,modificationInfos) -> { + modificationInfosMap.forEach((uuid, modificationInfos) -> { ModificationInfos metadata = metaDataMap.get(uuid); if (modificationInfos != null) { modificationInfos.setStashed(metadata.getStashed());