Community
Participate
Working Groups
Build Identifier: 20110204-0611 In Codan, each problem has a message pattern, which is used to create IMarkers when a problem is found in a code base. Currently, users are able to edit message patterns for individual problems. IMHO, this is dangerous, since there is not enough context in the Codan Preference UI for the user to provide anything useful for the message pattern. Users can simply change it to "Hello World" or something that doesn't make sense, getting useless errors/warnings from Codan, defeating its purpose. This is of course, my opinion. I'm attaching a patch that makes the text field for the message pattern uneditable, because I think it is useful to know what pattern to expect from a problem. Reproducible: Always Steps to Reproduce: 1. Create a C/C++ Project 2. Go to the project properties dialog (right-click the top project folder and select "Properties" from the context-menu) 3. Go to "C/C++ General" -> "Code Analysis" 4. On the right-hand side you'll see a list of problems. Pick one and double-click it 5. A dialog appears, allowing users to edit the message pattern of the problem.
Created attachment 190709 [details] Proposed patch Proposed solution.
I was about to file another bug, where a single preference id is used to store both the "enable" state and the severity level of an IProblem. In this key a single string is stored, which is parsed as follows: - if the string starts with "-" then the problem is disable - the rest of the string is the textual representation of the problem ("warning", "error", etc.) This behavior is broken if bug 339294 is rejected. In another words, if we decide to let users configure the message pattern, we need to fix the storage of preferences because, right now, the message pattern is not being saved in between sessions. I'll wait for the resolution of this bug to decide whether I file the bug I just described. If we decide to apply the patch I submitted (or a similar solution,) then the fix for preference storage bug can wait till we have more preferences to store.
Patch applied to HEAD > 20110322.
*** cdt cvs genie on behalf of sprigogin *** Bug 339294 - Message Pattern should not be user-configurable. Patch by Alex Ruiz. [*] ParametersComposite.java 1.10 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/widgets/ParametersComposite.java?root=Tools_Project&r1=1.9&r2=1.10 [*] ParametersComposite.java 1.11 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/codan/org.eclipse.cdt.codan.ui/src/org/eclipse/cdt/codan/internal/ui/widgets/ParametersComposite.java?root=Tools_Project&r1=1.10&r2=1.11