-
Enhancement
-
Resolution: Won't Fix
-
P4
-
None
-
11, 13
A DESCRIPTION OF THE PROBLEM :
The default implementation of javax.security.auth.Destroyable implements
- isDestroyed() to return false
- destroy() to throw an exception
This is a very awkward combination because it prevents writing code which handles Destroyables in general. The user whould need to know what kind of Destroyable they are dealing with before trying to destroy it.
For example when using the following:
if (!destroyable.isDestroyed()) {
destroyable.destroy();
}
When an DestroyFailedException is thrown the reason could be that the class does not override the Destroyable methods. In this case there is nothing the caller can do to handle this correctly. They have to treat it as destruction failure even though it isn't one.
The default implementation of javax.security.auth.Destroyable implements
- isDestroyed() to return false
- destroy() to throw an exception
This is a very awkward combination because it prevents writing code which handles Destroyables in general. The user whould need to know what kind of Destroyable they are dealing with before trying to destroy it.
For example when using the following:
if (!destroyable.isDestroyed()) {
destroyable.destroy();
}
When an DestroyFailedException is thrown the reason could be that the class does not override the Destroyable methods. In this case there is nothing the caller can do to handle this correctly. They have to treat it as destruction failure even though it isn't one.
- relates to
-
JDK-6263419 No way to clean the memory for a java.security.Key
-
- Closed
-