Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reduce number of Error Prone warnings and some other IDE warnings #2026

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*
* @deprecated Check for 'ASN1BitStringParser' instead
*/
@Deprecated
public class BERBitStringParser
implements ASN1BitStringParser
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*
* @deprecated Check for 'ASN1OctetStringParser' instead
*/
@Deprecated
public class BEROctetStringParser
implements ASN1OctetStringParser
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*
* @deprecated Check for 'ASN1SequenceParser' instead
*/
@Deprecated
public class BERSequenceParser
implements ASN1SequenceParser
{
Expand Down
1 change: 1 addition & 0 deletions core/src/main/java/org/bouncycastle/asn1/BERSetParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*
* @deprecated Check for 'ASN1SetParser' instead
*/
@Deprecated
public class BERSetParser
implements ASN1SetParser
{
Expand Down
1 change: 1 addition & 0 deletions core/src/main/java/org/bouncycastle/asn1/DERExternal.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public class DERExternal
*
* @deprecated Use {@link DERExternal#DERExternal(DERSequence)} instead.
*/
@Deprecated
public DERExternal(ASN1EncodableVector vector)
{
this(DERFactory.createSequence(vector));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*
* @deprecated Check for 'ASN1OctetStringParser' instead
*/
@Deprecated
public class DEROctetStringParser
implements ASN1OctetStringParser
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*
* @deprecated Check for 'ASN1BitStringParser' instead
*/
@Deprecated
public class DLBitStringParser
implements ASN1BitStringParser
{
Expand Down
1 change: 1 addition & 0 deletions core/src/main/java/org/bouncycastle/asn1/DLExternal.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public class DLExternal
*
* @deprecated Use {@link DLExternal#DLExternal(DLSequence)} instead.
*/
@Deprecated
public DLExternal(ASN1EncodableVector vector)
{
this(DLFactory.createSequence(vector));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*
* @deprecated Check for 'ASN1SequenceParser' instead
*/
@Deprecated
public class DLSequenceParser
implements ASN1SequenceParser
{
Expand Down
1 change: 1 addition & 0 deletions core/src/main/java/org/bouncycastle/asn1/DLSetParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*
* @deprecated Check for 'ASN1SetParser' instead
*/
@Deprecated
public class DLSetParser
implements ASN1SetParser
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ public interface PKCSObjectIdentifiers

/** PKCS#9: 1.2.840.113549.1.9.22.1
* @deprecated use x509Certificate instead */
@Deprecated
ASN1ObjectIdentifier x509certType = pkcs_9.branch("22.1");

/** PKCS#9: 1.2.840.113549.1.9.22 */
Expand Down Expand Up @@ -246,6 +247,7 @@ public interface PKCSObjectIdentifiers
/** S/MIME: Algorithm Identifiers ; 1.2.840.113549.1.9.16.3 */
ASN1ObjectIdentifier smime_alg = id_smime.branch("3");
/** @deprecated use smime_alg instead */
@Deprecated
ASN1ObjectIdentifier id_alg = id_smime.branch("3");

/** PKCS#9: 1.2.840.113549.1.9.16.3.5 */
Expand Down Expand Up @@ -417,12 +419,16 @@ public interface PKCSObjectIdentifiers
ASN1ObjectIdentifier id_aa_communityIdentifiers = id_aa.branch("40");

/** @deprecated use id_aa_ets_sigPolicyId instead */
@Deprecated
ASN1ObjectIdentifier id_aa_sigPolicyId = id_aa_ets_sigPolicyId;
/** @deprecated use id_aa_ets_commitmentType instead */
@Deprecated
ASN1ObjectIdentifier id_aa_commitmentType = id_aa_ets_commitmentType;
/** @deprecated use id_aa_ets_signerLocation instead */
@Deprecated
ASN1ObjectIdentifier id_aa_signerLocation = id_aa_ets_signerLocation;
/** @deprecated use id_aa_ets_otherSigCert instead */
@Deprecated
ASN1ObjectIdentifier id_aa_otherSigCert = id_aa_ets_otherSigCert;

/**
Expand All @@ -431,6 +437,7 @@ public interface PKCSObjectIdentifiers
* 1.2.840.113549.1.9.16.5
* @deprecated use id_spq_oid instead
*/
@Deprecated
final String id_spq = "1.2.840.113549.1.9.16.5";
ASN1ObjectIdentifier id_spq_oid = id_smime.branch("5");

Expand Down Expand Up @@ -481,6 +488,7 @@ public interface PKCSObjectIdentifiers
* PKCS#12: 1.2.840.113549.1.12.1.6
* @deprecated use pbeWithSHAAnd40BitRC2_CBC
*/
@Deprecated
ASN1ObjectIdentifier pbewithSHAAnd40BitRC2_CBC = pkcs_12PbeIds.branch("6");
}

Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public SubjectPublicKeyInfo(
/**
@deprecated use SubjectPublicKeyInfo.getInstance()
*/
@Deprecated
public SubjectPublicKeyInfo(
ASN1Sequence seq)
{
Expand All @@ -98,6 +99,7 @@ public AlgorithmIdentifier getAlgorithm()
* @deprecated use getAlgorithm()
* @return alg ID.
*/
@Deprecated
public AlgorithmIdentifier getAlgorithmId()
{
return algId;
Expand Down Expand Up @@ -126,6 +128,7 @@ public ASN1Primitive parsePublicKey()
* @deprecated use parsePublicKey
* @return the public key as an ASN.1 primitive.
*/
@Deprecated
public ASN1Primitive getPublicKey()
throws IOException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public AsymmetricCipherKeyPair(
* @param privateParam the corresponding private key parameters.
* @deprecated use AsymmetricKeyParameter
*/
@Deprecated
public AsymmetricCipherKeyPair(
CipherParameters publicParam,
CipherParameters privateParam)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ public static MultiBlockCipher newInstance()
* default constructor - 128 bit block size.
* @deprecated use AESEngine.newInstance()
*/
@Deprecated
public AESEngine()
{
CryptoServicesRegistrar.checkConstraints(new DefaultServiceProperties(getAlgorithmName(), 256));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class RSABlindedEngine
* initialise the RSA engine.
*
* @param forEncryption true if we are encrypting, false otherwise.
* @param param the necessary RSA key parameters.
* @param parameters the necessary RSA key parameters.
*/
public void init(boolean forEncryption, CipherParameters parameters)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public static CTRModeCipher newInstance(BlockCipher cipher)
* @param c the block cipher to be used.
* @deprecated use newInstance() method.
*/
@Deprecated
public SICBlockCipher(BlockCipher c)
{
super(c);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public Digest getDigest()
}

/**
* @return The pairing result g = <P,P> (RFC 6508, Section 3.2)
* @return The pairing result {@code g = <P,P>} (RFC 6508, Section 3.2)
*/
public BigInteger getG()
{
Expand Down
3 changes: 3 additions & 0 deletions core/src/main/java/org/bouncycastle/math/ec/ECCurve.java
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,7 @@ public static class Fp extends AbstractFp
/**
* @deprecated use constructor taking order/cofactor
*/
@Deprecated
public Fp(BigInteger q, BigInteger a, BigInteger b)
{
this(q, a, b, null, null);
Expand Down Expand Up @@ -1153,6 +1154,7 @@ public static class F2m extends AbstractF2m
* <code>F<sub>2<sup>m</sup></sub></code>.
* @deprecated use constructor taking order/cofactor
*/
@Deprecated
public F2m(
int m,
int k,
Expand Down Expand Up @@ -1211,6 +1213,7 @@ public F2m(
* <code>F<sub>2<sup>m</sup></sub></code>.
* @deprecated use constructor taking order/cofactor
*/
@Deprecated
public F2m(
int m,
int k1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public CMCEPublicKey(byte[] t)
/**
* @deprecated use getInstance()
*/
@Deprecated
public CMCEPublicKey(ASN1Sequence seq)
{
T = Arrays.clone(ASN1OctetString.getInstance(seq.getObjectAt(0)).getOctets());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public byte[] getH()
/**
* @deprecated use getInstance()
*/
@Deprecated
public FalconPublicKey(ASN1Sequence seq)
{
h = Arrays.clone(ASN1OctetString.getInstance(seq.getObjectAt(0)).getOctets());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public KyberPublicKey(byte[] t, byte[] rho)
/**
* @deprecated use getInstance()
*/
@Deprecated
public KyberPublicKey(ASN1Sequence seq)
{
t = Arrays.clone(ASN1OctetString.getInstance(seq.getObjectAt(0)).getOctets());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,35 +86,43 @@ public interface PQCObjectIdentifiers
/**
* @deprecated use xmss_SHA256ph
*/
@Deprecated
final ASN1ObjectIdentifier xmss_with_SHA256 = xmss_SHA256ph;
/**
* @deprecated use xmss_SHA512ph
*/
@Deprecated
final ASN1ObjectIdentifier xmss_with_SHA512 = xmss_SHA512ph;
/**
* @deprecated use xmss_SHAKE128ph
*/
@Deprecated
final ASN1ObjectIdentifier xmss_with_SHAKE128 = xmss_SHAKE128ph;
/**
* @deprecated use xmss_SHAKE256ph
*/
@Deprecated
final ASN1ObjectIdentifier xmss_with_SHAKE256 = xmss_SHAKE256ph;

/**
* @deprecated use xmss_mt_SHA256ph
*/
@Deprecated
final ASN1ObjectIdentifier xmss_mt_with_SHA256 = xmss_mt_SHA256ph;
/**
* @deprecated use xmss_mt_SHA512ph
*/
@Deprecated
final ASN1ObjectIdentifier xmss_mt_with_SHA512 = xmss_mt_SHA512ph;
/**
* @deprecated use xmss_mt_SHAKE128ph
*/
@Deprecated
final ASN1ObjectIdentifier xmss_mt_with_SHAKE128 = xmss_mt_SHAKE128ph;
/**
* @deprecated use xmss_mt_SHAKE256ph
*/
@Deprecated
final ASN1ObjectIdentifier xmss_mt_with_SHAKE256 = xmss_mt_SHAKE256ph;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public SPHINCSPLUSPrivateKey(int version, byte[] skseed, byte[] skprf, SPHINCSPL
/**
* @deprecated use getInstance()
*/
@Deprecated
public SPHINCSPLUSPrivateKey(ASN1Sequence seq)
{
version = ASN1Integer.getInstance(seq.getObjectAt(0)).intValueExact();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public SPHINCSPLUSPublicKey(byte[] pkseed, byte[] pkroot)
/**
* @deprecated use getInstance()
*/
@Deprecated
public SPHINCSPLUSPublicKey(ASN1Sequence seq)
{
pkseed = Arrays.clone(ASN1OctetString.getInstance(seq.getObjectAt(0)).getOctets());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class DilithiumParameters
* @deprecated
* obsolete to be removed
*/
@Deprecated
private final boolean usingAES;// or shake

private DilithiumParameters(String name, int k, boolean usingAES)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public byte[] getK()
}

/** @deprecated Use {@link #getEncoded()} instead. */
@Deprecated
public byte[] getPrivateKey()
{
return getEncoded();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ public byte[] getK()
/**
* @deprecated Use {@link #getEncoded()} instead.
*/
@Deprecated
public byte[] getPrivateKey()
{
return getEncoded();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ public static SPHINCSPlusParameters getParams(Integer id)
* @return the OID for the parameter set.
* @deprecated Use {@link #getID()} instead
*/
@Deprecated
public static Integer getID(SPHINCSPlusParameters params)
{
return params.getID();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ public XMSSMTPrivateKeyParameters build()
/**
* @deprecated use getEncoded() - this method will become private.
*/
@Deprecated
public byte[] toByteArray()
{
synchronized (this)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ public XMSSMTPublicKeyParameters build()
/**
* @deprecated use getEncoded() - this method will become private.
*/
@Deprecated
public byte[] toByteArray()
{
/* oid || root || seed */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ public XMSSPrivateKeyParameters build()
/**
* @deprecated use getEncoded() - this method will become private.
*/
@Deprecated
public byte[] toByteArray()
{
synchronized (this)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ public XMSSPublicKeyParameters build()
/**
* @deprecated use getEncoded() - this method will become private.
*/
@Deprecated
public byte[] toByteArray()
{
/* oid || root || seed */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*
* @deprecated use Encodable
*/
@Deprecated
public interface XMSSStoreableObjectInterface
{

Expand All @@ -13,5 +14,5 @@ public interface XMSSStoreableObjectInterface
*
* @return Byte representation of object.
*/
public byte[] toByteArray();
byte[] toByteArray();
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*
* @deprecated use org.bouncycastle.util.Arrays.
*/
@Deprecated
public final class ByteUtils
{

Expand Down
Loading