michel-kraemer / citeproc-java

📘 A Citation Style Language (CSL) processor for Java.
Apache License 2.0
89 stars 17 forks source link

Index out of bounds exception for empty PhdThesis bibtex entry with IEEE #206

Closed Siedlerchr closed 1 year ago

Siedlerchr commented 1 year ago

Describe the bug

Created an empty PhdThesis bibtex entry in biblatex mode in JabRef (latest main):

@PhdThesis{,
}

Selected Preview Style IEEE got the following error: Using this version of the style

ieee.csl.txt


2023-05-07 11:12:01 [JavaFX Application Thread] org.jabref.gui.preview.PreviewViewer.lambda$8()
ERROR: Error while generating citation style: java.lang.IndexOutOfBoundsException: Index 3 out of bounds for length 3
    at java.base/java.util.Objects.checkIndex(Objects.java:385)
    at java.base/java.util.ArrayList.get(ArrayList.java:427)
    at citeproc.java@3.0.0-beta.2/de.undercouch.citeproc.csl.internal.format.HtmlFormat.doFormatBibliographyEntry(HtmlFormat.java:38)
    at citeproc.java@3.0.0-beta.2/de.undercouch.citeproc.csl.internal.format.BaseFormat.formatBibliographyEntry(BaseFormat.java:249)
    at citeproc.java@3.0.0-beta.2/de.undercouch.citeproc.CSL.makeBibliography(CSL.java:1027)
    at citeproc.java@3.0.0-beta.2/de.undercouch.citeproc.CSL.makeBibliography(CSL.java:910)
    at org.jabref/org.jabref.logic.citationstyle.CSLAdapter.makeBibliography(CSLAdapter.java:47)
    at org.jabref/org.jabref.logic.citationstyle.CitationStyleGenerator.generateCitations(CitationStyleGenerator.java:62)
    at org.jabref/org.jabref.logic.citationstyle.CitationStyleGenerator.generateCitation(CitationStyleGenerator.java:52)
    at org.jabref/org.jabref.logic.citationstyle.CitationStylePreviewLayout.generatePreview(CitationStylePreviewLayout.java:19)
    at org.jabref/org.jabref.gui.preview.PreviewViewer.lambda$5(PreviewViewer.java:255)
    at org.jabref/org.jabref.gui.util.BackgroundTask$1.call(BackgroundTask.java:60)
    at org.jabref/org.jabref.gui.util.DefaultTaskExecutor$1.call(DefaultTaskExecutor.java:161)
    at javafx.graphics@20/javafx.concurrent.Task$TaskCallable.call(Task.java:1426)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:577)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
    at java.base/java.lang.Thread.run(Thread.java:1589)

Which version of citeproc-java are you using? 3.0.0-beta.2

Expected behavior Empty preview e.g [1]

Actual behavior A bug occured

CSL input If applicable, add the input to citeproc-java (i.e. the CSL citation data in JSON)

Used style and locale IEEE with default locale en-US

Rendered output/Screenshots Error while generating citation style (comes from JabRef)

Example code/unit test Provide example code or a unit test to reproduce your issue. You may also insert a link to your repository containing a minimal reproducer here.

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had activity in the last 60 days. It will be closed in two weeks if no further activity occurs. Thank you for your contributions.

Siedlerchr commented 1 year ago

Still an issue