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

Error in 5.8 on bibtex library with doubled braces in booktitle (@InCollection) #9475

Closed
2 tasks done
crystalfp opened this issue Dec 19, 2022 · 5 comments · Fixed by #9504
Closed
2 tasks done

Error in 5.8 on bibtex library with doubled braces in booktitle (@InCollection) #9475

crystalfp opened this issue Dec 19, 2022 · 5 comments · Fixed by #9504
Labels
bug Confirmed bugs or reports that are very likely to be bugs

Comments

@crystalfp
Copy link

JabRef version

5.8 (latest release)

Operating system

Windows

Details on version and operating system

JabRef 5.8--2022-12-18--b7fae4b Windows 11 10.0 amd64 Java 18.0.2.1 JavaFX 19+11

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. Load the following library as BibTeX:
@InCollection{Favre2004,
  author    = {Jean Favre and Mario Valle},
  booktitle = {{The Visualization Handbook}},
  publisher = {Academic Press},
  title     = {{AVS and AVS/Express}},
  year      = {2004},
  editor    = {Chuck Hansen and Chris Johnson},
  month     = dec,
  pages     = {655--672},
  file      = {:D\:/LibraryBooks/Publications/LibroHansen/hansen.pdf:PDF},
  keywords  = {books},
  langid    = {english},
  mvpubtype = {books},
  url       = {http://www.elsevierdirect.com/product.jsp?isbn=9780123875822},
}

@Comment{jabref-meta: databaseType:bibtex;}
  1. Run Quality > Check Integrity
  2. The following PopUp appears:
java.util.regex.PatternSyntaxException: Illegal repetition near index 1
{The[\.\s]*Visualization[\.\s]*Handbook}[\.\s]*
 ^
	at java.base/java.util.regex.Pattern.error(Unknown Source)
	at java.base/java.util.regex.Pattern.closure(Unknown Source)
	at java.base/java.util.regex.Pattern.sequence(Unknown Source)
	at java.base/java.util.regex.Pattern.expr(Unknown Source)
	at java.base/java.util.regex.Pattern.compile(Unknown Source)
	at java.base/java.util.regex.Pattern.<init>(Unknown Source)
	at java.base/java.util.regex.Pattern.compile(Unknown Source)
	at org.jabref@5.8.60000/org.jabref.logic.journals.JournalAbbreviationRepository.lambda$findDottedAbbrFromDotless$2(Unknown Source)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
	at java.base/java.util.Iterator.forEachRemaining(Unknown Source)
	at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Unknown Source)
	at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
	at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
	at java.base/java.util.stream.ReferencePipeline.collect(Unknown Source)
	at org.jabref@5.8.60000/org.jabref.logic.journals.JournalAbbreviationRepository.findDottedAbbrFromDotless(Unknown Source)
	at org.jabref@5.8.60000/org.jabref.logic.journals.JournalAbbreviationRepository.isAbbreviatedName(Unknown Source)
	at org.jabref@5.8.60000/org.jabref.logic.integrity.AbbreviationChecker.checkValue(Unknown Source)
	at org.jabref@5.8.60000/org.jabref.logic.integrity.FieldChecker.check(Unknown Source)
	at org.jabref@5.8.60000/org.jabref.logic.integrity.IntegrityCheck.checkEntry(Unknown Source)
	at org.jabref@5.8.60000/org.jabref.gui.integrity.IntegrityCheckAction$1.call(Unknown Source)
	at org.jabref@5.8.60000/org.jabref.gui.integrity.IntegrityCheckAction$1.call(Unknown Source)
	at org.jabref.merged.module@5.8.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)
  1. With the previous versions of JabRef no error were reported.
  2. If I remove the additional brace, the error appears on another @InCollection entry like the following with braces around the booktitle
@InCollection{Lyakhov2010a,
  author    = {Andriy O. Lyakhov and Artem R. Oganov and Mario Valle},
  booktitle = {{Modern Methods of Crystal Structure Prediction}},
  publisher = {Wiley-VCH},
  title     = {{Crystal Structure Prediction Using Evolutionary Approach}},
  year      = {2010},
  editor    = {Artem R. Oganov},
  month     = nov,
  keywords  = {books},
  langid    = {english},
  mvpubtype = {books},
  url       = {http://www.wiley-vch.de/publish/en/books/bySubjectPH00/ISBN3-527-40939-4/short/?sID=ou0r6rp7eaadonst3lfkjtktd1},
}
  1. Seems the error appears only on @InCollection entries with double braces around booktitle

Appendix

...

Log File
Paste an excerpt of your log file here
@HoussemNasri
Copy link
Member

I can confirm. Apparently the bug was introduced in #9453

@Siedlerchr Siedlerchr added the bug Confirmed bugs or reports that are very likely to be bugs label Dec 19, 2022
@Siedlerchr
Copy link
Member

@K5qu4r3d Can you take a look at this?

@Siedlerchr Siedlerchr moved this to Normal priority in Prioritization Dec 19, 2022
@Siedlerchr Siedlerchr moved this from Normal priority to High priority in Prioritization Dec 19, 2022
@spethso
Copy link
Contributor

spethso commented Dec 28, 2022

It also happens on MacOS Ventura with JabRef 5.8 for inProceedings entries with double braces for the title.

@Siedlerchr
Copy link
Member

Yes, apparently the journal abbreivation check is called from the IntegrityChecker which checks all kind of book related fields and it sems like the regex does not escape the curly braces.

Siedlerchr added a commit that referenced this issue Dec 28, 2022
Escape any curly braces
Also use latex free fields


Fixes #9475
Fixes #9503
@github-project-automation github-project-automation bot moved this from High priority to Done in Prioritization Jan 2, 2023
Siedlerchr added a commit that referenced this issue Jan 2, 2023
* Fix journal abbbrev checker for curly braces

Escape any curly braces
Also use latex free fields


Fixes #9475
Fixes #9503

* refactor abbreviation checker to latex free entry checker

* adjust test cases

* checkstyle

* checkstyle

* Streamline tests and add tests for 9475 and 9503

Co-authored-by: Christoph <siedlerkiller@gmail.com>
Co-authored-by: Carl Christian Snethlage <50491877+calixtus@users.noreply.github.com>

* Rename Medline to Dotless and add translations for the menu actions

* On our way

Co-authored-by: Christoph <siedlerkiller@gmail.com>

* Add misisng test

Co-authored-by: Christoph <siedlerkiller@gmail.com>

* Try to use full MVMap in groovy script

* Fix path

* Streamline action

* Try to commit changes

* Revert "Streamline action"

This reverts commit 626e41a.

* Try to fix action

* Debug: show branch

* Stay on current branch

* Fix action

* Remove bad files

* Serizalizabe version 1

* Fix duplicate handling

* Add trigger on braches

* fix

* Fix wrong comment

* Some debug maybe?

* debug

* Add warning

* Try to use a single MV store only

* Fix import

* CamleCase to dash-case

* Fix brace

* Update journal abbrev list

* Remove debug output

* Internalize loading

* Disable workflow

* Update CHANGELOG.md

* Remove initialization hack

* Update journal abbrev list

* No need to fetch

* Use right WoS file

* Update journal abbrev list

* fix l10n and reorder

Co-authored-by: Oliver Kopp <kopp.dev@gmail.com>
Co-authored-by: Carl Christian Snethlage <50491877+calixtus@users.noreply.github.com>
Co-authored-by: koppor <koppor@users.noreply.github.com>
@Siedlerchr
Copy link
Member

The issue is now fixed in the latest dev version. We will release a version 5.9 this week which will contain these fixesxs as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bugs or reports that are very likely to be bugs
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants