Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Suppress/warnings #1885

Merged
merged 12 commits into from
Aug 22, 2022
Prev Previous commit
Next Next commit
deprecation
  • Loading branch information
hilmarf committed Aug 19, 2022
commit bd8e0cc3fc929006a225e6e5e722ed1e9ff3c450
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package app.coronawarn.server.common.persistence.repository;


import app.coronawarn.server.common.persistence.domain.TraceTimeIntervalWarning;
import org.springframework.data.jdbc.repository.query.Modifying;
import org.springframework.data.jdbc.repository.query.Query;
Expand All @@ -12,7 +11,7 @@
* Event check-in repository.
* @deprecated in favor of encrypted check-ins.
*/
@Deprecated(since = "2.8", forRemoval = true)
@Deprecated(since = "2.8", forRemoval = false)
@Repository
public interface TraceTimeIntervalWarningRepository
extends PagingAndSortingRepository<TraceTimeIntervalWarning, Long> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,17 @@
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

@SuppressWarnings("deprecation")
@Component
public class TraceTimeIntervalWarningService {

private static final Logger logger =
LoggerFactory.getLogger(TraceTimeIntervalWarningService.class);

@Deprecated(since = "2.8", forRemoval = true)
@Deprecated(since = "2.8", forRemoval = false)
private final TraceTimeIntervalWarningRepository traceTimeIntervalWarningRepo;
private final CheckInProtectedReportsRepository checkInProtectedReportsRepository;
@Deprecated(since = "2.8", forRemoval = true)
@Deprecated(since = "2.8", forRemoval = false)
private final MessageDigest hashAlgorithm;

/**
Expand All @@ -61,13 +62,13 @@ public TraceTimeIntervalWarningService(
*
* @deprecated in favor of encrypted checkins.
*/
@Deprecated(since = "2.8", forRemoval = true)
@Deprecated(since = "2.8", forRemoval = false)
@Transactional
public int saveCheckins(List<CheckIn> checkins, int submissionTimestamp, SubmissionType submissionType) {
return saveCheckins(checkins, this::hashLocationId, submissionTimestamp, submissionType);
}

@Deprecated(since = "2.8", forRemoval = true)
@Deprecated(since = "2.8", forRemoval = false)
private int saveCheckins(List<CheckIn> checkins, Function<ByteString, byte[]> idHashGenerator,
int submissionTimestamp, SubmissionType submissionType) {
int numberOfInsertedTraceWarnings = 0;
Expand Down Expand Up @@ -129,7 +130,7 @@ public int saveCheckInProtectedReports(List<CheckInProtectedReport> allCheckins,
*
* @deprecated because trace time warnings are not longer supported and replaced by encrypted checkins.
*/
@Deprecated(since = "2.8", forRemoval = true)
@Deprecated(since = "2.8", forRemoval = false)
public Collection<TraceTimeIntervalWarning> getTraceTimeIntervalWarnings() {
return StreamUtils
.createStreamFromIterator(traceTimeIntervalWarningRepo
Expand All @@ -147,7 +148,7 @@ public Collection<CheckInProtectedReports> getCheckInProtectedReports() {
.collect(Collectors.toList());
}

@Deprecated(since = "2.8", forRemoval = true)
@Deprecated(since = "2.8", forRemoval = false)
private byte[] hashLocationId(ByteString locationId) {
return hashAlgorithm.digest(locationId.toByteArray());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


package app.coronawarn.server.services.distribution.assembly.component;

import app.coronawarn.server.services.distribution.assembly.structure.WritableOnDisk;
Expand Down Expand Up @@ -62,6 +60,7 @@ public class CwaApiStructureProvider {
*
* @return new instance of IndexingDecoratorOnDisk base directory
*/
@SuppressWarnings("deprecation")
public Directory<WritableOnDisk> getDirectory() {
IndexDirectoryOnDisk<String> versionDirectory = new IndexDirectoryOnDisk<>(
distributionServiceConfig.getApi().getVersionPath(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public abstract class TraceTimeIntervalWarningsPackageBundler {
* @see CheckinsDateSpecification#HOUR_SINCE_EPOCH_DERIVATION
* @deprecated in favor of {@link #distributableCheckInProtectedReports}.
*/
@Deprecated(since = "2.8", forRemoval = true)
@Deprecated(since = "2.8", forRemoval = false)
protected final Map<Integer, List<TraceTimeIntervalWarning>> distributableTraceTimeIntervalWarnings =
new HashMap<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@SuppressWarnings("deprecation")
public class TraceTimeIntervalWarningsCountryDirectory extends IndexDirectoryOnDisk<String> {

private static final String VERSION_V2 = "v2";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.ResourceLoader;
import org.springframework.stereotype.Component;


@Component
public class DigitalGreenCertificateToProtobufMapping {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package app.coronawarn.server.services.distribution.statistics.directory;

import app.coronawarn.server.common.protocols.internal.stats.LocalStatistics;
import app.coronawarn.server.common.protocols.internal.stats.Statistics;
import app.coronawarn.server.services.distribution.assembly.component.CryptoProvider;
import app.coronawarn.server.services.distribution.assembly.structure.Writable;
import app.coronawarn.server.services.distribution.assembly.structure.WritableOnDisk;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package app.coronawarn.server.services.download;

public class BatchAuditException extends RuntimeException {

private static final long serialVersionUID = 421314018302400787L;

public BatchAuditException(String msg, Throwable cause) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ private CheckinsStorageResult saveCheckInProtectedReports(List<CheckInProtectedR
* @param submissionPayload the payload where to extract the checkins from.
* @return an instance of {@link CheckinsStorageResult} that represents how many check ins were saved and filtered.
*/
@SuppressWarnings("removal")
@SuppressWarnings("deprecation")
public CheckinsStorageResult extractAndStoreCheckins(SubmissionPayload submissionPayload) {
CheckinsStorageResult checkinsStorageResult = new CheckinsStorageResult(0, 0);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public class SubmissionServiceConfig {
*
* @deprecated should be removed when false
*/
@Deprecated(since = "2.8", forRemoval = true)
@Deprecated(since = "2.8", forRemoval = false)
private Boolean unencryptedCheckinsEnabled;

@Autowired
Expand Down Expand Up @@ -217,7 +217,7 @@ public void setTrlDerivations(TrlDerivations trlDerivations) {
*
* @deprecated should be removed when false
*/
@Deprecated(since = "2.8", forRemoval = true)
@Deprecated(since = "2.8", forRemoval = false)
public Boolean isUnencryptedCheckinsEnabled() {
return unencryptedCheckinsEnabled == null ? false : unencryptedCheckinsEnabled;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,11 @@ class ValidSubmissionOnBehalfPayloadValidator implements
*
* @deprecated in favor of {@link #eventCheckInProtectedReportsValidator}.
*/
@Deprecated(since = "2.8", forRemoval = true)
private final EventCheckinDataValidator eventCheckInValidator;
private final EventCheckInProtectedReportsValidator eventCheckInProtectedReportsValidator;
private static final Logger logger = LoggerFactory.getLogger(ValidSubmissionOnBehalfPayload.class);
private static final Marker SECURITY = MarkerFactory.getMarker("SECURITY");

@SuppressWarnings("deprecation")
public ValidSubmissionOnBehalfPayloadValidator(EventCheckinDataValidator eventCheckinValidator,
EventCheckInProtectedReportsValidator eventCheckInProtectedReportsValidator) {
this.eventCheckInValidator = eventCheckinValidator;
Expand All @@ -83,7 +81,6 @@ public ValidSubmissionOnBehalfPayloadValidator(EventCheckinDataValidator eventCh
* @param context constraint validator context for enabling violation messages.
* @return whether the payload is valid or not.
*/
@SuppressWarnings("deprecation")
@Override
public boolean isValid(SubmissionPayload submissionPayload, ConstraintValidatorContext context) {
return Stream.of(diagnosisKeysAreEmpty(submissionPayload, context),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class SubmissionPayloadValidator implements ConstraintValidator<ValidSubmissionP
*
* @deprecated in favor of {@link #eventCheckInProtectedReportsValidator}.
*/
@Deprecated(since = "2.8", forRemoval = true)
@Deprecated(since = "2.8", forRemoval = false)
private final EventCheckinDataValidator eventCheckinValidator;
private final EventCheckInProtectedReportsValidator eventCheckInProtectedReportsValidator;
private static final Logger logger = LoggerFactory.getLogger(SubmissionPayloadValidator.class);
Expand Down