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 2009/01/27 19:52:59 UTC

[jira] Commented: (FELIX-902) Empty bundle.state file produces NPE

    [ https://issues.apache.org/jira/browse/FELIX-902?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12667753#action_12667753 ] 

Richard S. Hall commented on FELIX-902:
---------------------------------------

Thanks for the feedback.

Regarding your first issue, I added a null check to make sure we will default to INSTALLED.

As for the second issue in setPersistentState(), I do not understand what you are saying. The method is quite simple, it opens a file, writes a value, then closes the file. What is the bug? It defaults to INSTALLED and seems there could only be an issue if it had difficulty writing to the disk. If that is the case, there isn't much we can do. Am I missing something?

> Empty bundle.state file produces NPE
> ------------------------------------
>
>                 Key: FELIX-902
>                 URL: https://issues.apache.org/jira/browse/FELIX-902
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: felix-1.0.4
>            Reporter: Pavel Tiunov
>            Priority: Critical
>
> If I have empty bundle.state file in Felix cache then exception is thrown while bundle start:
> java.lang.NullPointerException
>             at org.apache.felix.framework.cache.BundleArchive.getPersistentState(BundleArchive.java:315)
>             at org.apache.felix.framework.Felix.start(Felix.java:776)
> But if i delete bundle.state then no exception is thrown and org.apache.felix.framework.cache.BundleArchive#getPersistentState returns 'Installed' state.
> The exception is thrown because string comparsions in org.apache.felix.framework.cache.BundleArchive#getPersistentState do not respect java.io.BufferedReader#readLine's null return value if file is empty. Also there is a bug in org.apache.felix.framework.cache.BundleArchive#setPersistentState that can produce not persistent state of cache by creation of empty bundle.state file.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.