This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
Commit 268f1fcc authored by Philipp Gritsch's avatar Philipp Gritsch
Browse files

Merge branch 'edu-sharing-sonar' into 'development'

address sonar bugs

See merge request !272
parents 289c0ee4 687df257
2 merge requests!274Development,!272address sonar bugs
...@@ -60,7 +60,7 @@ import org.springframework.web.util.UriComponentsBuilder; ...@@ -60,7 +60,7 @@ import org.springframework.web.util.UriComponentsBuilder;
@Service @Service
@Validated @Validated
@SuppressWarnings({ "PMD.AvoidDuplicateLiterals", "PMD.TooManyMethods" }) @SuppressWarnings({ "PMD.AvoidDuplicateLiterals", "PMD.TooManyMethods", "PMD.CyclomaticComplexity" })
public class EduSharingService { public class EduSharingService {
private static final String DEFAULT_VERSION = "1.4"; private static final String DEFAULT_VERSION = "1.4";
...@@ -365,7 +365,7 @@ public class EduSharingService { ...@@ -365,7 +365,7 @@ public class EduSharingService {
return dto; return dto;
} }
@SuppressWarnings({ "PMD.AvoidCatchingGenericException", "PMD.PreserveStackTrace" }) @SuppressWarnings({ "PMD.AvoidCatchingGenericException", "PMD.PreserveStackTrace", "PMD.ConfusingTernary" })
private void deleteNodeSilently(@NotNull String nodeId) { private void deleteNodeSilently(@NotNull String nodeId) {
try { try {
final var uri = UriComponentsBuilder final var uri = UriComponentsBuilder
...@@ -378,8 +378,8 @@ public class EduSharingService { ...@@ -378,8 +378,8 @@ public class EduSharingService {
ResponseEntity<String> response = answer.toEntity(String.class).block(); ResponseEntity<String> response = answer.toEntity(String.class).block();
if (response == null || !response.getStatusCode().is2xxSuccessful()) { if (response == null || !response.getStatusCode().is2xxSuccessful()) {
LOGGER.error("DELETE request to " + uri + " failed!"); String responseText = response != null ? response.getBody() : "Null response";
LOGGER.error(response.getBody()); LOGGER.error("DELETE request to " + uri + " failed! Response: " + responseText);
} }
} catch (final Exception e) { } catch (final Exception e) {
LOGGER.error("Error on deleteNode for resource " + nodeId, e); LOGGER.error("Error on deleteNode for resource " + nodeId, e);
...@@ -566,6 +566,7 @@ public class EduSharingService { ...@@ -566,6 +566,7 @@ public class EduSharingService {
.block(); .block();
} }
@SuppressWarnings("PMD.ConfusingTernary")
private void addOrUpdatePermissionsToCuratorGroup(@NotNull final String nodeId) throws JsonProcessingException { private void addOrUpdatePermissionsToCuratorGroup(@NotNull final String nodeId) throws JsonProcessingException {
final GetPermissionAnswerDTO currentPermissions = getCurrentPermissionsForNode(nodeId); final GetPermissionAnswerDTO currentPermissions = getCurrentPermissionsForNode(nodeId);
LocalPermissionDTO localPermissions = currentPermissions.getLocalPermissions(); LocalPermissionDTO localPermissions = currentPermissions.getLocalPermissions();
...@@ -590,8 +591,8 @@ public class EduSharingService { ...@@ -590,8 +591,8 @@ public class EduSharingService {
ResponseEntity<String> response = answer.toEntity(String.class).block(); ResponseEntity<String> response = answer.toEntity(String.class).block();
if (response == null || !response.getStatusCode().is2xxSuccessful()) { if (response == null || !response.getStatusCode().is2xxSuccessful()) {
LOGGER.error("POST request to " + uri + " failed!"); String responseText = response != null ? response.getBody() : "Null response";
LOGGER.error(response.getBody()); LOGGER.error("POST request to " + uri + " failed! Response: " + responseText);
} }
} }
......
...@@ -362,7 +362,7 @@ ...@@ -362,7 +362,7 @@
</h6> </h6>
<span *ngIf="eduSharingStatus?.publishedCopies?.length == 0"> <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> </span>
<table <table
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment