felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ziegeler (JIRA)" <j...@apache.org>
Subject [jira] Updated: (FELIX-411) Preferences service throws ClassCastException
Date Mon, 22 Jun 2009 15:40:07 GMT

     [ https://issues.apache.org/jira/browse/FELIX-411?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Carsten Ziegeler updated FELIX-411:
-----------------------------------

    Fix Version/s: prefs-1.0.2

> Preferences service throws ClassCastException
> ---------------------------------------------
>
>                 Key: FELIX-411
>                 URL: https://issues.apache.org/jira/browse/FELIX-411
>             Project: Felix
>          Issue Type: Bug
>          Components: Preferences Service
>            Reporter: Angelo van der Sijpt
>            Assignee: Carsten Ziegeler
>             Fix For: prefs-1.0.2
>
>
> The preferences admin throws a ClassCastException when writing its cache. The exception
is
> java.lang.ClassCastException: [Lorg.apache.felix.prefs.PreferencesImpl; cannot be cast
to org.apache.felix.prefs.PreferencesImpl
>         at org.apache.felix.prefs.impl.PreferencesManager.save(PreferencesManager.java:179)
>         ...
> This seems to have to do with the implementation of PreferencesImpl: in its constructor,
all preferences are loaded. The system preferences are stored,
> 61    this.systemTree = prefs[i];
> but the user preferences are stored incorrectly:
> 63    this.trees.put(prefs[i].getDescription().getIdentifier(), prefs);
> The full array of prefs is stored, not just prefs[i]; this causes the classcastexception.
> A possible fix could be
> 63    this.trees.put(prefs[i].getDescription().getIdentifier(), prefs[i]);

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


Mime
View raw message