mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Correct handling of nulls and empty strings for PropertyBackedBeans (actually save empty strings)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@14354 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -342,10 +342,6 @@ public class ChildApplicationContextFactory extends AbstractPropertyBackedBean i
|
|||||||
{
|
{
|
||||||
updateCompositeProperty(name, value, type);
|
updateCompositeProperty(name, value, type);
|
||||||
}
|
}
|
||||||
else if (value == null)
|
|
||||||
{
|
|
||||||
this.properties.remove(name);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.properties.setProperty(name, value);
|
this.properties.setProperty(name, value);
|
||||||
@@ -370,18 +366,12 @@ public class ChildApplicationContextFactory extends AbstractPropertyBackedBean i
|
|||||||
Map<String, CompositeDataBean> propertyValues = this.compositeProperties.get(name);
|
Map<String, CompositeDataBean> propertyValues = this.compositeProperties.get(name);
|
||||||
if (propertyValues == null)
|
if (propertyValues == null)
|
||||||
{
|
{
|
||||||
if (value == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
propertyValues = Collections.emptyMap();
|
propertyValues = Collections.emptyMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Map<String, CompositeDataBean> newPropertyValues = new LinkedHashMap<String, CompositeDataBean>(11);
|
Map<String, CompositeDataBean> newPropertyValues = new LinkedHashMap<String, CompositeDataBean>(11);
|
||||||
if (value != null)
|
|
||||||
{
|
|
||||||
StringTokenizer tkn = new StringTokenizer(value, ", \t\n\r\f");
|
StringTokenizer tkn = new StringTokenizer(value, ", \t\n\r\f");
|
||||||
while (tkn.hasMoreTokens())
|
while (tkn.hasMoreTokens())
|
||||||
{
|
{
|
||||||
@@ -403,7 +393,6 @@ public class ChildApplicationContextFactory extends AbstractPropertyBackedBean i
|
|||||||
}
|
}
|
||||||
newPropertyValues.put(id, child);
|
newPropertyValues.put(id, child);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Destroy any children that have been removed
|
// Destroy any children that have been removed
|
||||||
Set<String> idsToRemove = new TreeSet<String>(propertyValues.keySet());
|
Set<String> idsToRemove = new TreeSet<String>(propertyValues.keySet());
|
||||||
|
Reference in New Issue
Block a user