You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Carsten Ziegeler (JIRA)" <ji...@apache.org> on 2014/01/15 19:59:20 UTC

[jira] [Created] (FELIX-4388) Initial start level not considered when bundle.start() is called

Carsten Ziegeler created FELIX-4388:
---------------------------------------

             Summary: Initial start level not considered when bundle.start() is called
                 Key: FELIX-4388
                 URL: https://issues.apache.org/jira/browse/FELIX-4388
             Project: Felix
          Issue Type: Bug
          Components: Framework
    Affects Versions: framework-4.2.0
            Reporter: Carsten Ziegeler
             Fix For: framework-4.4.0


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)
         {




--
This message was sent by Atlassian JIRA
(v6.1.5#6160)