Deprecate methods for handling non-canonical BDF.

This commit is contained in:
akwizgran
2023-02-20 14:51:21 +00:00
parent 8cd6546840
commit b1cc63cd49
4 changed files with 30 additions and 0 deletions

View File

@@ -31,6 +31,12 @@ public abstract class BdfMessageValidator implements MessageValidator {
protected final Clock clock;
protected final boolean canonical;
/**
* Transitional alternative to
* {@link #BdfMessageValidator(ClientHelper, MetadataEncoder, Clock)} that
* accepts messages in non-canonical form, for backward compatibility.
*/
@Deprecated
protected BdfMessageValidator(ClientHelper clientHelper,
MetadataEncoder metadataEncoder, Clock clock, boolean canonical) {
this.clientHelper = clientHelper;

View File

@@ -49,6 +49,15 @@ public interface ClientHelper {
BdfList getMessageAsList(Transaction txn, MessageId m) throws DbException,
FormatException;
/**
* Transitional alternative to
* {@link #getMessageAsList(Transaction, MessageId)} that allows the
* message to be in non-canonical form, for backward compatibility.
*
* @param canonical True if the message must be in canonical form (a
* {@link FormatException} will be thrown if it's not.
*/
@Deprecated
BdfList getMessageAsList(Transaction txn, MessageId m, boolean canonical)
throws DbException, FormatException;
@@ -109,6 +118,14 @@ public interface ClientHelper {
BdfList toList(Message m) throws FormatException;
/**
* Transitional alternative to {@link #toList(Message)} that allows the
* message to be in non-canonical form, for backward compatibility.
*
* @param canonical True if the message must be in canonical form (a
* {@link FormatException} will be thrown if it's not.
*/
@Deprecated
BdfList toList(Message m, boolean canonical) throws FormatException;
BdfList toList(Author a);

View File

@@ -9,6 +9,12 @@ public interface BdfReaderFactory {
BdfReader createReader(InputStream in);
/**
* Transitional alternative to {@link #createReader(InputStream)} that
* can create a reader that accepts non-canonical input, for backward
* compatibility.
*/
@Deprecated
BdfReader createReader(InputStream in, boolean canonical);
BdfReader createReader(InputStream in, int nestedLimit,

View File

@@ -311,6 +311,7 @@ class TransportPropertyManagerImpl implements TransportPropertyManager,
if (latest == null) {
merged = new TransportProperties(p);
Iterator<String> it = merged.values().iterator();
//noinspection Java8CollectionRemoveIf
while (it.hasNext()) {
if (isNullOrEmpty(it.next())) it.remove();
}