diff --git a/src/main/java/at/ac/uibk/gitsearch/service/edu_sharing/EduSharingService.java b/src/main/java/at/ac/uibk/gitsearch/service/edu_sharing/EduSharingService.java index 1d87db763b6e705fce7a99c43c5c98276b461777..143c5cb0841ee5765f9526a54afef5ed096e010f 100644 --- a/src/main/java/at/ac/uibk/gitsearch/service/edu_sharing/EduSharingService.java +++ b/src/main/java/at/ac/uibk/gitsearch/service/edu_sharing/EduSharingService.java @@ -60,7 +60,7 @@ import org.springframework.web.util.UriComponentsBuilder; @Service @Validated -@SuppressWarnings({ "PMD.AvoidDuplicateLiterals", "PMD.TooManyMethods" }) +@SuppressWarnings({ "PMD.AvoidDuplicateLiterals", "PMD.TooManyMethods", "PMD.CyclomaticComplexity" }) public class EduSharingService { private static final String DEFAULT_VERSION = "1.4"; @@ -365,7 +365,7 @@ public class EduSharingService { return dto; } - @SuppressWarnings({ "PMD.AvoidCatchingGenericException", "PMD.PreserveStackTrace" }) + @SuppressWarnings({ "PMD.AvoidCatchingGenericException", "PMD.PreserveStackTrace", "PMD.ConfusingTernary" }) private void deleteNodeSilently(@NotNull String nodeId) { try { final var uri = UriComponentsBuilder @@ -378,8 +378,8 @@ public class EduSharingService { ResponseEntity<String> response = answer.toEntity(String.class).block(); if (response == null || !response.getStatusCode().is2xxSuccessful()) { - LOGGER.error("DELETE request to " + uri + " failed!"); - LOGGER.error(response.getBody()); + String responseText = response != null ? response.getBody() : "Null response"; + LOGGER.error("DELETE request to " + uri + " failed! Response: " + responseText); } } catch (final Exception e) { LOGGER.error("Error on deleteNode for resource " + nodeId, e); @@ -566,6 +566,7 @@ public class EduSharingService { .block(); } + @SuppressWarnings("PMD.ConfusingTernary") private void addOrUpdatePermissionsToCuratorGroup(@NotNull final String nodeId) throws JsonProcessingException { final GetPermissionAnswerDTO currentPermissions = getCurrentPermissionsForNode(nodeId); LocalPermissionDTO localPermissions = currentPermissions.getLocalPermissions(); @@ -590,8 +591,8 @@ public class EduSharingService { ResponseEntity<String> response = answer.toEntity(String.class).block(); if (response == null || !response.getStatusCode().is2xxSuccessful()) { - LOGGER.error("POST request to " + uri + " failed!"); - LOGGER.error(response.getBody()); + String responseText = response != null ? response.getBody() : "Null response"; + LOGGER.error("POST request to " + uri + " failed! Response: " + responseText); } } diff --git a/src/main/webapp/app/exercise/exercise-details/exerciseComponents/exercise-body.component.html b/src/main/webapp/app/exercise/exercise-details/exerciseComponents/exercise-body.component.html index cf0357cb8eb69c16a410e82835eeef4e33c1c22f..4cf9b275fd66d3f0fe7c4893b2186ac595ce00f0 100644 --- a/src/main/webapp/app/exercise/exercise-details/exerciseComponents/exercise-body.component.html +++ b/src/main/webapp/app/exercise/exercise-details/exerciseComponents/exercise-body.component.html @@ -362,7 +362,7 @@ </h6> <span *ngIf="eduSharingStatus?.publishedCopies?.length == 0"> - <i>{{ 'exercise.export.edu-sharing.publishedProjects.noEntries' | translate }}</i> + <em>{{ 'exercise.export.edu-sharing.publishedProjects.noEntries' | translate }}</em> </span> <table