Improve BibEntry
Is your suggestion for improvement related to a problem? Please describe.
There are places where BibEntry could be improved:
- The semantics of the
withX()methods are unclear. Specifically- Should it be called immediately after construction and before use?
- Should it return
thisor a new instance?
- There are methods that return mutable fields but do not create defensive copies.
- There is code that is uncalled, including from tests. I spotted a bug in one of these methods.
- getSourceField() could be rewritten in a (slightly) more data-driven manner, with, for example, lists of forbidden fields rather than multi-way disjunctions.
@NotNullkeyword could be added.
Describe the solution you'd like
I would like clarifications on the desired semantics and for this issue to be assigned to me and my students.
Additional context
I am an instructor looking for an exercise for my students.
@koppor said on Gitter:
We have
BibEntry#withFieldand more "withers". However, they modify the Object at hand - and thus contradict the expection of a "wither" to create a copy. All of these could be rewritten to be a proper builder.
Hi! I'm Ayush (MCA 2026). I'd like to work on this issue (#14067) as my first contribution. Could you please assign it to me?
π Hey @AyusHkaushaL1, looks like youβre eager to work on this issue β great! π It also looks like you don't know how to assign issues to yourself. Please read our CONTRIBUTING.md to find out how. It will also guide you in other aspects of contributing to JabRef.
/assign-me
π Hey @AyusHkaushaL1, 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! π
β° Assignment Reminder
Hi @AyusHkaushaL1, this is a friendly reminder about your assignment to this issue.
[!WARNING] This issue will be automatically unassigned in 11 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 11 days
- Asking for the π Pinned label if you need more time
We appreciate your contribution and are here to help if needed!
One could also experiment with https://github.com/skinny85/jilt
There, one needs to import static and compile time only dependency.
π Assignment Update
Hi @AyusHkaushaL1, due to inactivity, you have been unassigned from this issue.
Next steps
If you still want to work on this:
- Submit a pull request showing your current state. You will be automatically assigned again.
- Ask a maintainer to assign you again.
i have gone through the codebase, and understood the issue. I guess i can contribute. Plz assign me
/assign-me
π Hey @k-singh171, looks like youβre eager to work on this issue β great! π It also looks like you don't know how to assign issues to yourself. Please read our CONTRIBUTING.md to find out how. It will also guide you in other aspects of contributing to JabRef.
π Hey @k-singh171, 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! π
I would like clarifications on the desired semantics and for this issue to be assigned to me and my students.
I totally overlooked that. - Maybe I was hoping that some persons with some software engineering skills would come up with a clarification.
I think, this needs experimentation.
First experiment:
Replace als with... by a builder generated by jilt. Reason: Current "withers" are builders. See class comment note.
- If it looks good: We go ahead
- If it looks bad: We do something else
Note: If ".with" is needed to form a new bbientry, .toBuilder can be used.