Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 345793 - Codan checkers run even when disabled
Summary: Codan checkers run even when disabled
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-codan (show other bugs)
Version: 8.0   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Elena Laskavaia CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-13 17:16 EDT by Sergey Prigogin CLA
Modified: 2011-05-13 19:23 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Prigogin CLA 2011-05-13 17:16:47 EDT
To reproduce disable "Suspicious semicolon" checker and create the following code:

void test() {
  if (true)
    ;
}

A warning marker is created for the semicolon is spite of the checker being disabled.
Comment 1 Sergey Prigogin CLA 2011-05-13 18:38:48 EDT
Fixed in HEAD > 20110513.

The problem was caused by lack of initialization of org.eclipse.cdt.codan.core.PreferenceConstants.P_USE_PARENT preference that is supposed to be true by default. This caused project-level preferences to take over workspace preferences so that a change made to workspace preferences had no effect.

I still don't understand why defaults for Codan preferences defined in org.eclipse.cdt.codan.core are initialized in org.eclipse.cdt.codan.ui. This seems pretty dangerous since the preferences can potentially be accessed from org.eclipse.cdt.codan.core before being initialized.