A bug slipped into the framework shutdown process during the refactoring
of the code. A "synchronized (this)" was put into an inner class, but
not converted to "synchronized (Felix.this)" which was causing threads
calling Felix.stopAndWait() to not get notified that the framework had
shutdown.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@558798 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/framework/src/main/java/org/apache/felix/framework/Felix.java b/framework/src/main/java/org/apache/felix/framework/Felix.java
index 8ca1113..b3d6393 100644
--- a/framework/src/main/java/org/apache/felix/framework/Felix.java
+++ b/framework/src/main/java/org/apache/felix/framework/Felix.java
@@ -1904,9 +1904,9 @@
try
{
- if (bundle.getInfo().getActivator() != null)
+ if (info.getActivator() != null)
{
- m_secureAction.stopActivator(info.getActivator(),info.getBundleContext());
+ m_secureAction.stopActivator(info.getActivator(), info.getBundleContext());
}
// Try to save the activator in the cache.
@@ -3816,7 +3816,7 @@
{
// First, start the framework shutdown, which will
// stop all bundles.
- synchronized (this)
+ synchronized (Felix.this)
{
// Change framework state from active to stopping.
// If framework is not active, then just return.
@@ -3946,10 +3946,10 @@
}
// Notify any waiters that the framework is back in its initial state.
- synchronized (this)
+ synchronized (Felix.this)
{
m_systemBundleInfo.setState(Bundle.UNINSTALLED);
- notifyAll();
+ Felix.this.notifyAll();
}
// Finally shutdown the JVM if the framework is running stand-alone.