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

Global rule management is saved even if cancelled #76

Closed
phoenix384 opened this issue Jan 9, 2019 · 1 comment
Closed

Global rule management is saved even if cancelled #76

phoenix384 opened this issue Jan 9, 2019 · 1 comment
Assignees
Labels
Milestone

Comments

@phoenix384
Copy link
Contributor

Go to Window - Preferences - PMD - Rule Configuration and activate 'Use global rule management'.
Press 'Cancel'. The activation of 'Use global rule management' is saved anyway.

Expected behaviour would be:
The activation of 'Use global rule management' is only saved when clicking 'Apply'.

@adangel adangel added the bug label Jan 11, 2019
@adangel
Copy link
Member

adangel commented Jan 11, 2019

Indeed - the flag is stored as part of the UI state here:

PreferenceUIStore.INSTANCE.globalRuleManagement(globalRuleManagementCheckButton.getSelection());

And saveUIState() is called both for performCancel():

public boolean performCancel() {
saveUIState();
return super.performCancel();
}

and performOk():

public boolean performOk() {
saveUIState();
if (isModified()) {
updateRuleSet();
rebuildProjects();
storeActiveRules();
}
return super.performOk();
}

The flag should be store not as part of saveUIState() but in performOk() only.

@adangel adangel self-assigned this Jan 12, 2019
@adangel adangel added this to the 4.1.0 milestone Mar 2, 2019
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