Removed registry state checks in ComponentState
The init()/destroy() methods are only called from the registry, which won't call them if it is in the failed state anyway.
This commit is contained in:
parent
5e433f940d
commit
da28d57f10
1 changed files with 2 additions and 10 deletions
|
@ -324,15 +324,10 @@ public final class ComponentState
|
|||
*
|
||||
* @throws ComponentInitialisationException
|
||||
* if an error occurs while executing an initialisation action
|
||||
* @throws IllegalStateException
|
||||
* if the registry has failed
|
||||
*/
|
||||
void init( )
|
||||
throws ComponentInitialisationException , IllegalStateException
|
||||
throws ComponentInitialisationException
|
||||
{
|
||||
if ( this.registry.hasFailed( ) ) {
|
||||
throw new IllegalStateException( "registry has failed" );
|
||||
}
|
||||
if ( this.initialised ) {
|
||||
return;
|
||||
}
|
||||
|
@ -358,14 +353,11 @@ public final class ComponentState
|
|||
* @throws ComponentDestructionException
|
||||
* if an error occurs while executing a destruction action
|
||||
* @throws IllegalStateException
|
||||
* if the registry has failed or if the component is active
|
||||
* if the component is active
|
||||
*/
|
||||
void destroy( )
|
||||
throws IllegalStateException , ComponentDestructionException
|
||||
{
|
||||
if ( this.registry.hasFailed( ) ) {
|
||||
throw new IllegalStateException( "registry has failed" );
|
||||
}
|
||||
if ( this.active ) {
|
||||
throw new IllegalStateException( "attempting to destroy active component" );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue