<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=jcsahnwaldt" rel="nofollow">Christopher Sahnwaldt</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-2815?redirect=false" rel="nofollow">SPR-2815</a></strong> and commented</p>
<p dir="auto">I have a property named arrays of type List&lt;String[]&gt;</p>
<p dir="auto">public void setArrays( List&lt;String[]&gt; arrays )</p>
<p dir="auto">I try to set it like this:</p>
<p dir="auto">&lt;property name="arrays"&gt;<br>
&lt;list value-type="java.lang.String[]"&gt;<br>
&lt;list&gt;<br>
&lt;value&gt;value1&lt;/value&gt;<br>
&lt;value&gt;value1&lt;/value&gt;<br>
&lt;/list&gt;<br>
&lt;/list&gt;<br>
&lt;/property&gt;</p>
<p dir="auto">But at runtime I get a List that contains a List, not a List that contains a String array. I added the value-type="java.lang.String[]" attribute, but it didn't change anything.</p>
<p dir="auto">I would expect this work since I can set a property of type String[]</p>
<p dir="auto">public void setArray( String[] array )</p>
<p dir="auto">like this:</p>
<p dir="auto">&lt;property name="array"&gt;<br>
&lt;list&gt;<br>
&lt;value&gt;value1&lt;/value&gt;<br>
&lt;value&gt;value1&lt;/value&gt;<br>
&lt;/list&gt;<br>
&lt;/property&gt;<br>
This is similar to (or even a duplicate of?) <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398070090" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/7198" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/7198/hovercard" href="https://github.com/spring-projects/spring-framework/issues/7198">#7198</a> and <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398072571" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/7494" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/7494/hovercard" href="https://github.com/spring-projects/spring-framework/issues/7494">#7494</a>.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.0 final</p>
<p dir="auto"><strong>Attachments:</strong></p>
<ul dir="auto">
<li><a href="https://jira.spring.io/secure/attachment/12195/generic.beans" rel="nofollow">generic.beans</a> (<em>657 bytes</em>)</li>
<li><a href="https://jira.spring.io/secure/attachment/12196/Generic.java" rel="nofollow">Generic.java</a> (<em>1.02 kB</em>)</li>
</ul>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=oliverhutchison" rel="nofollow">Oliver Hutchison</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-1307?redirect=false" rel="nofollow">SPR-1307</a></strong> and commented</p>
<p dir="auto">In CachingMapDecorator  the field targetMap is synchronized through the call to Collections.synchronizedMap(internalMap) in the constructor,  which would indicate to me that CachingMapDecorator is intended to be thread safe, however there is no synchronization on the method get which could result in duplicate calls to the create method for a given key.</p>
<p dir="auto">So should the class a) be documented as being thread safe and have the get method synchronized as well or b) be documented as not thread safe and have the call to Collections.synchronizedMap(internalMap) removed from the constructor?</p>
<p dir="auto">My guess is that a) would be the better option given that some people may already be using this class and assuming it is thread safe.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 1.2.4</p>