Building with 'export CHECK_DEPRECATION=1' results in over 100 warnings.
Some may be serious, some not so much, but many indicate usage of constructors, classes and methods that are planned for future removal. https://docs.oracle.com/javase/10/docs/api/index.html?deprecated-list.html documents most of them and in some cases offers suggestions regarding alternative means of accomplishing the intended task.
Adding the pertinent "@deprecation" and "@Deprecation" annotations with some comments will make the maintainers life easier in the future.
Filling this issue to prevent unpleasant surprises a few years from now.
This would be a lot of grunt that I doubt anyone will be looking forward to. Some planning and prioritizing may help. Perhaps a summer intern could tackle a portion of it. Please give him/her something more fun after a while. Oops, coudn't resist the temptation of throwing in a bit of sick humor.
I suspect that the ones relating to [1] and [2] would be the most important and the ones to investigate first. [1] https://docs.oracle.com/javase/9/docs/api/deprecated-list.html#forRemoval [2] https://docs.oracle.com/javase/10/docs/api/deprecated-list.html#forRemoval
https://github.com/emaldona/jss/tree/DEPRECATION_WARNINGS_BRANCH has been created to carry out this work. Made some initial commits and no more will be coming until the time is ripe to work on this issue.
As mentioned earlier, this effort entails two phases so I have opened https://pagure.io/jss/issue/19 for the part that can be dealt with earlier.
Things I have recently learned:
https://docs.oracle.com/javase/10/docs/api/java/security/acl/package-summary.html lists classes and API elements marked Deprecated, for removal and subject to removal in a future version.
These are Acl, AclEntry, Group, Owner, and Permission. https://docs.oracle.com/javase/10/docs/api/java/security/acl/Permission.html https://docs.oracle.com/javase/10/docs/api/java/security/acl/Acl.html https://docs.oracle.com/javase/10/docs/api/java/security/acl/AclEntry.html https://docs.oracle.com/javase/10/docs/api/java/security/acl/Group.html https://docs.oracle.com/javase/10/docs/api/java/security/acl/Owner.html https://docs.oracle.com/javase/10/docs/api/java/security/acl/Permission.html
plus the related Exceptions NotOwnerException and LastOwnerException
For all of them, Policy is the recommended class for replacement, documented at https://docs.oracle.com/javase/10/docs/api/java/security/Policy.html
The JSS affected classes are all in the org.mozilla.jss.netscape.security.acl package.
As netscape.security.acl was unused (and a duplicate of the old sun.security.acl implementation), I've remove it. This removes a lot of the deprecations.
netscape.security.acl
sun.security.acl
Metadata Update from @cipherboy: - Custom field component adjusted to None - Custom field feature adjusted to None - Custom field origin adjusted to None - Custom field proposedmilestone adjusted to None - Custom field proposedpriority adjusted to None - Custom field reviewer adjusted to None - Custom field type adjusted to None - Custom field version adjusted to None
There are a lot fewer deprecation warnings which remain:
/home/ascheel/GitHub/cipherboy/jss/src/main/java/org/mozilla/jss/netscape/security/x509/X509Cert.java:25: warning: [deprecation] Certificate in java.security has been deprecated import java.security.Certificate; ^ /home/ascheel/GitHub/cipherboy/jss/src/main/java/org/mozilla/jss/pkcs11/ModuleProxy.java:16: warning: [deprecation] finalize() in NativeProxy has been deprecated protected void finalize() throws Throwable { ^ /home/ascheel/GitHub/cipherboy/jss/src/main/java/org/mozilla/jss/pkcs11/ModuleProxy.java:17: warning: [deprecation] finalize() in NativeProxy has been deprecated super.finalize(); ^ /home/ascheel/GitHub/cipherboy/jss/src/main/java/org/mozilla/jss/pkcs11/KeyProxy.java:12: warning: [deprecation] finalize() in NativeProxy has been deprecated protected void finalize() throws Throwable { ^ /home/ascheel/GitHub/cipherboy/jss/src/main/java/org/mozilla/jss/pkcs11/KeyProxy.java:13: warning: [deprecation] finalize() in NativeProxy has been deprecated super.finalize(); ^ /home/ascheel/GitHub/cipherboy/jss/src/main/java/org/mozilla/jss/nss/PRFDProxy.java:12: warning: [deprecation] finalize() in NativeProxy has been deprecated protected void finalize() throws Throwable { ^ /home/ascheel/GitHub/cipherboy/jss/src/main/java/org/mozilla/jss/nss/PRFDProxy.java:13: warning: [deprecation] finalize() in NativeProxy has been deprecated super.finalize(); ^ /home/ascheel/GitHub/cipherboy/jss/src/main/java/org/mozilla/jss/ssl/SocketProxy.java:15: warning: [deprecation] finalize() in NativeProxy has been deprecated protected void finalize() throws Throwable { ^ /home/ascheel/GitHub/cipherboy/jss/src/main/java/org/mozilla/jss/ssl/SocketProxy.java:16: warning: [deprecation] finalize() in NativeProxy has been deprecated super.finalize(); ^ /home/ascheel/GitHub/cipherboy/jss/src/main/java/org/mozilla/jss/nss/BufferProxy.java:18: warning: [deprecation] finalize() in NativeProxy has been deprecated protected void finalize() throws Throwable { ^ /home/ascheel/GitHub/cipherboy/jss/src/main/java/org/mozilla/jss/nss/BufferProxy.java:19: warning: [deprecation] finalize() in NativeProxy has been deprecated super.finalize(); ^ /home/ascheel/GitHub/cipherboy/jss/src/main/java/org/mozilla/jss/pkcs11/CipherContextProxy.java:16: warning: [deprecation] finalize() in NativeProxy has been deprecated protected void finalize() throws Throwable { ^ /home/ascheel/GitHub/cipherboy/jss/src/main/java/org/mozilla/jss/pkcs11/CipherContextProxy.java:17: warning: [deprecation] finalize() in NativeProxy has been deprecated super.finalize(); ^ /home/ascheel/GitHub/cipherboy/jss/src/main/java/org/mozilla/jss/provider/java/security/JSSSignatureSpi.java:168: warning: [deprecation] engineGetParameter(String) in SignatureSpi has been deprecated public Object engineGetParameter(String param) ^ /home/ascheel/GitHub/cipherboy/jss/src/main/java/org/mozilla/jss/provider/java/security/JSSSignatureSpi.java:175: warning: [deprecation] engineSetParameter(String,Object) in SignatureSpi has been deprecated public void engineSetParameter(String param, Object value) ^ /home/ascheel/GitHub/cipherboy/jss/src/main/java/org/mozilla/jss/provider/java/security/KeyFactorySpi1_2.java:54: warning: [deprecation] fromRaw(Type,byte[]) in PK11PubKey has been deprecated return PK11PubKey.fromRaw( PrivateKey.RSA, ASN1Util.encode(seq) ); ^ /home/ascheel/GitHub/cipherboy/jss/src/main/java/org/mozilla/jss/ssl/SSLClient.java:375: warning: [deprecation] SSL3_RSA_WITH_RC4_128_MD5 in SSLSocket has been deprecated SSLSocket.SSL3_RSA_WITH_RC4_128_MD5, ^ /home/ascheel/GitHub/cipherboy/jss/src/main/java/org/mozilla/jss/ssl/SSLClient.java:376: warning: [deprecation] SSL3_RSA_WITH_3DES_EDE_CBC_SHA in SSLSocket has been deprecated SSLSocket.SSL3_RSA_WITH_3DES_EDE_CBC_SHA, ^ /home/ascheel/GitHub/cipherboy/jss/src/main/java/org/mozilla/jss/ssl/SSLClient.java:377: warning: [deprecation] SSL3_RSA_WITH_DES_CBC_SHA in SSLSocket has been deprecated SSLSocket.SSL3_RSA_WITH_DES_CBC_SHA, ^ /home/ascheel/GitHub/cipherboy/jss/src/main/java/org/mozilla/jss/ssl/SSLClient.java:380: warning: [deprecation] SSL3_RSA_WITH_NULL_MD5 in SSLSocket has been deprecated SSLSocket.SSL3_RSA_WITH_NULL_MD5, ^ /home/ascheel/GitHub/cipherboy/jss/src/main/java/org/mozilla/jss/ssl/SSLServer.java:255: warning: [deprecation] SSL3_RSA_WITH_RC4_128_MD5 in SSLSocket has been deprecated SSLSocket.SSL3_RSA_WITH_RC4_128_MD5, ^ /home/ascheel/GitHub/cipherboy/jss/src/main/java/org/mozilla/jss/ssl/SSLServer.java:256: warning: [deprecation] SSL3_RSA_WITH_3DES_EDE_CBC_SHA in SSLSocket has been deprecated SSLSocket.SSL3_RSA_WITH_3DES_EDE_CBC_SHA, ^ /home/ascheel/GitHub/cipherboy/jss/src/main/java/org/mozilla/jss/ssl/SSLServer.java:257: warning: [deprecation] SSL3_RSA_WITH_DES_CBC_SHA in SSLSocket has been deprecated SSLSocket.SSL3_RSA_WITH_DES_CBC_SHA, ^ /home/ascheel/GitHub/cipherboy/jss/src/main/java/org/mozilla/jss/ssl/SSLServer.java:260: warning: [deprecation] SSL3_RSA_WITH_NULL_MD5 in SSLSocket has been deprecated SSLSocket.SSL3_RSA_WITH_NULL_MD5, ^
Therefore, the bulk of this has been solved so I'm marking it as fixed.
I've filed a related ticket here:
https://github.com/dogtagpki/jss/issues/638
Metadata Update from @cipherboy: - Issue close_status updated to: fixed - Issue status updated to: Closed (was: Open)