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

Throw BibEntryNotFound exception in case entry is no longer present #4935

Merged
merged 5 commits into from
May 1, 2019

Conversation

Siedlerchr
Copy link
Member

@Siedlerchr Siedlerchr commented May 1, 2019

Fixes #4932

When an entry got removed a NPE complaining about an empty database was thrown because of some weird UnkownBibTexEntry thing.
Now the correct BibEntryNotFound Exception is thrown showing the problematic reference mark


  • Change in CHANGELOG.md described
  • Tests created for changes
  • Manually tested changed features in running JabRef
  • Screenshots added in PR description (for bigger UI changes)
  • Ensured that the git commit message is a good one
  • Check documentation status (Issue created for outdated help page at help.jabref.org?)

@Siedlerchr Siedlerchr added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label May 1, 2019
Copy link
Member

@matthiasgeiger matthiasgeiger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two minor comments 😉

@@ -717,6 +717,9 @@ private String getCitationMarkerField(BibEntry entry, BibDatabase database, Stri
String authorField = getStringCitProperty(AUTHOR_FIELD);
String[] fields = field.split(FieldName.FIELD_SEPARATOR);
for (String s : fields) {

Objects.requireNonNull(entry, "Entry cannot be null");
Objects.requireNonNull(database, "database cannot be null");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be moved to the beginning of the method.

CHANGELOG.md Outdated
@@ -113,6 +113,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- We fixed an issue where ranking an entry would generate an IllegalArgumentException. [#4754](https://github.com/JabRef/jabref/issues/4754)
- We fixed an issue where special characters where removed from non label key generation pattern parts [#4767](https://github.com/JabRef/jabref/issues/4767)
- We fixed an issue where the RIS import would overwite the article date with the value of the acessed date [#4816](https://github.com/JabRef/jabref/issues/4816)
- We fixed an issue where an NullPointer exception was thrown when a referenced entry in an Open/Libre Office was no longer present in the library. Now an error message with the reference marker of the missing entry is shown. [#4932](https://github.com/JabRef/jabref/issues/4932)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... in an Open/Libre Office document was...

@Siedlerchr Siedlerchr merged commit f1b4b5b into master May 1, 2019
@Siedlerchr Siedlerchr deleted the ooLogging branch May 1, 2019 12:30
Siedlerchr added a commit that referenced this pull request May 1, 2019
* upstream/master:
  Throw BibEntryNotFound exception in case entry is no longer present  (#4935)
  Improve author parsing (#4931)
  Ui preferences global modifications (#4926)
  Bump checkstyle from 8.19 to 8.20 (#4928)
  Bump mysql-connector-java from 8.0.15 to 8.0.16 (#4924)
  UI Preferences->advanced tab optimization : separators and text modification (#4922)

# Conflicts:
#	src/main/java/org/jabref/gui/search/SearchWorker.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bibliography cannot be updated
2 participants