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

NegativeArraySizeException when editing and saving a @Reference entry #8231

Closed
2 tasks done
AlbertJBurton opened this issue Nov 10, 2021 · 2 comments · Fixed by #8270
Closed
2 tasks done

NegativeArraySizeException when editing and saving a @Reference entry #8231

AlbertJBurton opened this issue Nov 10, 2021 · 2 comments · Fixed by #8270

Comments

@AlbertJBurton
Copy link

JabRef version

5.3 (latest release)

Operating system

Windows

Details on version and operating system

Microsoft Windows 10 Enterprise

Checked with the latest development build

  • I made a backup of my libraries before testing the latest development version.
  • I have tested the latest development version and the problem persists

Steps to reproduce the behaviour

  1. Create a bib file with the single entry listed below.
  2. Edit any field (e.g. add NY to the location field).
  3. Click the save library button or menu item.
  4. Get the unhandled exception listed in the log file.

@reference{Broecker1984,
title = {International Center of Photography},
subtitle = {Encyclopedia of Photography},
editor = {Broecker, William L.},
date = {1984},
eprint = {305515791},
eprinttype = {scribd},
isbn = {0-517-55271-X},
keywords = {g:photography, p:positive, c:silver, m:albumen, c:pigment, m:carbon, g:reference, c:encyclopedia},
location = {New York},
pagetotal = {678},
publisher = {Crown},
}

NOTE: Changing the entry type to @book resolves the issue and the bib entry can be edited and the library saved without problems.

Appendix

...

Log File

java.lang.NegativeArraySizeException: -1
at java.base/java.lang.AbstractStringBuilder.(Unknown Source)
at java.base/java.lang.StringBuilder.(Unknown Source)
at org.jabref@5.3.60000/org.jabref.model.strings.StringUtil.repeat(Unknown Source)
at org.jabref@5.3.60000/org.jabref.model.strings.StringUtil.repeatSpaces(Unknown Source)
at org.jabref@5.3.60000/org.jabref.logic.bibtex.BibEntryWriter.getFormattedFieldName(Unknown Source)
at org.jabref@5.3.60000/org.jabref.logic.bibtex.BibEntryWriter.writeField(Unknown Source)
at org.jabref@5.3.60000/org.jabref.logic.bibtex.BibEntryWriter.writeRequiredFieldsFirstRemainingFieldsSecond(Unknown Source)
at org.jabref@5.3.60000/org.jabref.logic.bibtex.BibEntryWriter.write(Unknown Source)
at org.jabref@5.3.60000/org.jabref.logic.exporter.BibtexDatabaseWriter.writeEntry(Unknown Source)
at org.jabref@5.3.60000/org.jabref.logic.exporter.BibDatabaseWriter.savePartOfDatabase(Unknown Source)
at org.jabref@5.3.60000/org.jabref.logic.exporter.BibDatabaseWriter.saveDatabase(Unknown Source)
at org.jabref@5.3.60000/org.jabref.gui.exporter.SaveDatabaseAction.saveDatabase(Unknown Source)
at org.jabref@5.3.60000/org.jabref.gui.exporter.SaveDatabaseAction.save(Unknown Source)
at org.jabref@5.3.60000/org.jabref.gui.exporter.SaveDatabaseAction.save(Unknown Source)
at org.jabref@5.3.60000/org.jabref.gui.exporter.SaveDatabaseAction.save(Unknown Source)
at org.jabref@5.3.60000/org.jabref.gui.exporter.SaveAction.execute(Unknown Source)
at org.jabref@5.3.60000/org.jabref.gui.actions.JabRefAction.lambda$new$3(Unknown Source)
at org.jabref.merged.module@5.3.60000/org.controlsfx.control.action.Action.handle(Unknown Source)
at org.jabref.merged.module@5.3.60000/org.controlsfx.control.action.Action.handle(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
at org.jabref.merged.module@5.3.60000/javafx.event.Event.fireEvent(Unknown Source)
at org.jabref.merged.module@5.3.60000/javafx.scene.Node.fireEvent(Unknown Source)
at org.jabref.merged.module@5.3.60000/javafx.scene.control.Button.fire(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.javafx.scene.control.inputmap.InputMap.handle(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
at org.jabref.merged.module@5.3.60000/javafx.event.Event.fireEvent(Unknown Source)
at org.jabref.merged.module@5.3.60000/javafx.scene.Scene$MouseHandler.process(Unknown Source)
at org.jabref.merged.module@5.3.60000/javafx.scene.Scene.processMouseEvent(Unknown Source)
at org.jabref.merged.module@5.3.60000/javafx.scene.Scene$ScenePeerListener.mouseEvent(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.glass.ui.View.handleMouseEvent(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.glass.ui.View.notifyMouse(Unknown Source)
at org.jabref.merged.module@5.3.60000/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at org.jabref.merged.module@5.3.60000/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)

@ThiloteE
Copy link
Member

ThiloteE commented Nov 19, 2021

I cannot reproduce this in Jabref 5.3 nor in one of the newer development versions:

JabRef 5.4--2021-11-14--96a4c0e
Windows 10 10.0 amd64
Java 16.0.2
JavaFX 17.0.1+1

I use Windows 10 Pro instead of Enterprise though.

How exactly did you add the NY to the location field? Could it be that you forgot the comma or forgot to close the brackets maybe? Edit: The error messages look different when forgetting the comma or the brackets, so there likely has to be an additional condition to trigger this error.

@koppor
Copy link
Member

koppor commented Nov 22, 2021

@AlbertJBurton Could you please try the binary at https://builds.jabref.org/pull/8270/merge/?

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

Successfully merging a pull request may close this issue.

3 participants