Community
Participate
Working Groups
Build Identifier: 20110204-0611 When processing an IResource (method processResource(IResource, IProgressMonitor, Object, CheckerLaunchMode)) CodanBuilder currently checks: 1. that the checker is enabled for a context (i.e. the IResource) 2. asks the CheckersRegistry if a checker is enabled for a launch mode The problem is #2. This check only verifies that the IProblems a checker provides are enabled for a particular launch mode, without checking that the checker itself supports such launch mode. For example, an IProblem may be enabled for "run in editor," but if the checker that defines return 'false' in "runWithEditor" or if the checker is not an instance of IRunnableEditorChecker, the checker should not be considered for processing the resource. My use case is the following: 1. I have a custom Checker that is not supposed to "run in editor" (it does not implement IRunnableEditorChecker. 2. I enable the problems from my checker to "run in editor" 3. When I change a C++ file, my checker is not called, by the markers it provided the previous time are removed, because CodanBuilder called the checker's "before" and "after" methods. The solution is to check first if the checker is enabled for a launch mode, and then check if the problems the checker defines are also enabled for a launch mode. Reproducible: Always Steps to Reproduce: This is not possible to reproduce outside my environment, since my checker is tightly tied to proprietary infrastructure. I'm attaching a patch with a solution though.
Created attachment 189996 [details] Proposed patch Patch with a proposed solution.
Created attachment 190458 [details] Improved version of patch submitted earlier Removed double-check for launch mode support in checker. Renamed method "isCheckerEnabledForLaunchMode" to "checkerSupportsLaunchMode".
Patch committed.
*** cdt cvs genie on behalf of sprigogin *** Bug 338467 - Codan calls "before" and "after" even for checkers that are not supposed to run in a launch mode. Patch by Alex Ruiz. [*] CodanBuilder.java 1.18 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CodanBuilder.java?root=Tools_Project&r1=1.17&r2=1.18