Code Review Request, JDK-8159009: Useless ExemptionMechanism.finalize() implementation

Xuelei Fan xuelei.fan at oracle.com
Sat Jul 9 15:47:18 UTC 2016


On 7/9/2016 10:43 PM, christos at zoulas.com wrote:
> On Jul 9, 10:22am, xuelei.fan at oracle.com (Xuelei Fan) wrote:
> -- Subject: Code Review Request, JDK-8159009: Useless ExemptionMechanism.fina
> 
> | Hi,
> | 
> | Please review this simple code cleanup:
> | 
> |    http://cr.openjdk.java.net/~xuelei/8159009/webrev.00/
> | 
> | The javax.crypto.ExemptionMechanism.finalize() is implemented as:
> | 
> |     /**
> |      * Ensures that the key stored away by this ExemptionMechanism
> |      * object will be wiped out when there are no more references to it.
> |      */
> |      protected void finalize() {
> |         keyStored = null;
> |         // Are there anything else we could do?
> |     }
> | 
> | Plan to remove this finalize() method as it really does nothing more
> | than the default finalizer but hurt the performance.
> 
> Ok fine, but can't we do better than saying "hurt the performance"
For the detailed description, please refer to Item 7, Effective Java.

Xuelei

> , by
> actually providing how we measured this and what is it actually saving?
> This does not look like a hot code path to me...
> 
> christos
> 




More information about the security-dev mailing list