Merged 5.2.N (5.2.2) to HEAD (5.2)

137084 gjames: Merged searchrep (5.2.1) to 5.2.N (5.2.1)
      136999 gjames: SEARCH-451: Better handling of invalid pivot params


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@137599 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Andrei Rebegea
2017-06-15 11:19:03 +00:00
parent fd3c984b34
commit af6f2c868f
2 changed files with 26 additions and 7 deletions

View File

@@ -624,6 +624,11 @@ public class SearchMapper
if (foundStat.isPresent())
{
pivotKey = aPivot.getKey();
if (pivotKeys.isEmpty())
{
throw new InvalidArgumentException(InvalidArgumentException.DEFAULT_MESSAGE_ID,
new Object[] { ": Stats key " + pivotKey + " cannot be used here" });
}
pivotKeys.add(pivotKey);
searchRequestContext.getPivotKeys().put(pivotKey, pivotKey);
}
@@ -636,6 +641,11 @@ public class SearchMapper
if (aRange.getTags().contains(aPivot.getKey()))
{
pivotKey = aPivot.getKey();
if (pivotKeys.isEmpty())
{
throw new InvalidArgumentException(InvalidArgumentException.DEFAULT_MESSAGE_ID,
new Object[] { ": Range key " + pivotKey + " cannot be used here" });
}
pivotKeys.add(pivotKey);
searchRequestContext.getPivotKeys().put(pivotKey, pivotKey);
}