Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Test and Performance Tools Platform (TPTP) » Removing an AnalysisHistoryElement from an AnalysisHistory in a Code Review rule
Removing an AnalysisHistoryElement from an AnalysisHistory in a Code Review rule [message #91773] Thu, 25 January 2007 15:45 Go to next message
Eclipse UserFriend
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 #91802 is a reply to message #91773] Thu, 25 January 2007 18:24 Go to previous messageGo to next message
Steve Gutz is currently offline Steve GutzFriend
Messages: 70
Registered: July 2009
Member
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
>
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 Go to previous message
Eclipse UserFriend
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
>>
>
>
Previous Topic:Profiling a Struts Application
Next Topic:oracle 10gas web app memory profile
Goto Forum:
  


Current Time: Tue Mar 19 05:02:28 GMT 2024

Powered by FUDForum. Page generated in 0.02399 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top