Fix sonar findings: optional rest params boolean -> Boolean (#1990)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -136,7 +136,8 @@ public class SecurityContextSwitch {
|
|||||||
|
|
||||||
@Serial
|
@Serial
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
private final WithUser annotation;
|
|
||||||
|
private transient final WithUser annotation;
|
||||||
|
|
||||||
public WithUserSecurityContext(final WithUser annotation) {
|
public WithUserSecurityContext(final WithUser annotation) {
|
||||||
this.annotation = annotation;
|
this.annotation = annotation;
|
||||||
|
|||||||
@@ -495,12 +495,12 @@ public interface MgmtDistributionSetRestApi {
|
|||||||
ResponseEntity<MgmtTargetAssignmentResponseBody> createAssignedTarget(
|
ResponseEntity<MgmtTargetAssignmentResponseBody> createAssignedTarget(
|
||||||
@PathVariable("distributionSetId") Long distributionSetId,
|
@PathVariable("distributionSetId") Long distributionSetId,
|
||||||
final List<MgmtTargetAssignmentRequestBody> targetIds,
|
final List<MgmtTargetAssignmentRequestBody> targetIds,
|
||||||
@RequestParam(value = "offline", required = false) boolean offline);
|
@RequestParam(value = "offline", required = false) Boolean offline);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a paged list of meta data for a distribution set.
|
* Gets a paged list of meta-data for a distribution set.
|
||||||
*
|
*
|
||||||
* @param distributionSetId the ID of the distribution set for the meta data
|
* @param distributionSetId the ID of the distribution set for the meta-data
|
||||||
* @param pagingOffsetParam the offset of list of targets for pagination, might not be
|
* @param pagingOffsetParam the offset of list of targets for pagination, might not be
|
||||||
* present in the rest request then default value will be applied
|
* present in the rest request then default value will be applied
|
||||||
* @param pagingLimitParam the limit of the paged request, might not be present in the
|
* @param pagingLimitParam the limit of the paged request, might not be present in the
|
||||||
|
|||||||
@@ -646,7 +646,7 @@ public interface MgmtTargetRestApi {
|
|||||||
defaults set in factory, manual updates or migrations from other update systems. A completed action
|
defaults set in factory, manual updates or migrations from other update systems. A completed action
|
||||||
is added to the history of the target(s). Target is set to IN_SYNC state as both assigned and
|
is added to the history of the target(s). Target is set to IN_SYNC state as both assigned and
|
||||||
installed DS are set. Note: only executed if the target has currently no running update""")
|
installed DS are set. Note: only executed if the target has currently no running update""")
|
||||||
boolean offline);
|
Boolean offline);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles the GET request of retrieving the installed distribution set of
|
* Handles the GET request of retrieving the installed distribution set of
|
||||||
|
|||||||
@@ -289,10 +289,10 @@ public class MgmtDistributionSetResource implements MgmtDistributionSetRestApi {
|
|||||||
public ResponseEntity<MgmtTargetAssignmentResponseBody> createAssignedTarget(
|
public ResponseEntity<MgmtTargetAssignmentResponseBody> createAssignedTarget(
|
||||||
@PathVariable("distributionSetId") final Long distributionSetId,
|
@PathVariable("distributionSetId") final Long distributionSetId,
|
||||||
@RequestBody final List<MgmtTargetAssignmentRequestBody> assignments,
|
@RequestBody final List<MgmtTargetAssignmentRequestBody> assignments,
|
||||||
@RequestParam(value = "offline", required = false) final boolean offline) {
|
@RequestParam(value = "offline", required = false) final Boolean offline) {
|
||||||
if (offline) {
|
if (offline != null && offline) {
|
||||||
final List<Entry<String, Long>> offlineAssignments = assignments.stream()
|
final List<Entry<String, Long>> offlineAssignments = assignments.stream()
|
||||||
.map(assignment -> new SimpleEntry<String, Long>(assignment.getId(), distributionSetId))
|
.map(assignment -> new SimpleEntry<>(assignment.getId(), distributionSetId))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
return ResponseEntity.ok(MgmtDistributionSetMapper
|
return ResponseEntity.ok(MgmtDistributionSetMapper
|
||||||
.toResponse(deployManagament.offlineAssignedDistributionSets(offlineAssignments)));
|
.toResponse(deployManagament.offlineAssignedDistributionSets(offlineAssignments)));
|
||||||
|
|||||||
@@ -351,8 +351,8 @@ public class MgmtTargetResource implements MgmtTargetRestApi {
|
|||||||
public ResponseEntity<MgmtTargetAssignmentResponseBody> postAssignedDistributionSet(
|
public ResponseEntity<MgmtTargetAssignmentResponseBody> postAssignedDistributionSet(
|
||||||
@PathVariable("targetId") final String targetId,
|
@PathVariable("targetId") final String targetId,
|
||||||
@RequestBody final MgmtDistributionSetAssignments dsAssignments,
|
@RequestBody final MgmtDistributionSetAssignments dsAssignments,
|
||||||
@RequestParam(value = "offline", required = false) final boolean offline) {
|
@RequestParam(value = "offline", required = false) final Boolean offline) {
|
||||||
if (offline) {
|
if (offline != null && offline) {
|
||||||
final List<Entry<String, Long>> offlineAssignments = dsAssignments.stream()
|
final List<Entry<String, Long>> offlineAssignments = dsAssignments.stream()
|
||||||
.map(dsAssignment -> new SimpleEntry<String, Long>(targetId, dsAssignment.getId()))
|
.map(dsAssignment -> new SimpleEntry<String, Long>(targetId, dsAssignment.getId()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|||||||
Reference in New Issue
Block a user