Community
Participate
Working Groups
Build Identifier: 20110204-0611 Currently the Codan Preference UI for a single problem *always* shows "Run as you type" in the "Launching" tab, regardless if the checker that provided such problem supports that launching mode. It really does not make too much sense to show this launch mode (and let the user think it means something) if the checker does not support "run as you type". I'm attaching a patch that does the following: 1. Hides the "run as you type" launch mode from the "Launch" tab for a problem preference UI. 2. As a side-effect, CheckersRegistry now provides the mapping IProblem -> IChecker, something we didn't have before. 3. Created the utility class Checkers, to avoid duplication of code (verification that an IChecker supports "run as you type" launch mode. Reproducible: Always Steps to Reproduce: 1. Create a C/C++ project 2. Right-click the top project folder and select "Properties" from the pop-up menu 3. Go to "C/C++ General" -> "Code Analysis" 4. Select "Invalid redefinition" problem from the Problems table 5. Double click that problem, a dialog will appear 6. Go to the "Launching" tab 7. "Run as you type" shows up, even though this checker does not support this launch mode.
Created attachment 190718 [details] Proposed patch Proposed solution.
Created attachment 190804 [details] Fixed a bug in previous patch Fixed bug in previous patch. This patch contains a proposed solution for the bug.
Patch applied to HEAD > 20110322.
*** cdt cvs genie on behalf of sprigogin *** Bug 339305 - Preference "Run as you type" should appear only if checker supports that launch mode. Patch by Alex Ruiz. [+] Checkers.java http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/core/model/Checkers.java?root=Tools_Project&revision=1.1&view=markup [*] CheckersRegistry.java 1.14 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckersRegistry.java?root=Tools_Project&r1=1.13&r2=1.14 [*] CodanBuilder.java 1.19 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.18&r2=1.19 [*] LaunchModesPropertyPage.java 1.5 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/preferences/LaunchModesPropertyPage.java?root=Tools_Project&r1=1.4&r2=1.5 [*] LaunchingTabComposite.java 1.5 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/widgets/LaunchingTabComposite.java?root=Tools_Project&r1=1.4&r2=1.5