I'm experiencing a problem while reading an ini file.
My class is mapping ini section values to comfortable values such as Integer, InetAddress and so on, when I retrieve a value as a String I get a ConversionException. This is tha stack trace:


My code act as:
DataConfiguration db = new DataConfiguration(getConfig().getSection(sectionName));
where getConfig returns a HierarchicalINIConfiguration object

            Object value =  db.get(keyType, keyName));

where keyType is a Class<?> object and keyName is a String object

When keyType is java.lang.String I have the problem.
Inside PropertyConverter.to(Class<?> cls, Object value, Object[] params) there is a long if/else that if argument cls is java.langString doesn't match any condition and throws a ConversionException.

Is this figure correct?

Maybe at the very beginning of the to method should be:

if (cls == value.getClass()) return value;
Thank you for the attention

Ugo Gagliardelli

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to