Skip to content

Commit

Permalink
Fix main table bug when creating a duplicate (JabRef#2135)
Browse files Browse the repository at this point in the history
  • Loading branch information
chriba authored and zesaro committed Oct 27, 2016
1 parent 4490775 commit 0165557
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/java/net/sf/jabref/gui/maintable/ListSynchronizer.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ public void listen(EntryRemovedEvent entryRemovedEvent) {
public void listen(EntryChangedEvent entryChangedEvent) {
lock();
try {
int index = list.indexOf(entryChangedEvent.getBibEntry());
if (index != -1) {
// SpecialFieldUtils.syncSpecialFieldsFromKeywords update an entry during
// DatabaseChangeEvent.ADDED_ENTRY
// thus,
list.set(index, entryChangedEvent.getBibEntry());
// cannot use list#indexOf b/c it won't distinguish between duplicates
for (int i = 0; i < list.size(); i++) {
if (list.get(i) == entryChangedEvent.getBibEntry()) {
list.set(i, entryChangedEvent.getBibEntry());
break;
}
}
} finally {
unlock();
Expand Down

0 comments on commit 0165557

Please sign in to comment.