karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Baptiste Onofré (JIRA) <j...@apache.org>
Subject [jira] [Created] (KARAF-4259) Cellar should deal with configuration type
Date Mon, 11 Jan 2016 10:13:39 GMT
Jean-Baptiste Onofré created KARAF-4259:

             Summary: 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:

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]

Cellar should use instanceof on configuration to "detect" the type instead of casting to String:

Dictionary updatedProperties = new Properties();
                Enumeration keyEnumeration = configAdminProperties.keys();
                while (keyEnumeration.hasMoreElements()) {
                    String key = (String) keyEnumeration.nextElement();
                    String value = (String) configAdminProperties.get(key);

This message was sent by Atlassian JIRA

View raw message