-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Globals.pref dependency in BibTexParserTest - KeyPattern #1843
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
Comments
If I recall correctly something else will break if one removed the Globals.prefs initialization. I think it is that ParserResults creates a MetaData() object which is not free from Globals (yet). Nowadays I try to add some comments to the setUp-method of the test to motivate why Globals.prefs is still initialized... |
So even if you can write JabRefPreferences.getInstance().getKeyPattern() there you still need the Globals.prefs init in setUp. The only remaining Globals in MetaData is the keyword separator which is needed for the groups. However, I haven't really found a nice way to propagate it (and I'm pondering if I should just propagate that as a String or create a GroupsPreferences class only containing this field...). |
And feel free to take care of it if you like. I will probably do it eventually otherwise, but not in the near future as it feels right now. |
Ah okay thanks for the info, I will check if it works with getInstance() otherwise I will add a comment. |
One way may be to assign a private JabRefPreferences field as there are quite a few tests that need an instance. But it may not be enough and Globals.prefs is still needed. Excellent if you want to give it a try! |
BibDatabaseContext is the major obstacle for Globals free logic-tests btw. If that is imported one can just forget about it... And I have no idea how to clean it in a simple way as it relies quite heavily on it. |
In a perfect world (that is: JabRef architecture), |
With #1856 it is actually not so illusive anymore. One dependency left in MetaData and then we can move MetaData and BibDatabaseContext. |
I close this as recents PRs have removed the need for Globals in all but one logic test ( |
Just noticed one more Globals.prefs dependency: @oscargus Do you want to take care of it?
in
BibTexParserTest
inintegrationTestCustomKeyPattern
The text was updated successfully, but these errors were encountered: