Commits

Chris Doble  committed 91a1ec3

Fix pagination bug, improve no results message.

  • Participants
  • Parent commits dc53f9f

Comments (0)

Files changed (2)

File src/main/java/com/atlassian/bamboo/plugins/failureleaderboard/ViewFailureLeaderboard.java

 
     @Override
     public List<TestCaseFailures> getFilteredResultsList(int firstResult, int maxResults) {
-        int toIndex = Math.min(getLeadingTestCaseFailures().size(), firstResult + maxResults);
-        return getLeadingTestCaseFailures().subList(firstResult, toIndex);
+        List<TestCaseFailures> leadingTestCaseFailures = getLeadingTestCaseFailures();
+        int from = Math.min(leadingTestCaseFailures.size(), firstResult);
+        int to = Math.min(leadingTestCaseFailures.size(), firstResult + maxResults);
+        return leadingTestCaseFailures.subList(from, to);
     }
 
     @Override

File src/main/resources/templates/viewFailureLeaderboard.ftl

                 [/#if]
             </table>
         [#else]
-            <p>No builds have been run.</p>
+            <p>There are no builds, no tests, or no failures!</p>
         [/#if]
     </div>