-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preserve bibtex import order #982
Conversation
@@ -223,7 +219,7 @@ public void actionPerformed(ActionEvent e) { | |||
Globals.prefs.put(JabRefPreferences.EXPORT_WORKING_DIRECTORY, file.getParent()); | |||
|
|||
final File finFile = file; | |||
final Set<String> finEntryIDs = entryIds; | |||
final List<BibEntry> finEntries = entries; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is a new variable introduced?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Further down it is used in an anonymous method, which is only possible if it final.
👍 (Just one question and one space...) I guess an intermediate step would be to have a List of ids instead of a Set as that list should probably have a smaller memory footprint compared to bibentry, but as long as it is not a problem (and I guess it isn't, even with thousands of entries), this seems to be the way to go! |
👍 |
Preserve bibtex import order
@obraliar #504 (comment) noted that the order of the bibentries in
parserResult.getDatabase().getEntries
is not the same as in the bib file.As it turned out, fixing the order required to store the bibentries not as
Map<id, BibEntry>
but simply as a list. So I removed almost everything which is connected to ID's. Now they are only used for writing bibentries (to determine the original order) and for the sql export.