mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Fix NPE seen in the logs for bug https://issues.alfresco.com/jira/browse/ALF-10934
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@31373 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -461,6 +461,26 @@ public class SOLRTrackingComponentImpl implements SOLRTrackingComponent
|
|||||||
return nodeIds;
|
return nodeIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected Map<QName, Serializable> getProperties(Long nodeId)
|
||||||
|
{
|
||||||
|
Map<QName, Serializable> props = null;
|
||||||
|
|
||||||
|
// ALF-10641
|
||||||
|
// Residual properties are un-indexed -> break serlialisation
|
||||||
|
Map<QName, Serializable> sourceProps = nodeDAO.getNodeProperties(nodeId);
|
||||||
|
props = new HashMap<QName, Serializable>((int)(sourceProps.size() * 1.3));
|
||||||
|
for(QName propertyQName : sourceProps.keySet())
|
||||||
|
{
|
||||||
|
PropertyDefinition propDef = dictionaryService.getProperty(propertyQName);
|
||||||
|
if(propDef != null)
|
||||||
|
{
|
||||||
|
props.put(propertyQName, sourceProps.get(propertyQName));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return props;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@@ -518,18 +538,7 @@ public class SOLRTrackingComponentImpl implements SOLRTrackingComponent
|
|||||||
|
|
||||||
if(includeProperties)
|
if(includeProperties)
|
||||||
{
|
{
|
||||||
// ALF-10641
|
props = getProperties(nodeId);
|
||||||
// Residual properties are un-indexed -> break serlialisation
|
|
||||||
Map<QName, Serializable> sourceProps = nodeDAO.getNodeProperties(nodeId);
|
|
||||||
props = new HashMap<QName, Serializable>((int)(sourceProps.size() * 1.3));
|
|
||||||
for(QName propertyQName : sourceProps.keySet())
|
|
||||||
{
|
|
||||||
PropertyDefinition propDef = dictionaryService.getProperty(propertyQName);
|
|
||||||
if(propDef != null)
|
|
||||||
{
|
|
||||||
props.put(propertyQName, sourceProps.get(propertyQName));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
nodeMetaData.setProperties(props);
|
nodeMetaData.setProperties(props);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -537,7 +546,6 @@ public class SOLRTrackingComponentImpl implements SOLRTrackingComponent
|
|||||||
nodeMetaData.setProperties(Collections.<QName, Serializable>emptyMap());
|
nodeMetaData.setProperties(Collections.<QName, Serializable>emptyMap());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(includeAspects)
|
if(includeAspects)
|
||||||
{
|
{
|
||||||
aspects = nodeDAO.getNodeAspects(nodeId);
|
aspects = nodeDAO.getNodeAspects(nodeId);
|
||||||
@@ -546,6 +554,10 @@ public class SOLRTrackingComponentImpl implements SOLRTrackingComponent
|
|||||||
|
|
||||||
if(includePaths)
|
if(includePaths)
|
||||||
{
|
{
|
||||||
|
if(props == null)
|
||||||
|
{
|
||||||
|
props = getProperties(nodeId);
|
||||||
|
}
|
||||||
Collection<Pair<Path, QName>> categoryPaths = getCategoryPaths(pair.getSecond(), aspects, props);
|
Collection<Pair<Path, QName>> categoryPaths = getCategoryPaths(pair.getSecond(), aspects, props);
|
||||||
List<Path> directPaths = nodeDAO.getPaths(pair, false);
|
List<Path> directPaths = nodeDAO.getPaths(pair, false);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user