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

@@ -124,6 +124,7 @@ public abstract class AbstractJpaIntegrationTest extends AbstractIntegrationTest
protected static <T> T[] toArray(final Iterable<? extends T> it, final Class<T> type) {
final List<T> list = toList(it);
@SuppressWarnings("unchecked")
final T[] array = (T[]) Array.newInstance(type, list.size());
for (int i = 0; i < array.length; i++) {
array[i] = list.get(i);

View File

@@ -46,6 +46,7 @@ class TargetTypeManagementTest extends AbstractAccessControllerManagementTest {
}
@Test
@SuppressWarnings({"unchecked", "rawtypes"})
void verifyRead() {
// permissions to read only type1 target types
runAs(withAuthorities(READ_TARGET_TYPE + "/id==" + targetType1.getId()), () -> {

View File

@@ -150,12 +150,11 @@ class RepositoryEntityEventTest extends AbstractJpaIntegrationTest {
final String successCondition = "50";
final String errorCondition = "80";
final String rolloutName = "rolloutTest";
final String targetPrefixName = rolloutName;
final DistributionSet distributionSet = testdataFactory.createDistributionSet("dsFor" + rolloutName);
testdataFactory.createTargets(amountTargetsForRollout, targetPrefixName + "-", targetPrefixName);
testdataFactory.createTargets(amountTargetsForRollout, rolloutName + "-", rolloutName);
final Rollout createdRollout = testdataFactory.createRolloutByVariables(rolloutName, "desc", amountGroups,
"controllerId==" + targetPrefixName + "-*", distributionSet, successCondition, errorCondition);
final Rollout createdRollout = testdataFactory.createRolloutByVariables(
rolloutName, "desc", amountGroups,"controllerId==" + rolloutName + "-*", distributionSet, successCondition, errorCondition);
rolloutManagement.delete(createdRollout.getId());
rolloutHandler.handleAll();

View File

@@ -987,12 +987,14 @@ class DeploymentManagementTest extends AbstractJpaIntegrationTest {
final int noOfDeployedTargets = 4;
final int noOfDistributionSets = 3;
final DeploymentResult deploymentResult = prepareComplexRepo(undeployedTargetPrefix, noOfUndeployedTargets,
deployedTargetPrefix, noOfDeployedTargets, noOfDistributionSets, "myTestDS");
final DeploymentResult deploymentResult = prepareComplexRepo(
undeployedTargetPrefix, noOfUndeployedTargets, deployedTargetPrefix, noOfDeployedTargets, noOfDistributionSets, "myTestDS");
final List<Long> deployedTargetIDs = deploymentResult.getDeployedTargetIDs();
final List<Long> undeployedTargetIDs = deploymentResult.getUndeployedTargetIDs();
@SuppressWarnings({"unchecked", "rawtypes"})
final Collection<JpaTarget> savedNakedTargets = (Collection) deploymentResult.getUndeployedTargets();
@SuppressWarnings({"unchecked", "rawtypes"})
final Collection<JpaTarget> savedDeployedTargets = (Collection) deploymentResult.getDeployedTargets();
// retrieving all Actions created by the assignDistributionSet call