Skip to content

Incorrect(?) parsing of {\textendash} when renaming files #3990

@aphirst

Description

@aphirst

JabRef version 4.3-dev on Arch Linux x86_64

Steps to reproduce:

  1. Have an entry corresponding to the BibTeX entry below containing {\textendash} in its title (with a real PDF existing at the specified location, which for demonstration purposes starts with a literal - in the relevant place):
  2. Select the entry, and in "General -> File" choose to Rename the file (based on the metadata)
  3. Notice the new filename: Wu2014 - Initial Design with L2 Monge Kantorovich Theory for the Monge}Ampere Equation Method in Freeform Surface Illumination Design.pdf with its uncoupled } where the hyphen should be.
  4. Attempt to save, (understandably) get this error:
    a
  5. When performing this operation as part of "Quality -> Cleanup Entries", JabRef freezes.
@Article{Wu2014,
  author    = {Rengmao Wu and Yaqin Zhang and Mohamed M. Sulman and Zhenrong Zheng and Pablo Ben{\'{i}}tez and Juan C. Mi{\~{n}}ano},
  title     = {Initial design with L{\^{}}2 Monge-Kantorovich theory for the Monge{\textendash}Amp{\`{e}}re equation method in freeform surface illumination design},
  journal   = {Optics Express},
  year      = {2014},
  volume    = {22},
  number    = {13},
  pages     = {16161},
  month     = {jun},
  doi       = {10.1364/oe.22.016161},
  file      = {:Wu2014 - Initial Design with L2 Monge Kantorovich Theory for the Monge-Ampere Equation Method in Freeform Surface Illumination Design.pdf:PDF},
  publisher = {The Optical Society},
}
Log File
Opening: /home/adam/Projects/Library/Papers/Papers.bib
Opening: /home/adam/Projects/Library/Test/Test.bib
Error while saving file.
org.jabref.logic.exporter.SaveException: Error in field 'file': Unescaped '}' character without opening bracket ends string prematurely.
  at org.jabref.logic.exporter.BibtexDatabaseWriter.writeEntry(BibtexDatabaseWriter.java:169)
  at org.jabref.logic.exporter.BibDatabaseWriter.savePartOfDatabase(BibDatabaseWriter.java:198)
  at org.jabref.logic.exporter.BibDatabaseWriter.saveDatabase(BibDatabaseWriter.java:150)
  at org.jabref.logic.autosaveandbackup.BackupManager.performBackup(BackupManager.java:124)
  at java.util.Optional.ifPresent(Optional.java:159)
  at org.jabref.logic.autosaveandbackup.BackupManager.lambda$new$0(BackupManager.java:50)
  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
  at java.lang.Thread.run(Thread.java:748)

Problem saving file
org.jabref.logic.exporter.SaveException: rt
  at org.jabref.gui.exporter.SaveDatabaseAction.saveDatabase(SaveDatabaseAction.java:215)
  at org.jabref.gui.exporter.SaveDatabaseAction.run(SaveDatabaseAction.java:142)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:498)
  at spin.Invocation.evaluate(Invocation.java:175)
  at spin.off.SpinOffEvaluator$1.run(SpinOffEvaluator.java:108)
  at java.lang.Thread.run(Thread.java:748)

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: waiting-for-feedbackThe submitter or other users need to provide more information about the issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions