TAMULib / DSpace

(Official) The DSpace digital asset management system that powers your Institutional Repository
https://wiki.duraspace.org/display/DSDOC4x/Introduction
BSD 3-Clause "New" or "Revised" License
5 stars 0 forks source link

[Issue 203] Check bundle bitstreams has entry before getting and other fixes #228

Closed wwelling closed 6 months ago

wwelling commented 6 months ago

Branched from 223-bitstream-content-type as dspace-7_x-sprint4 and dspace-7_x-sprint4-staging are currently not deployable. Please review and merge #224 before this PR.

Resolves below stack trace.

It appears the backing collection implementation of the bundle's bitstreams may have changed. The get method now throws out of bounds exception as opposed to returning null.

java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
    at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
    at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
    at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266)
    at java.base/java.util.Objects.checkIndex(Objects.java:361)
    at java.base/java.util.ArrayList.get(ArrayList.java:427)
    at org.dspace.discovery.SolrServiceImpl.addCommunityCollectionItem(SolrServiceImpl.java:269)
    at org.dspace.discovery.SolrServiceImpl.update(SolrServiceImpl.java:181)
    at org.dspace.discovery.SolrServiceImpl.indexContent(SolrServiceImpl.java:169)
    at org.dspace.discovery.SolrServiceImpl.updateIndex(SolrServiceImpl.java:487)
    at org.dspace.discovery.SolrServiceImpl.updateIndex(SolrServiceImpl.java:474)
    at org.dspace.discovery.IndexClient.internalRun(IndexClient.java:136)
    at org.dspace.scripts.DSpaceRunnable.run(DSpaceRunnable.java:150)
    at org.dspace.app.launcher.ScriptLauncher.executeScript(ScriptLauncher.java:154)
    at org.dspace.app.launcher.ScriptLauncher.handleScript(ScriptLauncher.java:132)
    at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:99)