Skip to content

Seaching for bibliographies and importing them triggers uncaught java.lang.IndexOutOfBoundsException #7606

@sauliusg

Description

@sauliusg

JabRef version 5.2, 5.3, commit badffe9 in 'master' on LinuxMint-19.3, Linuxmint-20.1 -->

When search for literature (say in ArXiv) and the importing entries, an uncaught exception is triggered. This behaviour is not always present, but can be reproduced after searching and importing several times in the same session.

Steps to reproduce the behavior:

  1. Start a JabRef session without any databases;
  2. Create a new database;
  3. Save it under some name (e.g. 'test.bib'); this is essential, otherwise different exception is triggered;
  4. Open Groups interface (not clear if this is important, but I had it open during tests; also they are open in screens at Uncaught exception when searching in dark mode #7343)
  5. Open Web search interfacel
  6. Select arXive (possibly other search source would give the same behaviour);
  7. Search for "Minkowski space", receive 20 hits;
  8. select them all and import;
  9. If the exceeption is not trigegred immediately, repeat the steps 7-8 with other search terms, e.g. "Kilogram definition", "Teaching Temperature", etc.
  10. At some stage an exception window pops up:
    Screenshot from 2021-04-04 10-04-44

The bug might be related to #7343, but the exception is different (OutOfBounds instead NullPointer), and is not in the Dark mode.

Sometimes there are multiple exceptions happening opening multiple pop-up windows. The fate of JabRef after exception is different – sometimes it freezes and the process needs to be killed, sometimes one can still save the database after closing the exception popup. If JabRef can be closed via it interface, it reports numerous dowload threads still running in the bacground.

More screenshots with sporadic exceptions after the sequence of actions listed here are available in my server:
http://saulius-grazulis.lt/~saulius/JabRef/screenshots/

The log message, copied and pasted from the window, reads:

Log File
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:248)
  at java.base/java.util.Objects.checkIndex(Objects.java:373)
  at java.base/java.util.ArrayList.get(ArrayList.java:427)
  at javafx.base/javafx.collections.ListChangeBuilder.insertUpdate(ListChangeBuilder.java:84)
  at javafx.base/javafx.collections.ListChangeBuilder.nextUpdate(ListChangeBuilder.java:467)
  at javafx.base/javafx.collections.ObservableListBase.nextUpdate(ObservableListBase.java:109)
  at javafx.base/com.sun.javafx.collections.ObservableListWrapper.access$100(ObservableListWrapper.java:45)
  at javafx.base/com.sun.javafx.collections.ObservableListWrapper$1$1.invalidated(ObservableListWrapper.java:72)
  at javafx.base/com.sun.javafx.collections.MapListenerHelper$SingleInvalidation.fireValueChangedEvent(MapListenerHelper.java:125)
  at javafx.base/com.sun.javafx.collections.MapListenerHelper.fireValueChangedEvent(MapListenerHelper.java:72)
  at javafx.base/com.sun.javafx.collections.ObservableMapWrapper.callObservers(ObservableMapWrapper.java:115)
  at javafx.base/com.sun.javafx.collections.ObservableMapWrapper.remove(ObservableMapWrapper.java:185)
  at org.jabref@100.0.0/org.jabref.model.entry.BibEntry.clearField(BibEntry.java:609)
  at org.jabref@100.0.0/org.jabref.model.entry.BibEntry.clearField(BibEntry.java:590)
  at org.jabref@100.0.0/org.jabref.logic.cleanup.ConvertToBibtexCleanup.lambda$cleanup$2(ConvertToBibtexCleanup.java:35)
  at java.base/java.util.Optional.ifPresent(Optional.java:176)
  at org.jabref@100.0.0/org.jabref.logic.cleanup.ConvertToBibtexCleanup.cleanup(ConvertToBibtexCleanup.java:25)
  at org.jabref@100.0.0/org.jabref.logic.importer.ImportCleanup.doPostCleanup(ImportCleanup.java:25)
  at org.jabref@100.0.0/org.jabref.logic.importer.ImportCleanup.lambda$doPostCleanup$0(ImportCleanup.java:36)
  at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
  at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
  at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
  at java.base/java.util.stream.ForEachOps$ForEachTask.compute(ForEachOps.java:290)
  at java.base/java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:746)
  at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
  at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1016)
  at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1665)
  at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1598)
  at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions