Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 345793

Summary: Codan checkers run even when disabled
Product: [Tools] CDT Reporter: Sergey Prigogin <eclipse.sprigogin>
Component: cdt-codanAssignee: Project Inbox <cdt-core-inbox>
Status: RESOLVED FIXED QA Contact: Elena Laskavaia <elaskavaia.cdt>
Severity: major    
Priority: P3 CC: cdtdoug
Version: 8.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

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.