Skip to content

Commit

Permalink
odpi#5399 readd content helper change for pagesize 0
Browse files Browse the repository at this point in the history
Signed-off-by: David Radley <david_radley@uk.ibm.com>
  • Loading branch information
davidradl committed Jul 21, 2021
1 parent 3f3cc2e commit 189605a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7562,7 +7562,6 @@ public List<EntityDetail> getAttachedFilteredEntities(String userId,
PropertyServerException,
UserNotAuthorizedException
{
final String guidParameterName = "guid";

invalidParameterHandler.validateUserId(userId, methodName);
invalidParameterHandler.validateGUID(startingGUID, startingGUIDParameterName, methodName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2222,12 +2222,6 @@ public List<Relationship> formatRelationshipResults(List<Relationship> fullRe
return null;
}


if (pageSize == 0)
{
return fullResults;
}

int fullResultsSize = fullResults.size();

if (fromElement >= fullResultsSize)
Expand Down Expand Up @@ -2255,13 +2249,16 @@ public List<Relationship> formatRelationshipResults(List<Relationship> fullRe
}
}

if ((fromElement == 0) && (pageSize > fullResultsSize))
if ((fromElement == 0) && (pageSize == 0 || pageSize > fullResultsSize))
{
return fullResults;
}

int toIndex = getToIndex(fromElement, pageSize, fullResultsSize);

int toIndex = fullResultsSize;

if (pageSize != 0)
{
toIndex = getToIndex(fromElement, pageSize, fullResultsSize);
}
return new ArrayList<>(fullResults.subList(fromElement, toIndex));
}

Expand Down

0 comments on commit 189605a

Please sign in to comment.