Removing an AnalysisHistoryElement from an AnalysisHistory in a Code Review rule [message #91773] |
Thu, 25 January 2007 15:45 |
Eclipse User |
|
|
|
Originally posted by: junk.gianfagna.net
Hi Everyone,
I'm working on creating a set of C codereview rules to detect violations of
the MISRA-C standard. I'm creating a rule deviation feature that will allow
certain instances of violations to be overridden (A formal deviation as
defined by MISRA). After discovering if a rule violation is OK, I need to
remove the AnalysisHistoryElement associated with the result from the
AnalysisHistory. Does anyone know of a good way of doing this? I'm
relatively new to the API, so forgive me if I've missed something obvious.
Thanks for your time.
--Andy Gianfagna
Rochester Institute of Technology
|
|
|
|
Re: Removing an AnalysisHistoryElement from an AnalysisHistory in a Code Review rule [message #92096 is a reply to message #91802] |
Thu, 01 February 2007 15:41 |
Eclipse User |
|
|
|
Originally posted by: junk.gianfagna.net
Thanks Steve,
That was quite helpful. Though after studying the API a little more, I do
think I'll probably take the route of not generating the result at all.
--Andy
"Steve Gutz" <sgutz@ca.ibm.com> wrote in message
news:epaslo$l5p$1@utils.eclipse.org...
> This isn't really intended behavior but it should be possible to do.
> Normally you would want to prevent the result from being generated in the
> first place.
>
> If you still have a handle to your analysis result you can do something
> like this:
>
> AnalysisHistoryFactory.instance().removeResult( history, result );
>
> The code for this method is:
>
> public void removeResult( AnalysisHistory history, AbstractAnalysisResult
> result )
> {
> IAnalysisElement rule = result.getOwner();
> result.dispose();
> rule.getHistoryResults( result.getHistoryId()).remove( result );
> fireListeners(history,
> AnalysisHistoryListener.HISTORY_ANALYSIS_UPDATED );
> }
>
> Hopefully this helps
> Steve Gutz
>
>
> "Andy Gianfagna" <junk@gianfagna.net> wrote in message
> news:epajar$b78$1@utils.eclipse.org...
>> Hi Everyone,
>>
>> I'm working on creating a set of C codereview rules to detect violations
>> of the MISRA-C standard. I'm creating a rule deviation feature that will
>> allow certain instances of violations to be overridden (A formal
>> deviation as defined by MISRA). After discovering if a rule violation is
>> OK, I need to remove the AnalysisHistoryElement associated with the
>> result from the AnalysisHistory. Does anyone know of a good way of doing
>> this? I'm relatively new to the API, so forgive me if I've missed
>> something obvious.
>>
>> Thanks for your time.
>>
>> --Andy Gianfagna
>> Rochester Institute of Technology
>>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.02829 seconds