-
Notifications
You must be signed in to change notification settings - Fork 67
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
Do not copy the list returned by findCandidates #554
Conversation
At least this seem not to break anything ... |
The specification requires that we pass in the original list of candidates to the insertHostedCapability but currently always a copy is performed. This replaces the copy by directly keeping the reference given as the resolver is woning the list anyways.
0935276
to
b9f603a
Compare
@tjwatson what do you think? |
@@ -48,8 +48,8 @@ private ShadowList(CandidateSelector shadow, List<Capability> original) | |||
} | |||
|
|||
private ShadowList(List<Capability> unmodifiable, List<Capability> original, AtomicBoolean isUnmodifiable) { | |||
super(unmodifiable, isUnmodifiable); | |||
m_original = new ArrayList<Capability>(original); | |||
super(new ArrayList<Capability>(unmodifiable), isUnmodifiable); |
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 don't understand the switch here to copy for the super call and not for the m_original
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.
This code a a bit cumbersome because it switches "unmodifiable" what actually is modified later on but the original is later passed to the ProvisonContext.
I'll close this for now as the specification will be changed in this aspect: |
The specification requires that we pass in the original list of candidates to the insertHostedCapability but currently always a copy is performed.
This replaces the copy by directly keeping the reference given as the resolver is woning the list anyways.
See