jabref: JabRef error if keyword group has no name

Update: Read on at https://github.com/JabRef/jabref/issues/9776#issuecomment-1555866023

JabRef version

5.9 (latest release)

Operating system

macOS

Details on version and operating system

macOS 13.3.1

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. import a biblatex library created on linux machine and with the special field priority
  2. error opening (does not open)
JabRef 5.9--2023-01-08--76253f1a7
Mac OS X 13.3.1 aarch64 
Java 19.0.1 
JavaFX 19+11

Appendix

Log File
java.lang.NumberFormatException: For input string: "priority"
	at java.base/java.lang.NumberFormatException.forInputString(Unknown Source)
	at java.base/java.lang.Integer.parseInt(Unknown Source)
	at java.base/java.lang.Integer.parseInt(Unknown Source)
	at org.jabref@5.9.60000/org.jabref.logic.importer.util.GroupsParser.keywordGroupFromString(Unknown Source)
	at org.jabref@5.9.60000/org.jabref.logic.importer.util.GroupsParser.fromString(Unknown Source)
	at org.jabref@5.9.60000/org.jabref.logic.importer.util.GroupsParser.importGroups(Unknown Source)
	at org.jabref@5.9.60000/org.jabref.logic.importer.util.MetaDataParser.parse(Unknown Source)
	at org.jabref@5.9.60000/org.jabref.logic.importer.util.MetaDataParser.parse(Unknown Source)
	at org.jabref@5.9.60000/org.jabref.logic.importer.fileformat.BibtexParser.parseFileContent(Unknown Source)
	at org.jabref@5.9.60000/org.jabref.logic.importer.fileformat.BibtexParser.parse(Unknown Source)
	at org.jabref@5.9.60000/org.jabref.logic.importer.fileformat.BibtexImporter.importDatabase(Unknown Source)
	at org.jabref@5.9.60000/org.jabref.logic.importer.fileformat.BibtexImporter.importDatabase(Unknown Source)
	at org.jabref@5.9.60000/org.jabref.logic.importer.OpenDatabase.loadDatabase(Unknown Source)
	at org.jabref@5.9.60000/org.jabref.gui.importer.actions.OpenDatabaseAction.loadDatabase(Unknown Source)
	at org.jabref@5.9.60000/org.jabref.gui.importer.actions.OpenDatabaseAction.lambda$openTheFile$1(Unknown Source)
	at org.jabref@5.9.60000/org.jabref.gui.util.BackgroundTask$1.call(Unknown Source)
	at org.jabref@5.9.60000/org.jabref.gui.util.DefaultTaskExecutor$1.call(Unknown Source)
	at org.jabref.merged.module@5.9.60000/javafx.concurrent.Task$TaskCallable.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 16 (9 by maintainers)

Most upvoted comments

To test this. Create a new library, add some entries and create a new automatic keyword group without a name. save the library and reopen

Hi, I am the university of adelaide student. Our group would like to sovle the issue. I think the solution above consider abnormally formatted data. Can I have the test file?

amazing, I was able to open the file in JabRef on macOS. Thanks again, great work! Will leave the ticket open until it gets fixed in the code by the devs

I could reproduce this now with another library. Saving is not a problem, but on opening the parser fails to properly parse the group structure (off by one)

@alfureu Good news. I found the issue and a fix for you is simple. The problem is that the Keyword Group for the field priority did not have a name! At the end of the file, where the group metadata is defined replace:

2 KeywordGroup:\;0\;priority\;prio1\;1\;0\;1\;0x8a8a8aff\;\;\;; with 2 KeywordGroup:Test\;0\;priority\;prio1\;1\;0\;1\;0x8a8a8aff\;\;\;;

and voila it works again 😃

I will do more tests to find how this could be even possible to prevent such cases in the future.

Thanks! Received it!