Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Code Analysis Tools and AOP

Hi,

If the tools are operating on the bytecode they should see that the
fields are not unused as by that point the ITDs have manifested as
real java methods and accessors added to the target.  Some tools I
believe have a switch to either do source analysis or bytecode
analysis - but no doubt it will be just the tool you want to use that
doesn't have this mode... (obviously some kinds of violation are only
detectable using source analysis as not everything makes it through to
the bytecode)

> Couldn't this somehow be done via a "copy the classes and push-in the ITDs"
> refactoring every time before the analysis tools are run? Any ideas if this
> is feasible using maven or ant?

That is feasible, I believe the push-in refactoring can be
programmatically driven, but it would require dependencies on AJDT
components.  There is a Roo issue discussing it:
https://jira.springsource.org/browse/ROO-222

I wonder if there is a way to write a plugin for analysis tools that
enable external knowledge to be used to finesse any violations it
finds.  That way an AspectJ plugin could use knowledge of ITDs to
remove violations that were about to be reported...

Andy



On 17 February 2010 13:19, bendert <tilman.bender@xxxxxx> wrote:
>
> Hi everyone,
>
> I have a problem using code analysis tools such as findbugs, checkstyle etc.
> on a project that uses ITDs.
> Since the tools cannot "see" the compile-time woven code from the ITDs I get
> a lot of false positives.
>
> E.g.
> Class Foo has fields bar and baz, whose java-bean getters and setters are
> defined in an ITD.
> Now when I run a code analysis tool (in this case I think it is checkstyle
> generating the error) I get
> a false positive saying, that the fields bar and baz are unused private
> variables.
>
> I have
> http://old.nabble.com/Sonar-Code-Analysis-an-Aspects-to27590436.html#a27591785
> already discussed this  with Freddy Mallet from the codehaus sonar project
> and the only solution so far seems to disable checks for classes using ITDs.
> When you use Spring Roo (like I do) which makes heavy use of ITDs this
> "solution" will not get you
> very far in terms of having a good analysis of your codebase.
>
> Couldn't this somehow be done via a "copy the classes and push-in the ITDs"
> refactoring every time before the analysis tools are run? Any ideas if this
> is feasible using maven or ant?
>
> kind regards
> Til
> --
> View this message in context: http://old.nabble.com/Code-Analysis-Tools-and-AOP-tp27593217p27593217.html
> Sent from the AspectJ - users mailing list archive at Nabble.com.
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>


Back to the top