Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 339294 - Message Pattern should not be user-configurable
Summary: Message Pattern should not be user-configurable
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-codan (show other bugs)
Version: 8.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 8.0   Edit
Assignee: Sergey Prigogin CLA
QA Contact: Elena Laskavaia CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-08 17:43 EST by Alex Ruiz CLA
Modified: 2011-03-22 23:23 EDT (History)
3 users (show)

See Also:


Attachments
Proposed patch (2.85 KB, patch)
2011-03-08 17:44 EST, Alex Ruiz CLA
eclipse.sprigogin: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Ruiz CLA 2011-03-08 17:43:12 EST
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.
Comment 1 Alex Ruiz CLA 2011-03-08 17:44:41 EST
Created attachment 190709 [details]
Proposed patch

Proposed solution.
Comment 2 Alex Ruiz CLA 2011-03-08 19:27:54 EST
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.
Comment 3 Sergey Prigogin CLA 2011-03-22 22:49:30 EDT
Patch applied to HEAD > 20110322.