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

Heiko Studt commented on FELIX-6174:
------------------------------------

I had the same problem (while not knowing it) and have searched for days:

key2=val is not a typed value
key2="val" (having quotation marks) will work.

If there is only *one* line which was not typed, *all* lines are interpreted as 
simple strings, so that arrays are not interpreted anymore (see also FELIX-5608 
for the arguments in favor).

This is a major pain, because I have tried for the correct array syntax and 
temporarily added other properties to hold some of my mistakes. This has in 
turn destroyed any hope of getting an array as the temp properties were 
interpreted as 'untyped'. For an user without detailed spec knowledge, this is 
never an expected behavior.

So, why did I modify the files directly?
 # our current configuration environment does not understand arrays currently
 # it is far easier to modify the files and they seem to be straight-forward
 # However, I did not find the syntax of the (typed) configuration files 
anywhere near Google.

Being even more confusing, the (typed) parsing code is copied between 
org.felix.util and org.felix.cm and yet another parser exists for non-typed 
properties inside org.felix.utils (seen in the debugger).

I suggest to put some runtime configuration somewhere of whether all 
configurations need to be typed and which breaks (i.e. error log) if the types 
were not recognized using a readable error message, especially if one would try 
to read it typed while it was not.

 

> org.apache.felix.utils.properties.TypedProperties does not parse arrays 
> correctly
> ---------------------------------------------------------------------------------
>
>                 Key: FELIX-6174
>                 URL: https://issues.apache.org/jira/browse/FELIX-6174
>             Project: Felix
>          Issue Type: Bug
>          Components: Utils
>    Affects Versions: utils-1.10.4
>         Environment: Windows 7 / tested with 
> org.apache.felix.org.apache.felix.utils_1.11.2.jar
>            Reporter: Mike Rumpf
>            Assignee: Jean-Baptiste Onofré
>            Priority: Critical
>             Fix For: utils-1.11.10
>
>         Attachments: TypedPropertiesTest.java
>
>
> org.apache.felix.utils.properties.TypedProperties does not parse arrays in 
> OSGi configurations correctly.
> While a single line config with
> key=["val1","val2"] works fine
> just adding a standard key value pair
> key2=val2
> has the consequence that the value for "key" is not parsed as an array 
> anymore.
> (see attached JUnit test to demonstrate the problem)
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to