8066617: Suppress deprecation warnings in java.base module
authordarcy
Thu, 04 Dec 2014 12:59:43 -0800
changeset 27804 4659e70271c4
parent 27803 d04ca9d519ce
child 27805 e63666f0f666
8066617: Suppress deprecation warnings in java.base module Reviewed-by: lancea
jdk/src/java.base/share/classes/com/sun/crypto/provider/PBES2Parameters.java
jdk/src/java.base/share/classes/com/sun/crypto/provider/RSACipher.java
jdk/src/java.base/share/classes/com/sun/crypto/provider/TlsKeyMaterialGenerator.java
jdk/src/java.base/share/classes/com/sun/crypto/provider/TlsMasterSecretGenerator.java
jdk/src/java.base/share/classes/com/sun/crypto/provider/TlsPrfGenerator.java
jdk/src/java.base/share/classes/com/sun/crypto/provider/TlsRsaPremasterSecretGenerator.java
jdk/src/java.base/share/classes/com/sun/net/ssl/SSLSecurity.java
jdk/src/java.base/share/classes/com/sun/net/ssl/internal/www/protocol/https/DelegateHttpsURLConnection.java
jdk/src/java.base/share/classes/com/sun/net/ssl/internal/www/protocol/https/HttpsURLConnectionOldImpl.java
jdk/src/java.base/share/classes/java/util/jar/Attributes.java
jdk/src/java.base/share/classes/java/util/jar/Manifest.java
jdk/src/java.base/share/classes/java/util/zip/CRC32C.java
jdk/src/java.base/share/classes/sun/net/idn/UCharacterDirection.java
jdk/src/java.base/share/classes/sun/security/ssl/HandshakeMessage.java
jdk/src/java.base/share/classes/sun/security/ssl/Handshaker.java
jdk/src/java.base/share/classes/sun/security/ssl/RSAClientKeyExchange.java
jdk/src/java.base/share/classes/sun/security/ssl/RSASignature.java
jdk/src/java.base/share/classes/sun/text/normalizer/RuleCharacterIterator.java
jdk/src/java.base/share/classes/sun/text/normalizer/UnicodeSet.java
--- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/PBES2Parameters.java	Thu Dec 04 07:15:37 2014 -0800
+++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/PBES2Parameters.java	Thu Dec 04 12:59:43 2014 -0800
@@ -253,6 +253,7 @@
        this.cipherParam = ((PBEParameterSpec)paramSpec).getParameterSpec();
     }
 
+    @SuppressWarnings("deprecation")
     protected void engineInit(byte[] encoded)
         throws IOException
     {
@@ -290,6 +291,7 @@
             .append(kdfAlgo).append("And").append(cipherAlgo).toString();
     }
 
+    @SuppressWarnings("deprecation")
     private String parseKDF(DerValue keyDerivationFunc) throws IOException {
         String kdfAlgo = null;
 
@@ -351,6 +353,7 @@
         return kdfAlgo;
     }
 
+    @SuppressWarnings("deprecation")
     private String parseES(DerValue encryptionScheme) throws IOException {
         String cipherAlgo = null;
 
--- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/RSACipher.java	Thu Dec 04 07:15:37 2014 -0800
+++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/RSACipher.java	Thu Dec 04 12:59:43 2014 -0800
@@ -243,6 +243,7 @@
     }
 
     // initialize this cipher
+    @SuppressWarnings("deprecation")
     private void init(int opmode, Key key, SecureRandom random,
             AlgorithmParameterSpec params)
             throws InvalidKeyException, InvalidAlgorithmParameterException {
@@ -424,6 +425,7 @@
     }
 
     // see JCE spec
+    @SuppressWarnings("deprecation")
     protected Key engineUnwrap(byte[] wrappedKey, String algorithm,
             int type) throws InvalidKeyException, NoSuchAlgorithmException {
         if (wrappedKey.length > buffer.length) {
--- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/TlsKeyMaterialGenerator.java	Thu Dec 04 07:15:37 2014 -0800
+++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/TlsKeyMaterialGenerator.java	Thu Dec 04 12:59:43 2014 -0800
@@ -46,6 +46,7 @@
     private final static String MSG = "TlsKeyMaterialGenerator must be "
         + "initialized using a TlsKeyMaterialParameterSpec";
 
+    @SuppressWarnings("deprecation")
     private TlsKeyMaterialParameterSpec spec;
 
     private int protocolVersion;
@@ -57,6 +58,7 @@
         throw new InvalidParameterException(MSG);
     }
 
+    @SuppressWarnings("deprecation")
     protected void engineInit(AlgorithmParameterSpec params,
             SecureRandom random) throws InvalidAlgorithmParameterException {
         if (params instanceof TlsKeyMaterialParameterSpec == false) {
@@ -91,6 +93,7 @@
         }
     }
 
+    @SuppressWarnings("deprecation")
     private SecretKey engineGenerateKey0() throws GeneralSecurityException {
         byte[] masterSecret = spec.getMasterSecret().getEncoded();
 
--- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/TlsMasterSecretGenerator.java	Thu Dec 04 07:15:37 2014 -0800
+++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/TlsMasterSecretGenerator.java	Thu Dec 04 12:59:43 2014 -0800
@@ -46,6 +46,7 @@
     private final static String MSG = "TlsMasterSecretGenerator must be "
         + "initialized using a TlsMasterSecretParameterSpec";
 
+    @SuppressWarnings("deprecation")
     private TlsMasterSecretParameterSpec spec;
 
     private int protocolVersion;
@@ -57,6 +58,7 @@
         throw new InvalidParameterException(MSG);
     }
 
+    @SuppressWarnings("deprecation")
     protected void engineInit(AlgorithmParameterSpec params,
             SecureRandom random) throws InvalidAlgorithmParameterException {
         if (params instanceof TlsMasterSecretParameterSpec == false) {
@@ -139,7 +141,8 @@
         }
     }
 
-    private static final class TlsMasterSecretKey implements TlsMasterSecret {
+   @SuppressWarnings("deprecation")
+   private static final class TlsMasterSecretKey implements TlsMasterSecret {
         private static final long serialVersionUID = 1019571680375368880L;
 
         private byte[] key;
--- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/TlsPrfGenerator.java	Thu Dec 04 07:15:37 2014 -0800
+++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/TlsPrfGenerator.java	Thu Dec 04 12:59:43 2014 -0800
@@ -112,6 +112,7 @@
     private final static String MSG = "TlsPrfGenerator must be "
         + "initialized using a TlsPrfParameterSpec";
 
+    @SuppressWarnings("deprecation")
     private TlsPrfParameterSpec spec;
 
     public TlsPrfGenerator() {
@@ -121,6 +122,7 @@
         throw new InvalidParameterException(MSG);
     }
 
+    @SuppressWarnings("deprecation")
     protected void engineInit(AlgorithmParameterSpec params,
             SecureRandom random) throws InvalidAlgorithmParameterException {
         if (params instanceof TlsPrfParameterSpec == false) {
--- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/TlsRsaPremasterSecretGenerator.java	Thu Dec 04 07:15:37 2014 -0800
+++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/TlsRsaPremasterSecretGenerator.java	Thu Dec 04 12:59:43 2014 -0800
@@ -44,6 +44,7 @@
     private final static String MSG = "TlsRsaPremasterSecretGenerator must be "
         + "initialized using a TlsRsaPremasterSecretParameterSpec";
 
+    @SuppressWarnings("deprecation")
     private TlsRsaPremasterSecretParameterSpec spec;
     private SecureRandom random;
 
@@ -54,6 +55,7 @@
         throw new InvalidParameterException(MSG);
     }
 
+    @SuppressWarnings("deprecation")
     protected void engineInit(AlgorithmParameterSpec params,
             SecureRandom random) throws InvalidAlgorithmParameterException {
         if (!(params instanceof TlsRsaPremasterSecretParameterSpec)) {
--- a/jdk/src/java.base/share/classes/com/sun/net/ssl/SSLSecurity.java	Thu Dec 04 07:15:37 2014 -0800
+++ b/jdk/src/java.base/share/classes/com/sun/net/ssl/SSLSecurity.java	Thu Dec 04 12:59:43 2014 -0800
@@ -276,6 +276,7 @@
  * object.  This also mean that anything going down into the SPI
  * needs to be wrapped, as well as anything coming back up.
  */
+@SuppressWarnings("deprecation")
 final class SSLContextSpiWrapper extends SSLContextSpi {
 
     private javax.net.ssl.SSLContext theSSLContext;
@@ -285,6 +286,7 @@
         theSSLContext = javax.net.ssl.SSLContext.getInstance(algName, prov);
     }
 
+    @SuppressWarnings("deprecation")
     protected void engineInit(KeyManager[] kma, TrustManager[] tma,
             SecureRandom sr) throws KeyManagementException {
 
@@ -387,6 +389,7 @@
 
 }
 
+@SuppressWarnings("deprecation")
 final class TrustManagerFactorySpiWrapper extends TrustManagerFactorySpi {
 
     private javax.net.ssl.TrustManagerFactory theTrustManagerFactory;
@@ -438,6 +441,7 @@
 
 }
 
+@SuppressWarnings("deprecation")
 final class KeyManagerFactorySpiWrapper extends KeyManagerFactorySpi {
 
     private javax.net.ssl.KeyManagerFactory theKeyManagerFactory;
@@ -493,6 +497,7 @@
 
 // =================================
 
+@SuppressWarnings("deprecation")
 final class X509KeyManagerJavaxWrapper implements
         javax.net.ssl.X509KeyManager {
 
@@ -590,6 +595,7 @@
     }
 }
 
+@SuppressWarnings("deprecation")
 final class X509TrustManagerJavaxWrapper implements
         javax.net.ssl.X509TrustManager {
 
@@ -622,6 +628,7 @@
     }
 }
 
+@SuppressWarnings("deprecation")
 final class X509KeyManagerComSunWrapper implements X509KeyManager {
 
     private javax.net.ssl.X509KeyManager theX509KeyManager;
@@ -657,6 +664,7 @@
     }
 }
 
+@SuppressWarnings("deprecation")
 final class X509TrustManagerComSunWrapper implements X509TrustManager {
 
     private javax.net.ssl.X509TrustManager theX509TrustManager;
--- a/jdk/src/java.base/share/classes/com/sun/net/ssl/internal/www/protocol/https/DelegateHttpsURLConnection.java	Thu Dec 04 07:15:37 2014 -0800
+++ b/jdk/src/java.base/share/classes/com/sun/net/ssl/internal/www/protocol/https/DelegateHttpsURLConnection.java	Thu Dec 04 12:59:43 2014 -0800
@@ -53,6 +53,7 @@
  * com.sun.net.ssl.HttpURLConnection is used in the com.sun version.
  *
  */
+@SuppressWarnings("deprecation") // HttpsURLConnection is deprecated
 public class DelegateHttpsURLConnection extends AbstractDelegateHttpsURLConnection {
 
     // we need a reference to the HttpsURLConnection to get
@@ -62,6 +63,7 @@
     // this is for ResponseCache.put(URI, URLConnection)
     // second parameter needs to be cast to javax.net.ssl.HttpsURLConnection
     // instead of AbstractDelegateHttpsURLConnection
+
     public com.sun.net.ssl.HttpsURLConnection httpsURLConnection;
 
     DelegateHttpsURLConnection(URL url,
@@ -98,9 +100,10 @@
 }
 
 class VerifierWrapper implements javax.net.ssl.HostnameVerifier {
-
+    @SuppressWarnings("deprecation")
     private com.sun.net.ssl.HostnameVerifier verifier;
 
+    @SuppressWarnings("deprecation")
     VerifierWrapper(com.sun.net.ssl.HostnameVerifier verifier) {
         this.verifier = verifier;
     }
--- a/jdk/src/java.base/share/classes/com/sun/net/ssl/internal/www/protocol/https/HttpsURLConnectionOldImpl.java	Thu Dec 04 07:15:37 2014 -0800
+++ b/jdk/src/java.base/share/classes/com/sun/net/ssl/internal/www/protocol/https/HttpsURLConnectionOldImpl.java	Thu Dec 04 12:59:43 2014 -0800
@@ -64,6 +64,7 @@
 // For both copies of the file, uncomment one line and comment the other
 // public class HttpsURLConnectionImpl
 //      extends javax.net.ssl.HttpsURLConnection {
+@SuppressWarnings("deprecation") // HttpsURLConnection is deprecated
 public class HttpsURLConnectionOldImpl
         extends com.sun.net.ssl.HttpsURLConnection {
 
--- a/jdk/src/java.base/share/classes/java/util/jar/Attributes.java	Thu Dec 04 07:15:37 2014 -0800
+++ b/jdk/src/java.base/share/classes/java/util/jar/Attributes.java	Thu Dec 04 12:59:43 2014 -0800
@@ -298,6 +298,7 @@
      * Writes the current attributes to the specified data output stream.
      * XXX Need to handle UTF8 values and break up lines longer than 72 bytes
      */
+     @SuppressWarnings("deprecation")
      void write(DataOutputStream os) throws IOException {
          for (Entry<Object, Object> e : entrySet()) {
              StringBuffer buffer = new StringBuffer(
@@ -325,6 +326,7 @@
      *
      * XXX Need to handle UTF8 values and break up lines longer than 72 bytes
      */
+    @SuppressWarnings("deprecation")
     void writeMain(DataOutputStream out) throws IOException
     {
         // write out the *-Version header first, if it exists
@@ -367,6 +369,7 @@
      * Reads attributes from the specified input stream.
      * XXX Need to handle UTF8 values.
      */
+    @SuppressWarnings("deprecation")
     void read(Manifest.FastInputStream is, byte[] lbuf) throws IOException {
         String name = null, value = null;
         byte[] lastline = null;
--- a/jdk/src/java.base/share/classes/java/util/jar/Manifest.java	Thu Dec 04 07:15:37 2014 -0800
+++ b/jdk/src/java.base/share/classes/java/util/jar/Manifest.java	Thu Dec 04 12:59:43 2014 -0800
@@ -143,6 +143,7 @@
      * @exception IOException if an I/O error has occurred
      * @see #getMainAttributes
      */
+    @SuppressWarnings("deprecation")
     public void write(OutputStream out) throws IOException {
         DataOutputStream dos = new DataOutputStream(out);
         // Write out the main attributes for the manifest
--- a/jdk/src/java.base/share/classes/java/util/zip/CRC32C.java	Thu Dec 04 07:15:37 2014 -0800
+++ b/jdk/src/java.base/share/classes/java/util/zip/CRC32C.java	Thu Dec 04 12:59:43 2014 -0800
@@ -204,6 +204,7 @@
     /**
      * 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) {
 
         // Do only byte reads for arrays so short they can't be aligned
--- a/jdk/src/java.base/share/classes/sun/net/idn/UCharacterDirection.java	Thu Dec 04 07:15:37 2014 -0800
+++ b/jdk/src/java.base/share/classes/sun/net/idn/UCharacterDirection.java	Thu Dec 04 12:59:43 2014 -0800
@@ -46,6 +46,7 @@
  * @stable ICU 2.1
  */
 
+@SuppressWarnings("deprecation")
 final class UCharacterDirection implements UCharacterEnums.ECharacterDirection {
 
     // private constructor =========================================
--- a/jdk/src/java.base/share/classes/sun/security/ssl/HandshakeMessage.java	Thu Dec 04 07:15:37 2014 -0800
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/HandshakeMessage.java	Thu Dec 04 12:59:43 2014 -0800
@@ -1963,6 +1963,7 @@
                  * algorithm.  If we ever run across a different
                  * length, this call will need to be updated.
                  */
+                @SuppressWarnings("deprecation")
                 TlsPrfParameterSpec spec = new TlsPrfParameterSpec(
                     masterKey, tlsLabel, seed, 12,
                     prfHashAlg, prfHashLength, prfBlockSize);
--- a/jdk/src/java.base/share/classes/sun/security/ssl/Handshaker.java	Thu Dec 04 07:15:37 2014 -0800
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/Handshaker.java	Thu Dec 04 12:59:43 2014 -0800
@@ -1122,6 +1122,7 @@
         int prfHashLength = prf.getPRFHashLength();
         int prfBlockSize = prf.getPRFBlockSize();
 
+        @SuppressWarnings("deprecation")
         TlsMasterSecretParameterSpec spec = new TlsMasterSecretParameterSpec(
                 preMasterSecret, protocolVersion.major, protocolVersion.minor,
                 clnt_random.random_bytes, svr_random.random_bytes,
@@ -1156,6 +1157,7 @@
      * a premaster secret and started a new session) as well as on the
      * "fast handshake" (where we just resumed a pre-existing session).
      */
+    @SuppressWarnings("deprecation")
     void calculateConnectionKeys(SecretKey masterKey) {
         /*
          * For both the read and write sides of the protocol, we use the
--- a/jdk/src/java.base/share/classes/sun/security/ssl/RSAClientKeyExchange.java	Thu Dec 04 07:15:37 2014 -0800
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/RSAClientKeyExchange.java	Thu Dec 04 12:59:43 2014 -0800
@@ -63,6 +63,7 @@
      * it, using its RSA private key.  Result is the same size as the
      * server's public key, and uses PKCS #1 block format 02.
      */
+    @SuppressWarnings("deprecation")
     RSAClientKeyExchange(ProtocolVersion protocolVersion,
             ProtocolVersion maxVersion,
             SecureRandom generator, PublicKey publicKey) throws IOException {
@@ -92,6 +93,7 @@
      * Server gets the PKCS #1 (block format 02) data, decrypts
      * it with its private key.
      */
+    @SuppressWarnings("deprecation")
     RSAClientKeyExchange(ProtocolVersion currentVersion,
             ProtocolVersion maxVersion,
             SecureRandom generator, HandshakeInStream input,
--- a/jdk/src/java.base/share/classes/sun/security/ssl/RSASignature.java	Thu Dec 04 07:15:37 2014 -0800
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/RSASignature.java	Thu Dec 04 12:59:43 2014 -0800
@@ -83,6 +83,7 @@
     /**
      * Set the MD5 and SHA hashes to the provided objects.
      */
+    @SuppressWarnings("deprecation")
     static void setHashes(Signature sig, MessageDigest md5, MessageDigest sha) {
         sig.setParameter("hashes", new MessageDigest[] {md5, sha});
     }
@@ -183,6 +184,7 @@
     }
 
     @Override
+    @SuppressWarnings("deprecation")
     protected void engineSetParameter(String param, Object value)
             throws InvalidParameterException {
         if (param.equals("hashes") == false) {
@@ -199,6 +201,7 @@
     }
 
     @Override
+    @SuppressWarnings("deprecation")
     protected Object engineGetParameter(String param)
             throws InvalidParameterException {
         throw new InvalidParameterException("Parameters not supported");
--- a/jdk/src/java.base/share/classes/sun/text/normalizer/RuleCharacterIterator.java	Thu Dec 04 07:15:37 2014 -0800
+++ b/jdk/src/java.base/share/classes/sun/text/normalizer/RuleCharacterIterator.java	Thu Dec 04 12:59:43 2014 -0800
@@ -54,6 +54,7 @@
  * @author Alan Liu
  * @since ICU 2.8
  */
+@SuppressWarnings("deprecation")
 public class RuleCharacterIterator {
 
     // TODO: Ideas for later.  (Do not implement if not needed, lest the
--- a/jdk/src/java.base/share/classes/sun/text/normalizer/UnicodeSet.java	Thu Dec 04 07:15:37 2014 -0800
+++ b/jdk/src/java.base/share/classes/sun/text/normalizer/UnicodeSet.java	Thu Dec 04 12:59:43 2014 -0800
@@ -273,6 +273,7 @@
  * @stable ICU 2.0
  * @see UnicodeSetIterator
  */
+@SuppressWarnings("deprecation")
 public class UnicodeSet implements UnicodeMatcher {
 
     private static final int LOW = 0x000000; // LOW <= all valid values. ZERO for codepoints