Project: Refactor and unify JabRef OO components
Project: Refactor JabRef-OpenOffice components
There is a lot of scope for improvement in code quality in JabRef's OpenOffice/LibreOffice integration components to make it much more maintainable. These include, but are not limited to:
- [ ] Unification of error handling mechanism for JabRef-OOdoc interaction: Currently there exists a mix of returning Optional, throwing exceptions, and using
OOResult/OOVoidResult. We can standardize the error handling approaches for consistency. - [ ] Use of Dependency Injection
- [x] Break down large methods like
guiActionInsertEntry() - [x] Use more constants instead of magic strings e.g. as used in the error messages
- [ ] Use of built-in functional interfaces: for methods that take
Supplier<OOError>as parameters - will improve code clarity - [ ] Use of modern Java features like streams and optional chaining
- [ ] Separation of concerns: classes such as
OOBibBasehandle both business logic and UI interactions. We can consider extracting UI-related code into a separate class or layer. - [x] Inner classes like
ComparableMarkcan be converted to record classes. - [ ] Unification of backend for CSL and JStyles (Optional, and a big project - I am fine with all the CSL logic being separate due to the difference in code philosophy and time required for unification).
I will be working on this, but any sub-issue here is free-to-take, so will be using this issue to track the state/progress. The list is not yet complete, so will be updated from time to time as I come across more scopes for improvements.
I want take the task "Inner classes like ComparableMark can be converted to record classes."
Hi @subhramit , we're a group of students working on a university software engineering course project and would love to tackle this issue. Could you assign this to us?
/assign-me
👋 Hey @anuv-bit, thank you for your interest in this issue! 🎉
We're excited to have you on board. Start by exploring our Contributing guidelines, and set up your local development workspace by following the steps in our workspace setup guidelines to get started smoothly.
For questions on JabRef functionality, you can consult the JabRef Guru. For questions related to the codebase, please start using DeepWiki.
In case you encounter failing tests during development, please check our developer FAQs!
Still facing issues or having more questions? Feel free to ask here on GitHub or on JabRef's Gitter chat. Please don't hesitate to open a (draft) pull request early on to show the direction you are heading towards if unsure.
Happy coding! 🚀
Hey, just to be transparent, please go through our contributing guidelines and policies on AI. If the quality of PRs don't match expected standards, we may close pull request(s).
⏰ Assignment Reminder
Hi @anuv-bit, this is a friendly reminder about your assignment to this issue.
[!WARNING] This issue will be automatically unassigned in 7 days if there's no activity.
Remember that you can ask the JabRef Guru or DeepWiki about anything regarding JabRef. Additionally, our contributing guide has hints on creating a pull request and a link to our Gitter chat.
How to keep your assignment
If you are working on it, you can prevent automatic unassignment by:
- Submitting a draft pull request with your progress within 7 days
- Asking for the 📌 Pinned label if you need more time
We appreciate your contribution and are here to help if needed!
Hi @subhramit, I'm one of the members of students working on this task with anuv-bit. Would you be able to elaborate some more on what you are referring to in the unification of error handling subtask by 'standardizing the error handling approaches'? Are you looking to minimize the use of one or more of the error handling methods in the Open Office files? Or are you wanting to have definitive approaches for certain task contexts, like using Optional for retrieving document/citation information?
Hi @subhramit, I'm one of the members of students working on this task with anuv-bit. Would you be able to elaborate some more on what you are referring to in the unification of error handling subtask by 'standardizing the error handling approaches'? Are you looking to minimize the use of one or more of the error handling methods in the Open Office files? Or are you wanting to have definitive approaches for certain task contexts, like using Optional for retrieving document/citation information?
That sub-task would be a bit difficult unless you have the context of the whole LO-doc-JabRef interaction. Try to investigate what OOVoid and OOResult are used in error handling - and compare them to simply throwing exceptions.
Check if these can be re-used at other places where there is interaction with the document. For example, in methods where bibliography is generated.
Hi @subhramit, I'm one of the members of students working on this task with anuv-bit. Would you be able to elaborate some more on what you are referring to in the unification of error handling subtask by 'standardizing the error handling approaches'? Are you looking to minimize the use of one or more of the error handling methods in the Open Office files? Or are you wanting to have definitive approaches for certain task contexts, like using Optional for retrieving document/citation information?
That sub-task would be a bit difficult unless you have the context of the whole LO-doc-JabRef interaction. Try to investigate what
OOVoidandOOResultare used in error handling - and compare them to simply throwing exceptions. Check if these can be re-used at other places where there is interaction with the document. For example, in methods where bibliography is generated.
Thanks for your response! From my understanding, you are wanting for throwing exceptions to be replaced (where it makes sense and doesn't screw up the workflow) with OOVoid and OOResult error handling methods so that there is less deviation in error handling methods throughout the Open Office components?
Hi @subhramit, I'm one of the members of students working on this task with anuv-bit. Would you be able to elaborate some more on what you are referring to in the unification of error handling subtask by 'standardizing the error handling approaches'? Are you looking to minimize the use of one or more of the error handling methods in the Open Office files? Or are you wanting to have definitive approaches for certain task contexts, like using Optional for retrieving document/citation information?
That sub-task would be a bit difficult unless you have the context of the whole LO-doc-JabRef interaction. Try to investigate what
OOVoidandOOResultare used in error handling - and compare them to simply throwing exceptions. Check if these can be re-used at other places where there is interaction with the document. For example, in methods where bibliography is generated.Thanks for your response! From my understanding, you are wanting for throwing exceptions to be replaced (where it makes sense and doesn't screw up the workflow) with OOVoid and OOResult error handling methods so that there is less deviation in error handling methods throughout the Open Office components?
Yes, and one could make more of them in case of repeated cases which are not covered by these.
I would also invite you to look if other "good first issues" are free in our project, as they would be easier to work on assuming you all are beginners.
We think that this issue was fixed. Please head to https://builds.jabref.org/main to download a development build and try it out.
For any feedback, add a comment to the pull request at https://github.com/JabRef/jabref/pull/15380.
Hi.
I submitted a PR trying to solve the "Separation of concerns: classes such as OOBibBase handle both business logic and UI interactions. We can consider extracting UI-related code into a separate class or layer."
You can see in the PR's descriptions I didn't check "I manually tested my changes in running JabRef (always required)". It's because I didn't fully understand what was supposed to happen when I try to connect with OpenOffice. I create a text file but it keeps showing me "Autodetecting paths" indefinitely. I guess it's a stupid mistake but I wasn't able to figure out yet. I will keep looking for it in the documentation but if anyone can help me at this... 😵💫
Also, I didn't check "I checked the user documentation for up to dateness and submitted a pull request to our user documentation repository" because I have yet to understand about the pull request to your user documentation repository.
Other than that, if there's any suggestion or comment about the modifications I proposed I'd like very much to know.
A pull request addressing the issue has been created. You can try out the pull request by following the steps at How to try out any JabRef pull request?.
For any feedback, add a comment to the pull request at https://github.com/JabRef/jabref/pull/15718.
You can see in the PR's descriptions I didn't check "I manually tested my changes in running JabRef (always required)". It's because I didn't fully understand what was supposed to happen when I try to connect with OpenOffice. I create a text file but it keeps showing me "Autodetecting paths" indefinitely. I guess it's a stupid mistake but I wasn't able to figure out yet. I will keep looking for it in the documentation but if anyone can help me at this... 😵💫
Hey, your first step should be exploring the software and the concerned feature, and not solving issues in the dark. There is documentation available for all this - try googling. Secondly, please keep your texts self-contained - I'm not sure which PR you're talking about.
Edit - found it. Please use Refs. Instead of Closes, as the PR will not fix the entire issue.
Please also go through our contributing guidelines. We have a certain workflow of issue assignment before PRs.
Sorry for that. Got a little anxious and jumped some steps.
I will spend some time learning more about the project and the workflow.
Thanks for the response.