Skip to content

Commit

Permalink
Add isPresentLocalBibEntry.
Browse files Browse the repository at this point in the history
  • Loading branch information
obraliar committed Aug 18, 2016
1 parent a55b3eb commit 342aac9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/net/sf/jabref/shared/DBMSSynchronizer.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public void listen(EntryAddedEvent event) {
public void listen(FieldChangedEvent event) {
// While synchronizing the local database (see synchronizeLocalDatabase() below), some EntryEvents may be posted.
// In this case DBSynchronizer should not try to update the bibEntry entry again (but it would not harm).
if (isEventSourceAccepted(event) && checkCurrentConnection()) {
if (isEventSourceAccepted(event) && checkCurrentConnection() && isPresentLocalBibEntry(event.getBibEntry())) {
synchronizeLocalMetaData();
BibEntry bibEntry = event.getBibEntry();
synchronizeSharedEntry(bibEntry);
Expand Down Expand Up @@ -348,6 +348,10 @@ public void openSharedDatabase(DBMSConnectionProperties properties) throws Class
openSharedDatabase(DBMSConnector.getNewConnection(properties), properties.getType(), properties.getDatabase());
}

private boolean isPresentLocalBibEntry(BibEntry bibEntry) {
return bibDatabase.getEntries().contains(bibEntry);
}

public String getDBName() {
return dbName;
}
Expand Down

0 comments on commit 342aac9

Please sign in to comment.