Fix some compile warnings (#2919)

* Fix some compile warnings
* Some classes made final
* JPA entities made not serializable

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2026-02-11 14:05:46 +02:00
committed by GitHub
parent 17eacc729b
commit 62c76311e5
89 changed files with 362 additions and 358 deletions

View File

@@ -506,6 +506,7 @@ public interface RolloutManagement extends PermissionSupport {
* The name suffix, by default "" is used.
*/
@NotNull
@Builder.Default
private String nameSuffix = "";
/**

View File

@@ -63,7 +63,6 @@ public interface SoftwareModuleTypeManagement<T extends SoftwareModuleType>
@Builder.Default
private int maxAssignments = 1;
@Builder.Default
private int minArtifacts;
}

View File

@@ -36,7 +36,7 @@ public abstract class AbstractAssignmentEvent extends RemoteTenantAwareEvent {
@Serial
private static final long serialVersionUID = 1L;
private final Map<String, ActionProperties> actions = new HashMap<>();
private final HashMap<String, ActionProperties> actions = new HashMap<>();
protected AbstractAssignmentEvent(final Action a) {
super(a.getTenant(), null);
@@ -45,8 +45,7 @@ public abstract class AbstractAssignmentEvent extends RemoteTenantAwareEvent {
protected AbstractAssignmentEvent(final String tenant, final Object source, final List<Action> a) {
super(tenant, source);
actions.putAll(a.stream()
.collect(Collectors.toMap(action -> action.getTarget().getControllerId(), ActionProperties::new)));
actions.putAll(a.stream().collect(Collectors.toMap(action -> action.getTarget().getControllerId(), ActionProperties::new)));
}
public Optional<ActionProperties> getActionPropertiesForController(final String controllerId) {

View File

@@ -9,6 +9,7 @@
*/
package org.eclipse.hawkbit.repository.event.remote;
import java.io.Serial;
import java.util.UUID;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@@ -23,6 +24,9 @@ import org.springframework.context.ApplicationEvent;
@JsonIgnoreProperties(ignoreUnknown = true)
public abstract class AbstractRemoteEvent extends ApplicationEvent {
@Serial
private static final long serialVersionUID = 1L;
private final String id;
// for serialization libs like jackson

View File

@@ -10,6 +10,7 @@
package org.eclipse.hawkbit.repository.event.remote;
import java.io.Serial;
import java.util.ArrayList;
import java.util.Collection;
import lombok.Data;
@@ -31,12 +32,12 @@ public class RolloutStoppedEvent extends RemoteTenantAwareEvent {
@Serial
private static final long serialVersionUID = 1L;
private Collection<Long> rolloutGroupIds;
private ArrayList<Long> rolloutGroupIds;
private long rolloutId;
public RolloutStoppedEvent(final String tenant, final long rolloutId, final Collection<Long> rolloutGroupIds) {
super(tenant, rolloutId);
this.rolloutId = rolloutId;
this.rolloutGroupIds = rolloutGroupIds;
this.rolloutGroupIds = new ArrayList<>(rolloutGroupIds);
}
}

View File

@@ -9,6 +9,8 @@
*/
package org.eclipse.hawkbit.repository.event.remote.service;
import java.io.Serial;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import org.eclipse.hawkbit.repository.event.remote.AbstractRemoteEvent;
@@ -17,6 +19,9 @@ import org.eclipse.hawkbit.repository.event.remote.AbstractRemoteEvent;
@EqualsAndHashCode(callSuper = true)
public abstract class AbstractServiceRemoteEvent<T extends AbstractRemoteEvent> extends AbstractRemoteEvent {
@Serial
private static final long serialVersionUID = 1L;
private final T remoteEvent;
protected AbstractServiceRemoteEvent(T remoteEvent) {

View File

@@ -9,6 +9,8 @@
*/
package org.eclipse.hawkbit.repository.exception;
import java.io.Serial;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.eclipse.hawkbit.exception.AbstractServerRtException;
@@ -22,6 +24,9 @@ import org.eclipse.hawkbit.repository.model.BaseEntity;
@ToString(callSuper = true)
public class AssignmentQuotaExceededException extends AbstractServerRtException {
@Serial
private static final long serialVersionUID = 1L;
private static final String ASSIGNMENT_QUOTA_EXCEEDED_MESSAGE = "Quota exceeded: Cannot assign %s more %s entities to %s '%s'. The maximum is %s.";
private static final SpServerError errorType = SpServerError.SP_QUOTA_EXCEEDED;

View File

@@ -11,7 +11,6 @@ package org.eclipse.hawkbit.repository.exception;
import java.io.Serial;
import java.util.Collection;
import java.util.Collections;
import lombok.EqualsAndHashCode;
import lombok.Getter;
@@ -33,22 +32,15 @@ public class IncompatibleTargetTypeException extends AbstractServerRtException {
@Serial
private static final long serialVersionUID = 1L;
private final Collection<String> targetTypeNames;
private final Collection<String> distributionSetTypeNames;
public IncompatibleTargetTypeException(final String targetTypeName, final Collection<String> distributionSetTypeNames) {
super(SpServerError.SP_TARGET_TYPE_INCOMPATIBLE,
String.format("Target of type %s is not compatible with distribution set of types %s", targetTypeName, distributionSetTypeNames)
);
this.targetTypeNames = Collections.singleton(targetTypeName);
this.distributionSetTypeNames = distributionSetTypeNames;
String.format("Target of type %s is not compatible with distribution set of types %s",
targetTypeName, distributionSetTypeNames));
}
public IncompatibleTargetTypeException(final Collection<String> targetTypeNames, final String distributionSetTypeName) {
super(SpServerError.SP_TARGET_TYPE_INCOMPATIBLE,
String.format("Targets of types %s are not compatible with distribution set of type %s", targetTypeNames,
distributionSetTypeName));
this.targetTypeNames = targetTypeNames;
this.distributionSetTypeNames = Collections.singleton(distributionSetTypeName);
String.format("Targets of types %s are not compatible with distribution set of type %s",
targetTypeNames, distributionSetTypeName));
}
}

View File

@@ -9,7 +9,6 @@
*/
package org.eclipse.hawkbit.repository.model;
import java.io.Serializable;
import java.util.concurrent.TimeUnit;
import org.eclipse.hawkbit.repository.Identifiable;
@@ -17,7 +16,7 @@ import org.eclipse.hawkbit.repository.Identifiable;
/**
* Core information of all entities.
*/
public interface BaseEntity extends Serializable, Identifiable<Long> {
public interface BaseEntity extends Identifiable<Long> {
static Long getIdOrNull(final BaseEntity entity) {
return entity == null ? null : entity.getId();