From da28d57f10e884c321816de17bae3276ed41dcc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Thu, 17 Sep 2015 22:17:39 +0200 Subject: [PATCH] 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. --- .../java/info/ebenoit/ebul/cmp/ComponentState.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/main/java/info/ebenoit/ebul/cmp/ComponentState.java b/src/main/java/info/ebenoit/ebul/cmp/ComponentState.java index f2d9104..1689b91 100644 --- a/src/main/java/info/ebenoit/ebul/cmp/ComponentState.java +++ b/src/main/java/info/ebenoit/ebul/cmp/ComponentState.java @@ -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" ); }