Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

Check for review breaks on review-requests with too many updated diffs #35

Open
lucas-noyau-itdev opened this issue Dec 13, 2018 · 0 comments

Comments

@lucas-noyau-itdev
Copy link

When running check for reviews on a review-request that has had its diff updated 25 or more times, the result is:

java.lang.IndexOutOfBoundsException: Index: 25, Size: 25
	at java.util.ArrayList.rangeCheck(ArrayList.java:657)
	at java.util.ArrayList.get(ArrayList.java:433)
	[...]

The problem could be the default max-results of the reviewboard api. Check for reviews uses [reviewboard-URL]/api/review-requests/[review-request-id]/diffs/, which returns an XML with <total_results>26</total_results>, but only 25 items in <diffs><array>[...]</diffs></array>. So when Java tries to get the last item by using the index total_results-1, it breaks.

Might be fixable by using [reviewboard-URL]/api/review-requests/[review-request-id]/diffs/?max-results=200

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant