Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-4388

Initial start level not considered when bundle.start() is called

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • framework-4.2.0
    • framework-4.4.0
    • Framework
    • 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)
        {

      Attachments

        Activity

          People

            cziegeler Carsten Ziegeler
            cziegeler Carsten Ziegeler
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: