You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Richard S. Hall (JIRA)" <ji...@apache.org> on 2014/01/15 20:17:20 UTC
[jira] [Commented] (FELIX-4388) Initial start level not considered
when bundle.start() is called
[ https://issues.apache.org/jira/browse/FELIX-4388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13872453#comment-13872453 ]
Richard S. Hall commented on FELIX-4388:
----------------------------------------
Yes, I think you are correct. This code used to be correct back in the day were we had separate files in the bundle cache for a saved start level. In that case, if the bundle didn't have a set start level, then it would get an exception when it tried to open the file. A while ago we switched to a single file for all bundle persisted information which breaks the existing logic.
> 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
> Priority: Minor
> 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)