1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2025-09-14 12:49:39 +02:00

Annotate EncryptionOptions methods with @Nonnull

This commit is contained in:
Paul Schaub 2023-05-03 14:38:52 +02:00
parent 304350fe5c
commit 64c6d7a904
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
2 changed files with 23 additions and 17 deletions

View file

@ -36,6 +36,8 @@ import org.pgpainless.key.generation.type.xdh.XDHSpec;
import org.pgpainless.key.util.KeyRingUtils;
import org.pgpainless.util.Passphrase;
import javax.annotation.Nonnull;
public class EncryptionOptionsTest {
private static PGPSecretKeyRing secretKeys;
@ -149,7 +151,7 @@ public class EncryptionOptionsTest {
assertThrows(KeyException.UnacceptableEncryptionKeyException.class,
() -> options.addRecipient(publicKeys, new EncryptionOptions.EncryptionKeySelector() {
@Override
public List<PGPPublicKey> selectEncryptionSubkeys(List<PGPPublicKey> encryptionCapableKeys) {
public List<PGPPublicKey> selectEncryptionSubkeys(@Nonnull List<PGPPublicKey> encryptionCapableKeys) {
return Collections.emptyList();
}
}));
@ -157,7 +159,7 @@ public class EncryptionOptionsTest {
assertThrows(KeyException.UnacceptableEncryptionKeyException.class,
() -> options.addRecipient(publicKeys, "test@pgpainless.org", new EncryptionOptions.EncryptionKeySelector() {
@Override
public List<PGPPublicKey> selectEncryptionSubkeys(List<PGPPublicKey> encryptionCapableKeys) {
public List<PGPPublicKey> selectEncryptionSubkeys(@Nonnull List<PGPPublicKey> encryptionCapableKeys) {
return Collections.emptyList();
}
}));