You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2016/07/10 20:04:11 UTC
[jira] [Commented] (KARAF-4259) Cellar should deal with
configuration type
[ https://issues.apache.org/jira/browse/KARAF-4259?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15369927#comment-15369927 ]
ASF subversion and git services commented on KARAF-4259:
--------------------------------------------------------
Commit 130525c551ce345ad192cb9d8bbb5487733c368c in karaf-cellar's branch refs/heads/master from [~jbonofre]
[ https://git-wip-us.apache.org/repos/asf?p=karaf-cellar.git;h=130525c ]
[KARAF-4259] Fix potential cast issue when copy a group configuration
> Cellar should deal with configuration type
> ------------------------------------------
>
> Key: KARAF-4259
> URL: https://issues.apache.org/jira/browse/KARAF-4259
> Project: Karaf
> Issue Type: Bug
> Components: cellar-config
> Affects Versions: cellar-4.0.0
> Reporter: Jean-Baptiste Onofré
> Assignee: Jean-Baptiste Onofré
> Fix For: cellar-4.0.1
>
>
> When Cellar sync configuration, it assumes that all properties are String. So, if an user stores another type (let say a Long), it results to a ClassCastException:
> {code}
> java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.String
> at org.apache.karaf.cellar.hazelcast.HazelcastGroupManager.copyGroupConfiguration(HazelcastGroupManager.java:532)[174:org.apache.karaf.cellar.hazelcast:4.0.0]
> {code}
> Cellar should use instanceof on configuration to "detect" the type instead of casting to String:
> {code}
> Dictionary updatedProperties = new Properties();
> Enumeration keyEnumeration = configAdminProperties.keys();
> while (keyEnumeration.hasMoreElements()) {
> String key = (String) keyEnumeration.nextElement();
> String value = (String) configAdminProperties.get(key);
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)