Skip to content

Bring back a modified ISBN check and add more tests#11217

Merged
koppor merged 4 commits into
JabRef:mainfrom
AbdAlRahmanGad:Duplicate_check
Apr 18, 2024
Merged

Bring back a modified ISBN check and add more tests#11217
koppor merged 4 commits into
JabRef:mainfrom
AbdAlRahmanGad:Duplicate_check

Conversation

@AbdAlRahmanGad

Copy link
Copy Markdown
Contributor

Closes #8885

Mandatory checks

  • Change in CHANGELOG.md described in a way that is understandable for the average user (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

Signed-off-by: AbdAlRahmanGad <abdobngad@gmail.com>

@koppor koppor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for the follow-up. Small comment remaining.

Comment thread src/main/java/org/jabref/logic/database/DuplicateCheck.java Outdated
Comment thread src/main/java/org/jabref/logic/database/DuplicateCheck.java
AbdAlRahmanGad and others added 2 commits April 18, 2024 10:00
Comment on lines +347 to +349
if (oneISBN.isPresent() && twoISBN.isPresent()
&& !List.of(StandardEntryType.Article, StandardEntryType.InBook, StandardEntryType.InCollection).contains(one.getType())
&& Objects.equals(oneISBN, twoISBN)) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would flip List.of and Objects.equals, because oneISBN is checked in line 347 and then the subsequent line 348 is closer. Otherwise, the condition is harder to read, because it switches between ISBN, types, and ISBN.

Signed-off-by: AbdAlRahmanGad <abdobngad@gmail.com>
@koppor koppor added this pull request to the merge queue Apr 18, 2024
Merged via the queue into JabRef:main with commit 2b5fddd Apr 18, 2024
@AbdAlRahmanGad AbdAlRahmanGad deleted the Duplicate_check branch April 25, 2024 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Duplicate check during import marks articles from collection as possible duplicates

2 participants