Add addModifierIfAbsent and addTransientModifierIfAbsent to attribute instance class
Open
Nobody has claimed this yet.
status: needs triage
- Dominant language
- Java
- Stars
- 12.7k
- Forks
- 3.5k
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 11
Description
Is your feature request related to a problem?
Just for convenience
Before:
Attribute attribute = instance.getAttribute(xxx);
if(!attribute.getModifiers().contains(mod)) attribute.addModifier(mod);
After:
instance.getAttribute(xxx).addModifierIfAbsent(mod)
Describe the solution you'd like.
Just like above
Describe alternatives you've considered.
Ignore duplicated modifiers in the source code
Other
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the attribute instance class and its existing addModifier and transient-modifier methods. Follow the getAttribute(xxx) and getModifiers() entry points to match current modifier behavior; the change is done when both requested IfAbsent methods leave existing modifiers unchanged and add missing ones.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100