Skip to content

Commit 62c7631

Browse files
authored
Fix some compile warnings (#2919)
* Fix some compile warnings * Some classes made final * JPA entities made not serializable Signed-off-by: Avgustin Marinov <[email protected]>
1 parent 17eacc7 commit 62c7631

89 files changed

Lines changed: 362 additions & 358 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/exception/FileSizeQuotaExceededException.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
*/
1010
package org.eclipse.hawkbit.artifact.exception;
1111

12+
import java.io.Serial;
13+
1214
import lombok.EqualsAndHashCode;
1315
import lombok.ToString;
1416
import org.eclipse.hawkbit.exception.AbstractServerRtException;
@@ -21,6 +23,9 @@
2123
@ToString(callSuper = true)
2224
public class FileSizeQuotaExceededException extends AbstractServerRtException {
2325

26+
@Serial
27+
private static final long serialVersionUID = 1L;
28+
2429
private static final String MAX_ARTIFACT_SIZE_EXCEEDED = "Maximum artifact size (%s) exceeded.";
2530
private static final SpServerError errorType = SpServerError.SP_FILE_SIZE_QUOTA_EXCEEDED;
2631

hawkbit-artifact/hawkbit-artifact-api/src/main/java/org/eclipse/hawkbit/artifact/exception/StorageQuotaExceededException.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
*/
1010
package org.eclipse.hawkbit.artifact.exception;
1111

12+
import java.io.Serial;
13+
1214
import lombok.EqualsAndHashCode;
1315
import lombok.ToString;
1416
import org.eclipse.hawkbit.exception.AbstractServerRtException;
@@ -21,6 +23,9 @@
2123
@ToString(callSuper = true)
2224
public class StorageQuotaExceededException extends AbstractServerRtException {
2325

26+
@Serial
27+
private static final long serialVersionUID = 1L;
28+
2429
private static final String MAX_ARTIFACT_SIZE_TOTAL_EXCEEDED = "Storage quota exceeded, %s left.";
2530
private static final SpServerError errorType = SpServerError.SP_STORAGE_QUOTA_EXCEEDED;
2631

hawkbit-ddi/hawkbit-ddi-security/src/main/java/org/eclipse/hawkbit/security/controller/Authenticator.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
import static org.eclipse.hawkbit.context.AccessContext.asTenant;
1313

14+
import java.io.Serial;
1415
import java.util.Collection;
1516
import java.util.List;
1617
import java.util.Objects;
@@ -61,6 +62,9 @@ protected Authentication authenticatedController(final String tenant, final Stri
6162
@EqualsAndHashCode(callSuper = true)
6263
private static class AuthenticatedController extends AbstractAuthenticationToken {
6364

65+
@Serial
66+
private static final long serialVersionUID = 1L;
67+
6468
private static final Collection<GrantedAuthority> CONTROLLER_AUTHORITY =
6569
List.of(new SimpleGrantedAuthority(SpRole.CONTROLLER_ROLE));
6670
private final String controllerId;

hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/ConfigurableRabbitListenerContainerFactory.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,13 @@
1616
import org.springframework.util.ErrorHandler;
1717

1818
/**
19-
* {@link RabbitListenerContainerFactory} that can be configured through
20-
* hawkBit's {@link AmqpProperties}.
19+
* {@link RabbitListenerContainerFactory} that can be configured through hawkBit's {@link AmqpProperties}.
2120
*/
22-
public class ConfigurableRabbitListenerContainerFactory extends SimpleRabbitListenerContainerFactory {
21+
public final class ConfigurableRabbitListenerContainerFactory extends SimpleRabbitListenerContainerFactory {
2322

2423
private final int declarationRetries;
2524

2625
/**
27-
* Constructor.
28-
*
29-
* @param missingQueuesFatal the missingQueuesFatal to set.
30-
* @param declarationRetries The number of retries
31-
* @param errorHandler the error handler which should be use
3226
* @see SimpleMessageListenerContainer#setMissingQueuesFatal
3327
*/
3428
public ConfigurableRabbitListenerContainerFactory(

hawkbit-dmf/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/RequeueExceptionStrategy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
*/
3333
@ToString
3434
@Slf4j
35-
class RequeueExceptionStrategy implements FatalExceptionStrategy {
35+
final class RequeueExceptionStrategy implements FatalExceptionStrategy {
3636

3737
private final List<FatalExceptionStrategy> fatalExceptionStrategies = new ArrayList<>();
3838

hawkbit-dmf/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/amqp/AmqpMessageHandlerServiceTest.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
import org.eclipse.hawkbit.repository.model.ActionProperties;
4444
import org.eclipse.hawkbit.repository.model.DistributionSet;
4545
import org.eclipse.hawkbit.repository.model.Target;
46-
import org.eclipse.hawkbit.repository.model.TenantConfigurationValue;
4746
import org.junit.jupiter.api.BeforeEach;
4847
import org.junit.jupiter.api.Test;
4948
import org.junit.jupiter.api.extension.ExtendWith;
@@ -427,8 +426,8 @@ void quotaExceeded() {
427426
* Test next update is provided on finished action
428427
*/
429428
@Test
429+
@SuppressWarnings("unchecked")
430430
void lookupNextUpdateActionAfterFinished() {
431-
432431
// Mock
433432
final Action action = createActionWithTarget(22L);
434433
when(controllerManagementMock.findActionWithDetails(anyLong())).thenReturn(Optional.of(action));
@@ -460,7 +459,7 @@ void lookupNextUpdateActionAfterFinished() {
460459
* Test feedback code is persisted in messages when provided with DmfActionUpdateStatus
461460
*/
462461
@Test
463-
void feedBackCodeIsPersistedInMessages() throws IllegalAccessException {
462+
void feedBackCodeIsPersistedInMessages() {
464463
// Mock
465464
final Action action = createActionWithTarget(22L);
466465
when(controllerManagementMock.findActionWithDetails(anyLong())).thenReturn(Optional.of(action));
@@ -471,9 +470,7 @@ void feedBackCodeIsPersistedInMessages() throws IllegalAccessException {
471470
final MessageProperties messageProperties = createMessageProperties(MessageType.EVENT);
472471
messageProperties.setHeader(MessageHeaderKey.TOPIC, EventTopic.UPDATE_ACTION_STATUS.name());
473472

474-
final DmfActionUpdateStatus actionUpdateStatus = new DmfActionUpdateStatus(
475-
23L, DmfActionStatus.RUNNING, null, 2L, null, 12);
476-
473+
final DmfActionUpdateStatus actionUpdateStatus = new DmfActionUpdateStatus(23L, DmfActionStatus.RUNNING, null, 2L, null, 12);
477474
final Message message = createMessage(actionUpdateStatus, messageProperties);
478475

479476
// test

0 commit comments

Comments
 (0)