[ 
https://issues.apache.org/jira/browse/SLING-5914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15399273#comment-15399273
 ] 

Bertrand Delacretaz commented on SLING-5914:
--------------------------------------------

We are indeed using the {{ConfigurationHandler}} in other places, but if that's 
for serializing things as opposed to humans writing configs that's probably ok 
(and the lossless "store long bits" format then makes sense).

{code}
$ cd sling-source
$ find . -name *.java | xargs grep -l 
org.apache.felix.cm.file.ConfigurationHandler
./installer/core/src/main/java/org/apache/sling/installer/core/impl/InternalResource.java
./installer/providers/file/src/main/java/org/apache/sling/installer/provider/file/impl/FileInstaller.java
./installer/providers/jcr/src/main/java/org/apache/sling/installer/provider/jcr/impl/JcrInstaller.java
./tooling/maven/slingstart-maven-plugin/src/main/java/org/apache/sling/maven/slingstart/PreparePackageMojo.java
./tooling/support/provisioning-model/src/main/java/org/apache/sling/provisioning/model/io/ModelWriter.java
./tooling/support/provisioning-model/src/main/java/org/apache/sling/provisioning/model/ModelResolveUtility.java
{code}

> Provisioning model does not correctly handle floating-point configuration 
> values
> --------------------------------------------------------------------------------
>
>                 Key: SLING-5914
>                 URL: https://issues.apache.org/jira/browse/SLING-5914
>             Project: Sling
>          Issue Type: Bug
>          Components: Tooling
>            Reporter: Robert Munteanu
>             Fix For: Sling Provisioning Model 1.4.6
>
>
> The provisioning model specifies that floating-point values are encoded in 
> the following format:
> - {{D"1.0"}} for doubles
> - {{F"1.0"}} for floats
> However, the ConfigAdmin has a different idea about how these values should 
> be stored:
> {code:java}
>             case TOKEN_SIMPLE_FLOAT:
>             case TOKEN_PRIMITIVE_FLOAT:
>                 int fBits = Integer.parseInt( readQuoted( pr ) );
>                 return new Float( Float.intBitsToFloat( fBits ) );
>             case TOKEN_SIMPLE_DOUBLE:
>             case TOKEN_PRIMITIVE_DOUBLE:
>                 long dBits = Long.parseLong( readQuoted( pr ) );
>                 return new Double( Double.longBitsToDouble( dBits ) );
> {code}
> I assume that this is done to preserve precision when reading/writing values.
> The provisioning model should be updated to mediate between the user-supplied 
> values and the configuration admin format.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to