Applied patch submitted by Clement Escoffier. (FELIX-81)


git-svn-id: https://svn.apache.org/repos/asf/incubator/felix/trunk@415344 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/org.apache.felix.ipojo/src/main/java/org/apache/felix/ipojo/ComponentManager.java b/org.apache.felix.ipojo/src/main/java/org/apache/felix/ipojo/ComponentManager.java
index 6d2eb6f..998d13b 100644
--- a/org.apache.felix.ipojo/src/main/java/org/apache/felix/ipojo/ComponentManager.java
+++ b/org.apache.felix.ipojo/src/main/java/org/apache/felix/ipojo/ComponentManager.java
@@ -195,7 +195,7 @@
 	public void stop() {
 		setState(INVALID);
 		// Stop all the handlers
-		for (int i = 0; i < m_handlers.length; i++) {
+		for (int i = m_handlers.length - 1; i > -1; i--) {
 			m_handlers[i].stop();
 		}
 		m_instances = new Object[0];
@@ -214,7 +214,7 @@
 
 			// The state changed call the handler stateChange method
 			m_state = state;
-			for (int i = 0; i < m_handlers.length; i++) {
+			for (int i = m_handlers.length - 1; i > -1; i--) {
 				m_handlers[i].stateChanged(state);
 			}
 		}
diff --git a/org.apache.felix.ipojo/src/main/java/org/apache/felix/ipojo/IPojoConfiguration.java b/org.apache.felix.ipojo/src/main/java/org/apache/felix/ipojo/IPojoConfiguration.java
index 13aaff3..782486f 100644
--- a/org.apache.felix.ipojo/src/main/java/org/apache/felix/ipojo/IPojoConfiguration.java
+++ b/org.apache.felix.ipojo/src/main/java/org/apache/felix/ipojo/IPojoConfiguration.java
@@ -43,8 +43,8 @@
 	public static final Class[] INTERNAL_HANDLERS = new Class[] {
 		DependencyHandler.class,
 		ProvidedServiceHandler.class,
-		LifecycleCallbackHandler.class,
 		ConfigurationHandler.class,
+		LifecycleCallbackHandler.class,
 		ArchitectureHandler.class
 	};