Skip to content
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

Fix AtomContainer2.setStereoElements(List<IStereoElement>) #396

Closed
wants to merge 2 commits into from

Conversation

k-ujihara
Copy link
Contributor

AtomContainer.setStereoElements(List element) checks for duplicate elements as described in the StereoElementFactory's comment, but AtomContainer2 version does not.

@johnmay
Copy link
Member

johnmay commented Dec 8, 2017

This was actually intentional - notice the list is first emptied before adding everything. It's unlikely a stereo-element will appear twice (after all this is just reference equality) and so the de-duplication isn't useful.

Thoughts?

@k-ujihara
Copy link
Contributor Author

I agree with you about addStereoElements method. On the other hand, it is better to check for duplication in addStereoElement method in my thought.
Anyway, the comment of StereoElementFactory class is to be revised.

@johnmay
Copy link
Member

johnmay commented Dec 10, 2017

Fixed commend here: #398.
The problem is the old AtomContainer used a Set<>, but since it's doing reference equality didn't really make sense. The comment in the StereoElementFactory was really referring to the fact that add elements did not clear any existing ones.

@k-ujihara
Copy link
Contributor Author

I understand and confirmed the corrected comment in StereoElementFactory.

@k-ujihara k-ujihara closed this Dec 10, 2017
@k-ujihara k-ujihara deleted the patch/setStereoElements branch December 14, 2017 03:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants