Skip to content

Commit

Permalink
Merge pull request #6578 from JabRef/fixXMPExtractor
Browse files Browse the repository at this point in the history
Fix XMP Exctrator not returning empty optional
  • Loading branch information
Siedlerchr authored Jun 3, 2020
2 parents 46fd96b + db00267 commit 2f0aed9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- We fixed an issue where the "Attach file" dialog, in the right-click menu for an entry, started on the working directory instead of the user's main directory. [#4995](https://github.com/JabRef/jabref/issues/4995)
- We fixed an issue where the JabRef Icon in the macOS launchpad was not displayed correctly [#5003](https://github.com/JabRef/jabref/issues/5003)
- We fixed an issue where the "Search for unlinked local files" would throw an exception when parsing the content of a PDF-file with missing "series" information [#5128](https://github.com/JabRef/jabref/issues/5128)
- We fixed an issue where the XMP Importer would incorrectly return an empty default entry when importing pdfs [#6577](https://github.com/JabRef/jabref/issues/6577)

### Removed

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/org/jabref/logic/xmp/DublinCoreExtractor.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private void extractEditor() {
private void extractAuthor() {
List<String> creators = dcSchema.getCreators();
if ((creators != null) && !creators.isEmpty()) {
bibEntry.setField(StandardField.AUTHOR, String.join(" and ", creators));
bibEntry.setField(StandardField.AUTHOR, String.join(" and ", creators));
}
}

Expand Down Expand Up @@ -242,10 +242,10 @@ public Optional<BibEntry> extractBibtexEntry() {
this.extractTitle();
this.extractType();

if (bibEntry.getType() == null) {
bibEntry.setType(BibEntry.DEFAULT_TYPE);
// we pass a new BibEntry in the constructor which is never empty as it already consists of "@misc"
if (bibEntry.getFieldMap().isEmpty()) {
return Optional.empty();
}

return Optional.of(bibEntry);
}

Expand Down

0 comments on commit 2f0aed9

Please sign in to comment.