I searched the archives (the best I could) but was unable to locate a
solution to this problem.

I am using commons configuration 1.3

I am seeing duplicate entries using the getStringArray method with an
XMLConfiguration.

Here is an example configuration file:

<?xml version="1.0" encoding="UTF-8" ?>
<CollectiveVerificationTool>
  <Topic>test</Topic>

  <Publication>
     <Username>user</Username>
     <Password>usertest</Password>
  </Publication>

  <Hosts>
     <Subscribers>node1</Subscribers>
     <Publishers>node3</Publishers>
  </Hosts>


</CollectiveVerificationTool>


Here is a code snippet that experiences the problem.


String single = configuration.getString( key );

System.out.println(single);

String value[] = configuration.getStringArray( key );

System.out.println("Size of Array: " + value.length);

System.out.println(Arrays.asList(value));


Here is the output of that snippet:

node1
Size of Array: 2
[node1, node1]


I would expect the size of the array to be 1 and the only item to be a
single entry of node1.

Any pointers are appreciated.

Thanks!

Reply via email to