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

clearComments does't actually clear comments #25

Closed
ruckustboom opened this issue Jul 27, 2017 · 2 comments
Closed

clearComments does't actually clear comments #25

ruckustboom opened this issue Jul 27, 2017 · 2 comments
Assignees
Labels
Milestone

Comments

@ruckustboom
Copy link

As stated, AbstractCommentedConfig.clearComments() doesn't actually clear the comments. It clears the comment map, but the entry set still contains its comments, and that is what is referenced when writing the file, so the comments remain.

@TheElectronWill TheElectronWill self-assigned this Jul 28, 2017
@TheElectronWill
Copy link
Owner

Clearing the map should clear the entry set because both are linked. I'll do some tests 🤔

@TheElectronWill
Copy link
Owner

TheElectronWill commented Aug 1, 2017

I see what the problem is (or at least one problem): the comments may be stored in subconfigs, but only the root map is cleaned when clearComments() is called. Therefore the comments remains...
The subconfigs' comments should be cleared recursively.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants