Fixes Texgroup's "Library has been modified by another program"#6584
Fixes Texgroup's "Library has been modified by another program"#6584systemoperator wants to merge 5 commits into
Conversation
Siedlerchr
left a comment
There was a problem hiding this comment.
Thanks for the investigation and the fix! I have a suggestion how to make the code more efficient
| } | ||
|
|
||
| // process GROUPSTREE and GROUPSTREE_LEGACY at the very end (otherwise it may happen that not all dependent data is set) | ||
| for (Map.Entry<String, String> entry : data.entrySet()) { |
There was a problem hiding this comment.
What about converting the whole switch/case to an if else with the group processing at the end and add it to the other?
This way you wont' need to reiterate over the whole map and you can ensure that it's in order.
(A switch case statement does not guarantee any order, e.g. default can be at the top, and it would only be executed if no cases match).
There was a problem hiding this comment.
I know, my correction is not very beautiful. I shortly thought about other solutions as well. One idea was e.g. to convert data.entrySet() to a List and then searching for those entries and shifting them to the end. What do you think about that?
I'm not sure, if I understood you correctly. Currently, a set gets iterated, where GROUPSTREE/GROUPSTREE_LEGACY could occur before or after setting the Latex directory. While iterating, the entries would also get processed in the same sequence, even when refactoring it to a whole if-else block, or am I missing something? Nevertheless, I will refactor it to a combined if-else now, because it looks much better.
There was a problem hiding this comment.
Thanks, I think I misunderstood it a bit., Thanks for your explanation. It's more clear now.
What about using something like: data.entrySet().stream(). filter(entry,getKey() == Groups... .. || entry.getKey() == Groups...
|
@Siedlerchr Before proceeding, I will wait for your recommendation. |
|
@Siedlerchr How about this? |
Fixes #6420.
Partially fixes #6585.
jabref/src/main/java/org/jabref/logic/importer/util/MetaDataParser.java
Line 67 in 2eac649
must be called before calling
jabref/src/main/java/org/jabref/logic/importer/util/MetaDataParser.java
Line 109 in 2eac649
so that the latex file directory is set properly.