You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Guillaume Nodet (JIRA)" <ji...@apache.org> on 2017/09/08 09:25:00 UTC

[jira] [Comment Edited] (FELIX-5306) User friendly syntax for floats and doubles in FileInstall

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

Guillaume Nodet edited comment on FELIX-5306 at 9/8/17 9:24 AM:
----------------------------------------------------------------

The previous syntax will be kept for compatibility.
However, if the quoted string contains a dot character ('.'), it will be interpreted as a user-friendly representation of the float / double.


was (Author: gnt):
I'd be willing to fix the problem and use a more user friendly format, however, I'm not sure how to do that in a compatible way...

> User friendly syntax for floats and doubles in FileInstall
> ----------------------------------------------------------
>
>                 Key: FELIX-5306
>                 URL: https://issues.apache.org/jira/browse/FELIX-5306
>             Project: Felix
>          Issue Type: Bug
>          Components: File Install
>            Reporter: munene kiruja
>            Assignee: Guillaume Nodet
>             Fix For: fileinstall-3.6.2, utils-1.10.2
>
>
> The format for specifying a float in the .config format is <key>=F"<float value> and similarly for doubles but with the type character D.
> When the floats and doubles are encountered in the config, java.lang.NumberFormatException is thrown with the message like:
> {code}
> java.lang.NumberFormatException: For input string: "400.333"
> 	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
> 	at java.lang.Integer.parseInt(Integer.java:580)
> 	at java.lang.Integer.parseInt(Integer.java:615)
> {code} 
> The code is actually parsing using Integer and Long classes!! 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)