You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by sb...@apache.org on 2002/02/06 02:24:29 UTC

[AUDIT] jakarta-ant/proposal/myrmidon

This is a short text summary of the results of a static source code
analysis tool ( WebGain QA - http://www.webgain.com )ran on this project.

Note that violations may vary widely between different runs depending
on the rules being enabled as I need some time to tune them efficiently.

For detailed information please look at the full report at:
http://cvs.apache.org/~sbailliez/jakarta-ant/proposal/myrmidon/audit

- Summary -
Audited classes          Reported classes         Violations
535                      139                      589

- Packages -
Name                                                               Violations
org.apache.aut.bzip2                                               45
org.apache.aut.tar                                                 2
org.apache.aut.vfs                                                 8
org.apache.aut.vfs.impl                                            1
org.apache.aut.vfs.provider                                        16
org.apache.aut.vfs.provider.ftp                                    3
org.apache.aut.vfs.provider.local                                  2
org.apache.aut.vfs.provider.smb                                    9
org.apache.aut.vfs.provider.zip                                    1
org.apache.myrmidon.components.type                                1
org.apache.tools.ant.taskdefs                                      40
org.apache.tools.ant.taskdefs.archive                              2
org.apache.tools.ant.taskdefs.compilers                            4
org.apache.tools.ant.taskdefs.condition                            1
org.apache.tools.ant.taskdefs.exec                                 4
org.apache.tools.ant.taskdefs.javadoc                              6
org.apache.tools.ant.taskdefs.optional                             40
org.apache.tools.ant.taskdefs.optional.ccm                         3
org.apache.tools.ant.taskdefs.optional.depend                      8
org.apache.tools.ant.taskdefs.optional.depend.constantpool         1
org.apache.tools.ant.taskdefs.optional.dotnet                      2
org.apache.tools.ant.taskdefs.optional.ejb                         88
org.apache.tools.ant.taskdefs.optional.i18n                        6
org.apache.tools.ant.taskdefs.optional.ide                         133
org.apache.tools.ant.taskdefs.optional.javacc                      1
org.apache.tools.ant.taskdefs.optional.jsp                         10
org.apache.tools.ant.taskdefs.optional.jsp.compilers               1
org.apache.tools.ant.taskdefs.optional.junit                       33
org.apache.tools.ant.taskdefs.optional.metamata                    3
org.apache.tools.ant.taskdefs.optional.net                         8
org.apache.tools.ant.taskdefs.optional.perforce                    10
org.apache.tools.ant.taskdefs.optional.pvcs                        1
org.apache.tools.ant.taskdefs.optional.scm                         2
org.apache.tools.ant.taskdefs.optional.sitraka                     12
org.apache.tools.ant.taskdefs.optional.sitraka.bytecode            16
org.apache.tools.ant.taskdefs.optional.sound                       1
org.apache.tools.ant.taskdefs.optional.vss                         4
org.apache.tools.ant.taskdefs.rmic                                 8
org.apache.tools.ant.taskdefs.text                                 14
org.apache.tools.ant.taskdefs.unix                                 1
org.apache.tools.ant.types                                         12
org.apache.tools.ant.util                                          13
org.apache.tools.ant.util.depend                                   1
org.apache.tools.ant.util.mappers                                  1
org.apache.tools.ant.util.regexp                                   10
org.apache.tools.mail                                              1


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [AUDIT] jakarta-ant/proposal/myrmidon

Posted by Stephane Bailliez <sb...@apache.org>.
----- Original Message -----
From: "Stefan Bodewig" <bo...@apache.org>


> > public protected private abstract static final static synchronized
native
>
> "static" twice, maybe there are other places where it is ambiguos?

No, it is my writing that is ambiguous. :)

read:
public protected private abstract static final synchronized native

Stephane


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [AUDIT] jakarta-ant/proposal/myrmidon

Posted by Stefan Bodewig <bo...@apache.org>.
On Wed, 6 Feb 2002, Stephane Bailliez <sb...@apache.org> wrote:
> method declaration 8.4.3, p.157 

> public protected private abstract static final static synchronized native

"static" twice, maybe there are other places where it is ambiguos?

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: [AUDIT] jakarta-ant/proposal/myrmidon

Posted by Adam Murdoch <ad...@yahoo.com>.

> -----Original Message-----
> From: Stephane Bailliez [mailto:sbailliez@apache.org]
> Sent: Thursday, 7 February 2002 11:08 AM
> To: Ant Developers List
> Subject: Re: [AUDIT] jakarta-ant/proposal/myrmidon
>
>
> ----- Original Message -----
> From: "Adam Murdoch" <ad...@yahoo.com>
>
> [...]
> > I don't think it's worth spending time on.  Sounds like autofix
> is the way
>
> Well I looked into it...and yes it's not worth it because it would require
> quite some time :-)
>
> > to go - how about we just go with the rule as it currently
> stands ("final
> > static"), and autofix the fields with "static final"?
>
> eh ? not possible. The autofix will fix what the rule reported.
> So for now I would say, autofix fields into final static or don't pay
> attention to it or disable it.
>

Sorry, that's what I meant.  As in, autofix the fields so that they all end
up declared "final static".


Adam


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [AUDIT] jakarta-ant/proposal/myrmidon

Posted by Stephane Bailliez <sb...@apache.org>.
----- Original Message -----
From: "Adam Murdoch" <ad...@yahoo.com>

[...]
> I don't think it's worth spending time on.  Sounds like autofix is the way

Well I looked into it...and yes it's not worth it because it would require
quite some time :-)

> to go - how about we just go with the rule as it currently stands ("final
> static"), and autofix the fields with "static final"?

eh ? not possible. The autofix will fix what the rule reported.
So for now I would say, autofix fields into final static or don't pay
attention to it or disable it.

All code here is consistent about modifiers, I don't think there is any
'final synchronized static public' anywhere so this won't be of any problem.
I find the unused variables or import more important than that.

Stephane



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: [AUDIT] jakarta-ant/proposal/myrmidon

Posted by Adam Murdoch <ad...@yahoo.com>.

> -----Original Message-----
> From: Stephane Bailliez [mailto:sbailliez@apache.org]
> Sent: Thursday, 7 February 2002 10:36 AM
> To: Ant Developers List
> Subject: Re: [AUDIT] jakarta-ant/proposal/myrmidon
>
>
> ----- Original Message -----
> From: "Adam Murdoch" <ad...@yahoo.com>
>
> [...]
> > Yep - this is exactly what happened.  In the JLS first edition,
> the order
> > for field modifiers is "final static", and in the second
> edition the order
> > is "static final".  For methods the order is "static final" in both
> > editions.
>
> > Would it be easy to change the check to allow "static final" for fields?
> > It's not important, but it would be kinda good if it didn't
> complain about
> > code that's compliant with the JLS.
>
> It is a built-in rule (on/off). To do that, I would need to
> recode the rule
> myself.
> This is possible, however we'll lose the benefit of autofix as this is one
> violation that the tool can safely fix by modifying the code. (or maybe I
> can modify the code too via the API, but from the top of my head
> right now I
> can't see how).
>
> What I can do is to disable temporarily the rule, time for me to code the
> right rule and see if I can actually code the autofix.
> There are about 474 'final static' in Ant code right now, so I
> would better
> prefer an autofix/commit :-)
>

I don't think it's worth spending time on.  Sounds like autofix is the way
to go - how about we just go with the rule as it currently stands ("final
static"), and autofix the fields with "static final"?


Adam


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [AUDIT] jakarta-ant/proposal/myrmidon

Posted by Stephane Bailliez <sb...@apache.org>.
----- Original Message -----
From: "Adam Murdoch" <ad...@yahoo.com>

[...]
> Yep - this is exactly what happened.  In the JLS first edition, the order
> for field modifiers is "final static", and in the second edition the order
> is "static final".  For methods the order is "static final" in both
> editions.

> Would it be easy to change the check to allow "static final" for fields?
> It's not important, but it would be kinda good if it didn't complain about
> code that's compliant with the JLS.

It is a built-in rule (on/off). To do that, I would need to recode the rule
myself.
This is possible, however we'll lose the benefit of autofix as this is one
violation that the tool can safely fix by modifying the code. (or maybe I
can modify the code too via the API, but from the top of my head right now I
can't see how).

What I can do is to disable temporarily the rule, time for me to code the
right rule and see if I can actually code the autofix.
There are about 474 'final static' in Ant code right now, so I would better
prefer an autofix/commit :-)

I have reported the error. Thanks for pointing out the incoherence.

Stephane



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: [AUDIT] jakarta-ant/proposal/myrmidon

Posted by Adam Murdoch <ad...@yahoo.com>.

> -----Original Message-----
> From: Stephane Bailliez [mailto:sbailliez@apache.org]
> Sent: Wednesday, 6 February 2002 7:09 PM
> To: Ant Developers List
> Subject: Re: [AUDIT] jakarta-ant/proposal/myrmidon
>
>
> ----- Original Message -----
> From: "Adam Murdoch" <ad...@yahoo.com>
>
> > Can we switch off the "Modifiers of declaration are present in a
> > non-standard order" check?  As far as I can tell, according to the
> sections
> > of the JLS that they cite, it's the audit tool that's got the
> modifiers in
> > the wrong order, not our code.
>
> Switching it off is probably not a good idea but fixing it could be :)
>
> > The appropriate sections (8.1.1, 8.3.1 and 8.4.3) of the JLS are at:
> >
> > http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html
>
> There is something wrong somewhere. Maybe a modification from the
> first JLS
> version ?

Yep - this is exactly what happened.  In the JLS first edition, the order
for field modifiers is "final static", and in the second edition the order
is "static final".  For methods the order is "static final" in both
editions.

Would it be easy to change the check to allow "static final" for fields?
It's not important, but it would be kinda good if it didn't complain about
code that's compliant with the JLS.


Adam


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [AUDIT] jakarta-ant/proposal/myrmidon

Posted by Stephane Bailliez <sb...@apache.org>.
----- Original Message -----
From: "Adam Murdoch" <ad...@yahoo.com>

> Can we switch off the "Modifiers of declaration are present in a
> non-standard order" check?  As far as I can tell, according to the
sections
> of the JLS that they cite, it's the audit tool that's got the modifiers in
> the wrong order, not our code.

Switching it off is probably not a good idea but fixing it could be :)

> The appropriate sections (8.1.1, 8.3.1 and 8.4.3) of the JLS are at:
>
> http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html

There is something wrong somewhere. Maybe a modification from the first JLS
version ?
If you look at the example in 8.3.1.1, they use "final static." and not
static final.

In they QA manual (5.21) they say:

class declaration, 8.1.2, p.130:
public abstract final

field declaration, 8.3.1, p.144:
public protected private final static transient

method declaration 8.4.3, p.157
public protected private abstract static final static synchronized native

Stephane


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: [AUDIT] jakarta-ant/proposal/myrmidon

Posted by Adam Murdoch <ad...@yahoo.com>.
Hi,

Can we switch off the "Modifiers of declaration are present in a
non-standard order" check?  As far as I can tell, according to the sections
of the JLS that they cite, it's the audit tool that's got the modifiers in
the wrong order, not our code.

The appropriate sections (8.1.1, 8.3.1 and 8.4.3) of the JLS are at:

http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html


Adam

> -----Original Message-----
> From: sbailliez@apache.org [mailto:sbailliez@apache.org]
> Sent: None
> To: ant-dev@jakarta.apache.org
> Subject: [AUDIT] jakarta-ant/proposal/myrmidon
>
>
>
> This is a short text summary of the results of a static source code
> analysis tool ( WebGain QA - http://www.webgain.com )ran on this project.
>
> Note that violations may vary widely between different runs depending
> on the rules being enabled as I need some time to tune them efficiently.
>
> For detailed information please look at the full report at:
> http://cvs.apache.org/~sbailliez/jakarta-ant/proposal/myrmidon/audit
>
> - Summary -
> Audited classes          Reported classes         Violations
> 535                      139                      589
>
> - Packages -
> Name
>  Violations
> org.apache.aut.bzip2                                               45
> org.apache.aut.tar                                                 2
> org.apache.aut.vfs                                                 8
> org.apache.aut.vfs.impl                                            1
> org.apache.aut.vfs.provider                                        16
> org.apache.aut.vfs.provider.ftp                                    3
> org.apache.aut.vfs.provider.local                                  2
> org.apache.aut.vfs.provider.smb                                    9
> org.apache.aut.vfs.provider.zip                                    1
> org.apache.myrmidon.components.type                                1
> org.apache.tools.ant.taskdefs                                      40
> org.apache.tools.ant.taskdefs.archive                              2
> org.apache.tools.ant.taskdefs.compilers                            4
> org.apache.tools.ant.taskdefs.condition                            1
> org.apache.tools.ant.taskdefs.exec                                 4
> org.apache.tools.ant.taskdefs.javadoc                              6
> org.apache.tools.ant.taskdefs.optional                             40
> org.apache.tools.ant.taskdefs.optional.ccm                         3
> org.apache.tools.ant.taskdefs.optional.depend                      8
> org.apache.tools.ant.taskdefs.optional.depend.constantpool         1
> org.apache.tools.ant.taskdefs.optional.dotnet                      2
> org.apache.tools.ant.taskdefs.optional.ejb                         88
> org.apache.tools.ant.taskdefs.optional.i18n                        6
> org.apache.tools.ant.taskdefs.optional.ide                         133
> org.apache.tools.ant.taskdefs.optional.javacc                      1
> org.apache.tools.ant.taskdefs.optional.jsp                         10
> org.apache.tools.ant.taskdefs.optional.jsp.compilers               1
> org.apache.tools.ant.taskdefs.optional.junit                       33
> org.apache.tools.ant.taskdefs.optional.metamata                    3
> org.apache.tools.ant.taskdefs.optional.net                         8
> org.apache.tools.ant.taskdefs.optional.perforce                    10
> org.apache.tools.ant.taskdefs.optional.pvcs                        1
> org.apache.tools.ant.taskdefs.optional.scm                         2
> org.apache.tools.ant.taskdefs.optional.sitraka                     12
> org.apache.tools.ant.taskdefs.optional.sitraka.bytecode            16
> org.apache.tools.ant.taskdefs.optional.sound                       1
> org.apache.tools.ant.taskdefs.optional.vss                         4
> org.apache.tools.ant.taskdefs.rmic                                 8
> org.apache.tools.ant.taskdefs.text                                 14
> org.apache.tools.ant.taskdefs.unix                                 1
> org.apache.tools.ant.types                                         12
> org.apache.tools.ant.util                                          13
> org.apache.tools.ant.util.depend                                   1
> org.apache.tools.ant.util.mappers                                  1
> org.apache.tools.ant.util.regexp                                   10
> org.apache.tools.mail                                              1
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>