8066617: Suppress deprecation warnings in java.base module

Reviewed-by: lancea
This commit is contained in:
Joe Darcy 2014-12-04 12:59:43 -08:00
parent ea89dad13c
commit 4edac8c9d2
19 changed files with 45 additions and 2 deletions

View file

@ -253,6 +253,7 @@ abstract class PBES2Parameters extends AlgorithmParametersSpi {
this.cipherParam = ((PBEParameterSpec)paramSpec).getParameterSpec(); this.cipherParam = ((PBEParameterSpec)paramSpec).getParameterSpec();
} }
@SuppressWarnings("deprecation")
protected void engineInit(byte[] encoded) protected void engineInit(byte[] encoded)
throws IOException throws IOException
{ {
@ -290,6 +291,7 @@ abstract class PBES2Parameters extends AlgorithmParametersSpi {
.append(kdfAlgo).append("And").append(cipherAlgo).toString(); .append(kdfAlgo).append("And").append(cipherAlgo).toString();
} }
@SuppressWarnings("deprecation")
private String parseKDF(DerValue keyDerivationFunc) throws IOException { private String parseKDF(DerValue keyDerivationFunc) throws IOException {
String kdfAlgo = null; String kdfAlgo = null;
@ -351,6 +353,7 @@ abstract class PBES2Parameters extends AlgorithmParametersSpi {
return kdfAlgo; return kdfAlgo;
} }
@SuppressWarnings("deprecation")
private String parseES(DerValue encryptionScheme) throws IOException { private String parseES(DerValue encryptionScheme) throws IOException {
String cipherAlgo = null; String cipherAlgo = null;

View file

@ -243,6 +243,7 @@ public final class RSACipher extends CipherSpi {
} }
// initialize this cipher // initialize this cipher
@SuppressWarnings("deprecation")
private void init(int opmode, Key key, SecureRandom random, private void init(int opmode, Key key, SecureRandom random,
AlgorithmParameterSpec params) AlgorithmParameterSpec params)
throws InvalidKeyException, InvalidAlgorithmParameterException { throws InvalidKeyException, InvalidAlgorithmParameterException {
@ -424,6 +425,7 @@ public final class RSACipher extends CipherSpi {
} }
// see JCE spec // see JCE spec
@SuppressWarnings("deprecation")
protected Key engineUnwrap(byte[] wrappedKey, String algorithm, protected Key engineUnwrap(byte[] wrappedKey, String algorithm,
int type) throws InvalidKeyException, NoSuchAlgorithmException { int type) throws InvalidKeyException, NoSuchAlgorithmException {
if (wrappedKey.length > buffer.length) { if (wrappedKey.length > buffer.length) {

View file

@ -46,6 +46,7 @@ public final class TlsKeyMaterialGenerator extends KeyGeneratorSpi {
private final static String MSG = "TlsKeyMaterialGenerator must be " private final static String MSG = "TlsKeyMaterialGenerator must be "
+ "initialized using a TlsKeyMaterialParameterSpec"; + "initialized using a TlsKeyMaterialParameterSpec";
@SuppressWarnings("deprecation")
private TlsKeyMaterialParameterSpec spec; private TlsKeyMaterialParameterSpec spec;
private int protocolVersion; private int protocolVersion;
@ -57,6 +58,7 @@ public final class TlsKeyMaterialGenerator extends KeyGeneratorSpi {
throw new InvalidParameterException(MSG); throw new InvalidParameterException(MSG);
} }
@SuppressWarnings("deprecation")
protected void engineInit(AlgorithmParameterSpec params, protected void engineInit(AlgorithmParameterSpec params,
SecureRandom random) throws InvalidAlgorithmParameterException { SecureRandom random) throws InvalidAlgorithmParameterException {
if (params instanceof TlsKeyMaterialParameterSpec == false) { if (params instanceof TlsKeyMaterialParameterSpec == false) {
@ -91,6 +93,7 @@ public final class TlsKeyMaterialGenerator extends KeyGeneratorSpi {
} }
} }
@SuppressWarnings("deprecation")
private SecretKey engineGenerateKey0() throws GeneralSecurityException { private SecretKey engineGenerateKey0() throws GeneralSecurityException {
byte[] masterSecret = spec.getMasterSecret().getEncoded(); byte[] masterSecret = spec.getMasterSecret().getEncoded();

View file

@ -46,6 +46,7 @@ public final class TlsMasterSecretGenerator extends KeyGeneratorSpi {
private final static String MSG = "TlsMasterSecretGenerator must be " private final static String MSG = "TlsMasterSecretGenerator must be "
+ "initialized using a TlsMasterSecretParameterSpec"; + "initialized using a TlsMasterSecretParameterSpec";
@SuppressWarnings("deprecation")
private TlsMasterSecretParameterSpec spec; private TlsMasterSecretParameterSpec spec;
private int protocolVersion; private int protocolVersion;
@ -57,6 +58,7 @@ public final class TlsMasterSecretGenerator extends KeyGeneratorSpi {
throw new InvalidParameterException(MSG); throw new InvalidParameterException(MSG);
} }
@SuppressWarnings("deprecation")
protected void engineInit(AlgorithmParameterSpec params, protected void engineInit(AlgorithmParameterSpec params,
SecureRandom random) throws InvalidAlgorithmParameterException { SecureRandom random) throws InvalidAlgorithmParameterException {
if (params instanceof TlsMasterSecretParameterSpec == false) { if (params instanceof TlsMasterSecretParameterSpec == false) {
@ -139,6 +141,7 @@ public final class TlsMasterSecretGenerator extends KeyGeneratorSpi {
} }
} }
@SuppressWarnings("deprecation")
private static final class TlsMasterSecretKey implements TlsMasterSecret { private static final class TlsMasterSecretKey implements TlsMasterSecret {
private static final long serialVersionUID = 1019571680375368880L; private static final long serialVersionUID = 1019571680375368880L;

View file

@ -112,6 +112,7 @@ abstract class TlsPrfGenerator extends KeyGeneratorSpi {
private final static String MSG = "TlsPrfGenerator must be " private final static String MSG = "TlsPrfGenerator must be "
+ "initialized using a TlsPrfParameterSpec"; + "initialized using a TlsPrfParameterSpec";
@SuppressWarnings("deprecation")
private TlsPrfParameterSpec spec; private TlsPrfParameterSpec spec;
public TlsPrfGenerator() { public TlsPrfGenerator() {
@ -121,6 +122,7 @@ abstract class TlsPrfGenerator extends KeyGeneratorSpi {
throw new InvalidParameterException(MSG); throw new InvalidParameterException(MSG);
} }
@SuppressWarnings("deprecation")
protected void engineInit(AlgorithmParameterSpec params, protected void engineInit(AlgorithmParameterSpec params,
SecureRandom random) throws InvalidAlgorithmParameterException { SecureRandom random) throws InvalidAlgorithmParameterException {
if (params instanceof TlsPrfParameterSpec == false) { if (params instanceof TlsPrfParameterSpec == false) {

View file

@ -44,6 +44,7 @@ public final class TlsRsaPremasterSecretGenerator extends KeyGeneratorSpi {
private final static String MSG = "TlsRsaPremasterSecretGenerator must be " private final static String MSG = "TlsRsaPremasterSecretGenerator must be "
+ "initialized using a TlsRsaPremasterSecretParameterSpec"; + "initialized using a TlsRsaPremasterSecretParameterSpec";
@SuppressWarnings("deprecation")
private TlsRsaPremasterSecretParameterSpec spec; private TlsRsaPremasterSecretParameterSpec spec;
private SecureRandom random; private SecureRandom random;
@ -54,6 +55,7 @@ public final class TlsRsaPremasterSecretGenerator extends KeyGeneratorSpi {
throw new InvalidParameterException(MSG); throw new InvalidParameterException(MSG);
} }
@SuppressWarnings("deprecation")
protected void engineInit(AlgorithmParameterSpec params, protected void engineInit(AlgorithmParameterSpec params,
SecureRandom random) throws InvalidAlgorithmParameterException { SecureRandom random) throws InvalidAlgorithmParameterException {
if (!(params instanceof TlsRsaPremasterSecretParameterSpec)) { if (!(params instanceof TlsRsaPremasterSecretParameterSpec)) {

View file

@ -276,6 +276,7 @@ final class SSLSecurity {
* object. This also mean that anything going down into the SPI * object. This also mean that anything going down into the SPI
* needs to be wrapped, as well as anything coming back up. * needs to be wrapped, as well as anything coming back up.
*/ */
@SuppressWarnings("deprecation")
final class SSLContextSpiWrapper extends SSLContextSpi { final class SSLContextSpiWrapper extends SSLContextSpi {
private javax.net.ssl.SSLContext theSSLContext; private javax.net.ssl.SSLContext theSSLContext;
@ -285,6 +286,7 @@ final class SSLContextSpiWrapper extends SSLContextSpi {
theSSLContext = javax.net.ssl.SSLContext.getInstance(algName, prov); theSSLContext = javax.net.ssl.SSLContext.getInstance(algName, prov);
} }
@SuppressWarnings("deprecation")
protected void engineInit(KeyManager[] kma, TrustManager[] tma, protected void engineInit(KeyManager[] kma, TrustManager[] tma,
SecureRandom sr) throws KeyManagementException { SecureRandom sr) throws KeyManagementException {
@ -387,6 +389,7 @@ final class SSLContextSpiWrapper extends SSLContextSpi {
} }
@SuppressWarnings("deprecation")
final class TrustManagerFactorySpiWrapper extends TrustManagerFactorySpi { final class TrustManagerFactorySpiWrapper extends TrustManagerFactorySpi {
private javax.net.ssl.TrustManagerFactory theTrustManagerFactory; private javax.net.ssl.TrustManagerFactory theTrustManagerFactory;
@ -438,6 +441,7 @@ final class TrustManagerFactorySpiWrapper extends TrustManagerFactorySpi {
} }
@SuppressWarnings("deprecation")
final class KeyManagerFactorySpiWrapper extends KeyManagerFactorySpi { final class KeyManagerFactorySpiWrapper extends KeyManagerFactorySpi {
private javax.net.ssl.KeyManagerFactory theKeyManagerFactory; private javax.net.ssl.KeyManagerFactory theKeyManagerFactory;
@ -493,6 +497,7 @@ final class KeyManagerFactorySpiWrapper extends KeyManagerFactorySpi {
// ================================= // =================================
@SuppressWarnings("deprecation")
final class X509KeyManagerJavaxWrapper implements final class X509KeyManagerJavaxWrapper implements
javax.net.ssl.X509KeyManager { javax.net.ssl.X509KeyManager {
@ -590,6 +595,7 @@ final class X509KeyManagerJavaxWrapper implements
} }
} }
@SuppressWarnings("deprecation")
final class X509TrustManagerJavaxWrapper implements final class X509TrustManagerJavaxWrapper implements
javax.net.ssl.X509TrustManager { javax.net.ssl.X509TrustManager {
@ -622,6 +628,7 @@ final class X509TrustManagerJavaxWrapper implements
} }
} }
@SuppressWarnings("deprecation")
final class X509KeyManagerComSunWrapper implements X509KeyManager { final class X509KeyManagerComSunWrapper implements X509KeyManager {
private javax.net.ssl.X509KeyManager theX509KeyManager; private javax.net.ssl.X509KeyManager theX509KeyManager;
@ -657,6 +664,7 @@ final class X509KeyManagerComSunWrapper implements X509KeyManager {
} }
} }
@SuppressWarnings("deprecation")
final class X509TrustManagerComSunWrapper implements X509TrustManager { final class X509TrustManagerComSunWrapper implements X509TrustManager {
private javax.net.ssl.X509TrustManager theX509TrustManager; private javax.net.ssl.X509TrustManager theX509TrustManager;

View file

@ -53,6 +53,7 @@ import sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection;
* com.sun.net.ssl.HttpURLConnection is used in the com.sun version. * com.sun.net.ssl.HttpURLConnection is used in the com.sun version.
* *
*/ */
@SuppressWarnings("deprecation") // HttpsURLConnection is deprecated
public class DelegateHttpsURLConnection extends AbstractDelegateHttpsURLConnection { public class DelegateHttpsURLConnection extends AbstractDelegateHttpsURLConnection {
// we need a reference to the HttpsURLConnection to get // we need a reference to the HttpsURLConnection to get
@ -62,6 +63,7 @@ public class DelegateHttpsURLConnection extends AbstractDelegateHttpsURLConnecti
// this is for ResponseCache.put(URI, URLConnection) // this is for ResponseCache.put(URI, URLConnection)
// second parameter needs to be cast to javax.net.ssl.HttpsURLConnection // second parameter needs to be cast to javax.net.ssl.HttpsURLConnection
// instead of AbstractDelegateHttpsURLConnection // instead of AbstractDelegateHttpsURLConnection
public com.sun.net.ssl.HttpsURLConnection httpsURLConnection; public com.sun.net.ssl.HttpsURLConnection httpsURLConnection;
DelegateHttpsURLConnection(URL url, DelegateHttpsURLConnection(URL url,
@ -98,9 +100,10 @@ public class DelegateHttpsURLConnection extends AbstractDelegateHttpsURLConnecti
} }
class VerifierWrapper implements javax.net.ssl.HostnameVerifier { class VerifierWrapper implements javax.net.ssl.HostnameVerifier {
@SuppressWarnings("deprecation")
private com.sun.net.ssl.HostnameVerifier verifier; private com.sun.net.ssl.HostnameVerifier verifier;
@SuppressWarnings("deprecation")
VerifierWrapper(com.sun.net.ssl.HostnameVerifier verifier) { VerifierWrapper(com.sun.net.ssl.HostnameVerifier verifier) {
this.verifier = verifier; this.verifier = verifier;
} }

View file

@ -64,6 +64,7 @@ import sun.net.www.http.HttpClient;
// For both copies of the file, uncomment one line and comment the other // For both copies of the file, uncomment one line and comment the other
// public class HttpsURLConnectionImpl // public class HttpsURLConnectionImpl
// extends javax.net.ssl.HttpsURLConnection { // extends javax.net.ssl.HttpsURLConnection {
@SuppressWarnings("deprecation") // HttpsURLConnection is deprecated
public class HttpsURLConnectionOldImpl public class HttpsURLConnectionOldImpl
extends com.sun.net.ssl.HttpsURLConnection { extends com.sun.net.ssl.HttpsURLConnection {

View file

@ -298,6 +298,7 @@ public class Attributes implements Map<Object,Object>, Cloneable {
* Writes the current attributes to the specified data output stream. * Writes the current attributes to the specified data output stream.
* XXX Need to handle UTF8 values and break up lines longer than 72 bytes * XXX Need to handle UTF8 values and break up lines longer than 72 bytes
*/ */
@SuppressWarnings("deprecation")
void write(DataOutputStream os) throws IOException { void write(DataOutputStream os) throws IOException {
for (Entry<Object, Object> e : entrySet()) { for (Entry<Object, Object> e : entrySet()) {
StringBuffer buffer = new StringBuffer( StringBuffer buffer = new StringBuffer(
@ -325,6 +326,7 @@ public class Attributes implements Map<Object,Object>, Cloneable {
* *
* XXX Need to handle UTF8 values and break up lines longer than 72 bytes * XXX Need to handle UTF8 values and break up lines longer than 72 bytes
*/ */
@SuppressWarnings("deprecation")
void writeMain(DataOutputStream out) throws IOException void writeMain(DataOutputStream out) throws IOException
{ {
// write out the *-Version header first, if it exists // write out the *-Version header first, if it exists
@ -367,6 +369,7 @@ public class Attributes implements Map<Object,Object>, Cloneable {
* Reads attributes from the specified input stream. * Reads attributes from the specified input stream.
* XXX Need to handle UTF8 values. * XXX Need to handle UTF8 values.
*/ */
@SuppressWarnings("deprecation")
void read(Manifest.FastInputStream is, byte[] lbuf) throws IOException { void read(Manifest.FastInputStream is, byte[] lbuf) throws IOException {
String name = null, value = null; String name = null, value = null;
byte[] lastline = null; byte[] lastline = null;

View file

@ -143,6 +143,7 @@ public class Manifest implements Cloneable {
* @exception IOException if an I/O error has occurred * @exception IOException if an I/O error has occurred
* @see #getMainAttributes * @see #getMainAttributes
*/ */
@SuppressWarnings("deprecation")
public void write(OutputStream out) throws IOException { public void write(OutputStream out) throws IOException {
DataOutputStream dos = new DataOutputStream(out); DataOutputStream dos = new DataOutputStream(out);
// Write out the main attributes for the manifest // Write out the main attributes for the manifest

View file

@ -204,6 +204,7 @@ public final class CRC32C implements Checksum {
/** /**
* Updates the CRC-32C checksum with the specified array of bytes. * Updates the CRC-32C checksum with the specified array of bytes.
*/ */
@SuppressWarnings("deprecation") // Unsafe.{getInt, getLong}
private static int updateBytes(int crc, byte[] b, int off, int end) { private static int updateBytes(int crc, byte[] b, int off, int end) {
// Do only byte reads for arrays so short they can't be aligned // Do only byte reads for arrays so short they can't be aligned

View file

@ -46,6 +46,7 @@ package sun.net.idn;
* @stable ICU 2.1 * @stable ICU 2.1
*/ */
@SuppressWarnings("deprecation")
final class UCharacterDirection implements UCharacterEnums.ECharacterDirection { final class UCharacterDirection implements UCharacterEnums.ECharacterDirection {
// private constructor ========================================= // private constructor =========================================

View file

@ -1963,6 +1963,7 @@ static final class Finished extends HandshakeMessage {
* algorithm. If we ever run across a different * algorithm. If we ever run across a different
* length, this call will need to be updated. * length, this call will need to be updated.
*/ */
@SuppressWarnings("deprecation")
TlsPrfParameterSpec spec = new TlsPrfParameterSpec( TlsPrfParameterSpec spec = new TlsPrfParameterSpec(
masterKey, tlsLabel, seed, 12, masterKey, tlsLabel, seed, 12,
prfHashAlg, prfHashLength, prfBlockSize); prfHashAlg, prfHashLength, prfBlockSize);

View file

@ -1122,6 +1122,7 @@ abstract class Handshaker {
int prfHashLength = prf.getPRFHashLength(); int prfHashLength = prf.getPRFHashLength();
int prfBlockSize = prf.getPRFBlockSize(); int prfBlockSize = prf.getPRFBlockSize();
@SuppressWarnings("deprecation")
TlsMasterSecretParameterSpec spec = new TlsMasterSecretParameterSpec( TlsMasterSecretParameterSpec spec = new TlsMasterSecretParameterSpec(
preMasterSecret, protocolVersion.major, protocolVersion.minor, preMasterSecret, protocolVersion.major, protocolVersion.minor,
clnt_random.random_bytes, svr_random.random_bytes, clnt_random.random_bytes, svr_random.random_bytes,
@ -1156,6 +1157,7 @@ abstract class Handshaker {
* a premaster secret and started a new session) as well as on the * a premaster secret and started a new session) as well as on the
* "fast handshake" (where we just resumed a pre-existing session). * "fast handshake" (where we just resumed a pre-existing session).
*/ */
@SuppressWarnings("deprecation")
void calculateConnectionKeys(SecretKey masterKey) { void calculateConnectionKeys(SecretKey masterKey) {
/* /*
* For both the read and write sides of the protocol, we use the * For both the read and write sides of the protocol, we use the

View file

@ -63,6 +63,7 @@ final class RSAClientKeyExchange extends HandshakeMessage {
* it, using its RSA private key. Result is the same size as the * it, using its RSA private key. Result is the same size as the
* server's public key, and uses PKCS #1 block format 02. * server's public key, and uses PKCS #1 block format 02.
*/ */
@SuppressWarnings("deprecation")
RSAClientKeyExchange(ProtocolVersion protocolVersion, RSAClientKeyExchange(ProtocolVersion protocolVersion,
ProtocolVersion maxVersion, ProtocolVersion maxVersion,
SecureRandom generator, PublicKey publicKey) throws IOException { SecureRandom generator, PublicKey publicKey) throws IOException {
@ -92,6 +93,7 @@ final class RSAClientKeyExchange extends HandshakeMessage {
* Server gets the PKCS #1 (block format 02) data, decrypts * Server gets the PKCS #1 (block format 02) data, decrypts
* it with its private key. * it with its private key.
*/ */
@SuppressWarnings("deprecation")
RSAClientKeyExchange(ProtocolVersion currentVersion, RSAClientKeyExchange(ProtocolVersion currentVersion,
ProtocolVersion maxVersion, ProtocolVersion maxVersion,
SecureRandom generator, HandshakeInStream input, SecureRandom generator, HandshakeInStream input,

View file

@ -83,6 +83,7 @@ public final class RSASignature extends SignatureSpi {
/** /**
* Set the MD5 and SHA hashes to the provided objects. * Set the MD5 and SHA hashes to the provided objects.
*/ */
@SuppressWarnings("deprecation")
static void setHashes(Signature sig, MessageDigest md5, MessageDigest sha) { static void setHashes(Signature sig, MessageDigest md5, MessageDigest sha) {
sig.setParameter("hashes", new MessageDigest[] {md5, sha}); sig.setParameter("hashes", new MessageDigest[] {md5, sha});
} }
@ -183,6 +184,7 @@ public final class RSASignature extends SignatureSpi {
} }
@Override @Override
@SuppressWarnings("deprecation")
protected void engineSetParameter(String param, Object value) protected void engineSetParameter(String param, Object value)
throws InvalidParameterException { throws InvalidParameterException {
if (param.equals("hashes") == false) { if (param.equals("hashes") == false) {
@ -199,6 +201,7 @@ public final class RSASignature extends SignatureSpi {
} }
@Override @Override
@SuppressWarnings("deprecation")
protected Object engineGetParameter(String param) protected Object engineGetParameter(String param)
throws InvalidParameterException { throws InvalidParameterException {
throw new InvalidParameterException("Parameters not supported"); throw new InvalidParameterException("Parameters not supported");

View file

@ -54,6 +54,7 @@ import java.text.ParsePosition;
* @author Alan Liu * @author Alan Liu
* @since ICU 2.8 * @since ICU 2.8
*/ */
@SuppressWarnings("deprecation")
public class RuleCharacterIterator { public class RuleCharacterIterator {
// TODO: Ideas for later. (Do not implement if not needed, lest the // TODO: Ideas for later. (Do not implement if not needed, lest the

View file

@ -273,6 +273,7 @@ import java.util.TreeSet;
* @stable ICU 2.0 * @stable ICU 2.0
* @see UnicodeSetIterator * @see UnicodeSetIterator
*/ */
@SuppressWarnings("deprecation")
public class UnicodeSet implements UnicodeMatcher { public class UnicodeSet implements UnicodeMatcher {
private static final int LOW = 0x000000; // LOW <= all valid values. ZERO for codepoints private static final int LOW = 0x000000; // LOW <= all valid values. ZERO for codepoints