The classes and interfaces in the com.sun.net.ssl package are
deprecated and
replaced by classes and interfaces in the javax.net.ssl package.
The automated fix changes references to the com.sun.net.ssl package
to javax.net.ssl. Copy the custom configuration
to your application build file to enable the fix automation. The rule will detect fully qualified names in import
statements and in the body of the Java code.
For example, code fragments such as
import com.sun.net.ssl.X509KeyManager;
if (keyManager instanceof com.sun.net.ssl.X509KeyManager)
|
are changed to
import javax.net.ssl.X509KeyManager;
if (keyManager instanceof javax.net.ssl.X509KeyManager)
|
The automated fix changes package imports such as
import com.sun.net.ssl.*;
|
to
After applying the automated fixes for this rule, you may still have a
number of changes to make depending on which APIs you use and how
you use them.
Use the Eclipse Java problem markers to
help you work through additional changes needed because of the
differences between the com.sun.net.ssl
APIs and the javax.net.ssl APIs.
Some examples of the differences include:
- javax.net.ssl.KeyManager, javax.net.ssl.KeyManagerFactory,
javax.net.ssl.TrustManager, and javax.net.ssl.TrustManagerFactory added the
final Java modifier to some of their
methods and can no longer be overridden.
- javax.net.ssl.X509KeyManager
changed the parameter types on the methods
chooseClientAlias and
chooseServerAlias.
- javax.net.ssl.KeyManagerFactorySpi
and javax.net.ssl.TrustManagerFactorySpi
removed the engineInit(KeyManagerFactoryParametersSpec arg0) method.
Additional methods were added it its place.
- javax.net.ssl.SSLContextSpi
removed the engineInit(String arg0, String arg1, String arg2)
method. Additional methods were added it its place.
- javax.net.ssl.SSLContext changed the
arguments on its init method.
- javax.net.ssl.X509TrustManager changed its
isClientTrusted and isServerTrusted methods.
Use checkClientTrusted and
checkServerTrusted methods instead with the appropriate parameters.
- Class javax.net.ssl.HttpsURLConnection has new abstract methods to implement.
- Class javax.net.ssl.KeyManagerFactorySpi has new abstract methods to implement.
- Class javax.net.ssl.SSLContextSpi has new abstract methods to implement.
- Class javax.net.ssl.TrustManagerFactorySpi has new abstract methods to implement.
- Interface javax.net.ssl.HostnameVerifier has a new method to implement.
- Interface javax.net.ssl.X509KeyManager has new methods to implement.
- Interface javax.net.ssl.X509TrustManager has new methods to implement.
For additional information related to this rule, see: