Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexOutOfBoundsException in legacy webapp region search #2451

Open
aturling opened this issue Mar 16, 2023 · 0 comments
Open

IndexOutOfBoundsException in legacy webapp region search #2451

aturling opened this issue Mar 16, 2023 · 0 comments

Comments

@aturling
Copy link

The legacy (non-BlueGenes) webapp produces an IndexOutOfBoundsException error when the number of regions searched for is exactly one less than the number of items displayed per page.

Steps to reproduce:

  1. Navigate to the region search page, for example: https://legacy.humanmine.org/humanmine/genomicRegionSearchAction.do
  2. Select Organism and Feature type(s)
  3. Enter exactly 9 regions, for example:
2:10000001..11000000
2:11000001..12000000
2:12000001..13000000
2:13000001..14000000
2:14000001..15000000
2:15000001..16000000
2:16000001..17000000
2:17000001..18000000
2:18000001..19000000
  1. Click Search - note that the results table does not appear
  2. Change page size from 10 to 25 - note that the results table now appears
  3. Change page size back to 10 - should now get an internal error

You can get the same error by repeating the above steps with 24 regions and changing the page size to 25, etc.

The error in the log is:

ERROR org.intermine.web.struts.InterMineExceptionHandler  [] - java.lang.IndexOutOfBoundsException: toIndex = 10
        at java.util.ArrayList.subListRangeCheck(ArrayList.java:1014)
        at java.util.ArrayList.subList(ArrayList.java:1006)
        at org.intermine.bio.web.logic.GenomicRegionSearchService.convertResultMapToHTML(GenomicRegionSearchService.java:1385)
        at org.intermine.bio.web.struts.GenomicRegionSearchAjaxAction.getData(GenomicRegionSearchAjaxAction.java:234)

I believe the issue is with the strict inequality in genomic_region_search_results_default.js, here: https://github.com/intermine/intermine/blob/dev/bio/webapp/src/main/webapp/model/genomic_region_search/genomic_region_search_results_default.js#L152

Changing ">" to ">=" in line 152 seems to fix this.

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

No branches or pull requests

1 participant