-
-
Notifications
You must be signed in to change notification settings - Fork 352
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
wip: fix: change how modifiers are handled to use an ordered LinkedHashSet #4122
Conversation
@raghav-deepsource To avoid regressions of this behavior, could you add tests that verify that the insertion order of modifiers is preserved? Insertion order for all of |
|
||
@Test | ||
public void testAddModifier() { | ||
inputModifierKinds.forEach(handler::addModifier); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm actually enjoying java for once thanks to this syntax!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you use class/instance fields and not local variables for modifiers
, modifiersExt
and so on?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was to reduce duplication. I had all of these tests within a single test function at one point which I refactored into its present form.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
though that has sort of come undone with current changes
|
||
@Test | ||
public void testAddModifier() { | ||
inputModifierKinds.forEach(handler::addModifier); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you use class/instance fields and not local variables for modifiers
, modifiersExt
and so on?
25eb747
to
dc74c05
Compare
This PR was rather misguided, seeing as spoon generates modifiers as an unordered set anyway. A better method has been brought up in #4033. |
I should probably move the linkedHashSetCollector method elsewhere (a utility class for example).
this PR addresses #4033