-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
docs/decisions/0038-use-identityhashcode-for-bibentries.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
title: Use System.identityHashCode for BibEntry at indexing | ||
nav_order: 38 | ||
parent: Decision Records | ||
--- | ||
|
||
<!-- markdownlint-disable-next-line MD025 --> | ||
# Use `System.identityHashCode` for BibEntries at Indexing | ||
|
||
## Context and Problem Statement | ||
|
||
The `BibEntry` class has `equals` and `hashCode` implemented on the content of the bib entry. | ||
Thus, if two bib entries have the same type, the same fields, and the same content, they are equal. | ||
|
||
This, however, is not useful in the UI, where equal entries are not the same entries. | ||
|
||
## Decision Drivers | ||
|
||
* Simple code | ||
* Not changing much other JabRef code | ||
* Working Lucene | ||
|
||
## Considered Options | ||
|
||
* Use `System.identityHashCode` for indexing `BibEntry` | ||
* Rewrite `BibEntry` logic | ||
|
||
## Decision Outcome | ||
|
||
Chosen option: "Use `System.identityHashCode` for indexing `BibEntry`", because is the "natural" thing to ensure distinction between two instances of a `BibEntry` object - regardless of equality. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters