From f10d698a09015892f4b83e30ec83a4ebdab148c8 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Mon, 24 Aug 2020 16:44:14 +0200 Subject: [PATCH] Remove dependency on jetbrains annotations --- pgpainless-core/build.gradle | 1 - .../decryption_verification/DecryptionBuilder.java | 13 +++++++------ .../encryption_signing/EncryptionBuilder.java | 9 ++++++--- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/pgpainless-core/build.gradle b/pgpainless-core/build.gradle index 575c02d4..1672a751 100644 --- a/pgpainless-core/build.gradle +++ b/pgpainless-core/build.gradle @@ -3,7 +3,6 @@ plugins { } dependencies { - implementation 'org.jetbrains:annotations:19.0.0' testImplementation group: 'junit', name: 'junit', version: '4.12' /* implementation "org.bouncycastle:bcprov-debug-jdk15on:$bouncyCastleVersion" diff --git a/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/DecryptionBuilder.java b/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/DecryptionBuilder.java index ae19ea07..1501c5da 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/DecryptionBuilder.java +++ b/pgpainless-core/src/main/java/org/pgpainless/decryption_verification/DecryptionBuilder.java @@ -50,7 +50,7 @@ public class DecryptionBuilder implements DecryptionBuilderInterface { private final KeyFingerPrintCalculator keyFingerPrintCalculator = new BcKeyFingerprintCalculator(); @Override - public DecryptWith onInputStream(InputStream inputStream) { + public DecryptWith onInputStream(@Nonnull InputStream inputStream) { this.inputStream = inputStream; return new DecryptWithImpl(); } @@ -75,7 +75,7 @@ public class DecryptionBuilder implements DecryptionBuilderInterface { class VerifyImpl implements Verify { @Override - public VerifyWith verifyDetachedSignature(InputStream inputStream) throws IOException, PGPException { + public VerifyWith verifyDetachedSignature(@Nonnull InputStream inputStream) throws IOException, PGPException { List signatures = new ArrayList<>(); InputStream pgpIn = PGPUtil.getDecoderStream(inputStream); PGPObjectFactory objectFactory = new PGPObjectFactory( @@ -104,23 +104,24 @@ public class DecryptionBuilder implements DecryptionBuilderInterface { } @Override - public VerifyWith verifyDetachedSignatures(List signatures) { + public VerifyWith verifyDetachedSignatures(@Nonnull List signatures) { DecryptionBuilder.this.detachedSignatures = signatures; return new VerifyWithImpl(); } @Override - public HandleMissingPublicKeys verifyWith(@org.jetbrains.annotations.NotNull PGPPublicKeyRingCollection publicKeyRings) { + public HandleMissingPublicKeys verifyWith(@Nonnull PGPPublicKeyRingCollection publicKeyRings) { return new VerifyWithImpl().verifyWith(publicKeyRings); } @Override - public HandleMissingPublicKeys verifyWith(@org.jetbrains.annotations.NotNull Set trustedFingerprints, @org.jetbrains.annotations.NotNull PGPPublicKeyRingCollection publicKeyRings) { + public HandleMissingPublicKeys verifyWith(@Nonnull Set trustedFingerprints, + @Nonnull PGPPublicKeyRingCollection publicKeyRings) { return new VerifyWithImpl().verifyWith(trustedFingerprints, publicKeyRings); } @Override - public HandleMissingPublicKeys verifyWith(@org.jetbrains.annotations.NotNull Set publicKeyRings) { + public HandleMissingPublicKeys verifyWith(@Nonnull Set publicKeyRings) { return new VerifyWithImpl().verifyWith(publicKeyRings); } diff --git a/pgpainless-core/src/main/java/org/pgpainless/encryption_signing/EncryptionBuilder.java b/pgpainless-core/src/main/java/org/pgpainless/encryption_signing/EncryptionBuilder.java index 12c1a8b2..2d235f5e 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/encryption_signing/EncryptionBuilder.java +++ b/pgpainless-core/src/main/java/org/pgpainless/encryption_signing/EncryptionBuilder.java @@ -256,17 +256,20 @@ public class EncryptionBuilder implements EncryptionBuilderInterface { } @Override - public Armor signWith(@org.jetbrains.annotations.NotNull SecretKeyRingProtector decryptor, @org.jetbrains.annotations.NotNull PGPSecretKey... keys) { + public Armor signWith(@Nonnull SecretKeyRingProtector decryptor, @Nonnull PGPSecretKey... keys) { return new SignWithImpl().signWith(decryptor, keys); } @Override - public Armor signWith(@org.jetbrains.annotations.NotNull SecretKeyRingProtector decryptor, @org.jetbrains.annotations.NotNull PGPSecretKeyRing... keyRings) { + public Armor signWith(@Nonnull SecretKeyRingProtector decryptor, @Nonnull PGPSecretKeyRing... keyRings) { return new SignWithImpl().signWith(decryptor, keyRings); } @Override - public Armor signWith(@org.jetbrains.annotations.NotNull SecretKeyRingSelectionStrategy selectionStrategy, @org.jetbrains.annotations.NotNull SecretKeyRingProtector decryptor, @org.jetbrains.annotations.NotNull MultiMap keys) throws SecretKeyNotFoundException { + public Armor signWith(@Nonnull SecretKeyRingSelectionStrategy selectionStrategy, + @Nonnull SecretKeyRingProtector decryptor, + @Nonnull MultiMap keys) + throws SecretKeyNotFoundException { return new SignWithImpl().signWith(selectionStrategy, decryptor, keys); } }