Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
framework-4.2.0
-
None
Description
If a start level service is available, and the initial start level is set to a higher level than the current one, a call to bundle.start() of a bundle which has no start level defined, results in the bundle being immediately started.
However, according to the spec it should only be started when the initial start level is reached.
I think this is a bug in BundleImpl as it is returning -1 if no start level is set for the bundle instead of the default level. This patch should fix this:
Index: src/main/java/org/apache/felix/framework/BundleImpl.java
===================================================================
— src/main/java/org/apache/felix/framework/BundleImpl.java (Revision 1558397)
+++ src/main/java/org/apache/felix/framework/BundleImpl.java (Arbeitskopie)
@@ -861,7 +861,12 @@
{
try
{
- return m_archive.getStartLevel();
+ int level = m_archive.getStartLevel();
+ if ( level == -1 )
+ { + level = defaultLevel; + }+ return level;
}
catch (Exception ex)
{