INRIA / INRIA/spoon

Adding and removing extended modifiers

Open
#4,136 21 comments 1 reaction 0 assignees View on GitHub
Dominant language
Java
Stars
2k
Forks
392
Avg merge
11h 24m
Merged PRs (30d)
36

Description

I was wondering why it isn't possible to directly add or remove extended modifiers. The only way is to copy the set, add your modifier and set it again. This is currently done in #4038 and #4134, and I'm currently trying to figure out some more issues with implicit modifiers where this functionality would make things a lot easier.

Is there any specific reason why such methods don't exist? If it just wasn't considered as useful before, I'd be happy to open a pull request for that.

----

Edit: Another useful API would be two static factory methods in `CtExtendedModifier`:
- `CtExtentedModifier.implicit(ModifierKind)`
- `CtExtendedModifier.explicit(ModifierKind)`

This would make it easier and more readable to work with extended modifiers.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.