[ 
http://jira.codehaus.org/browse/MJNCSS-16?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=130366#action_130366
 ] 

Peter Franzen commented on MJNCSS-16:
-------------------------------------

Hmmm, I checked for a new version a few days ago before deciding to have a go 
at it myself....oh, well.

It looks like version 29.50 fixes the problem, although there is no difference 
between the grammar
files in the 28.49 and 29.50 distributions as far as I can tell.

I also discovered that my proposed fix is a bit too liberal, it accepts 
constructs of the type

    private void myMethod()
    {
        java.util.List<String> s;
        @SuppressWarnings("unchecked")
        s = getList();
    }

which I don't think is allowed after having studied JLS a bit more thoroughly. 
If the first
part of the diff is removed, i.e.

2210a2211,2212
> |
>   Annotation()

the above construct no longer parses.



> java annotations (within a method) cannot be parsed correctly
> -------------------------------------------------------------
>
>                 Key: MJNCSS-16
>                 URL: http://jira.codehaus.org/browse/MJNCSS-16
>             Project: Maven 2.x JavaNCSS Plugin
>          Issue Type: Bug
>    Affects Versions: 2.0-beta-2
>            Reporter: Roman Cerny
>            Assignee: Jean-Laurent de Morlhon
>         Attachments: Java1.1.jj.diff.txt
>
>
> the following code segment cannot be parsed correctly:
> public int myMethod()
> {
>     int i = 1;
>     @SuppressWarnings("unused")
>     int notUsedVariable = 2;
>     return i;
> }
> leads to following error:
> Encountered "@ SuppressWarnings ( \"unused\" ) int notUsedVariable =" at line 
> xxx, column yyy.
> Was expecting one of:
>     "assert" ...
>     "boolean" ...
>     "byte" ...
>     "char" ...
>     "double" ...
>     "enum" ...
>     "final" ...
>     "float" ...
>     "int" ...
>     "long" ...
>     "short" ...
>      ...
>     "public" ...
>     "static" ...
>     "protected" ...
>     "private" ...
>     "abstract" ...
>     "synchronized" ...
>     "native" ...
>     "transient" ...
>     "volatile" ...
>     "strictfp" ...
>     "@" "enum" ...
>     "@"  "." ...
>     "@"  "("  ...
>     "@"  "(" ")" ...
>     "@"  "(" "@" ...
>     "@"  "(" "{" ...
>     "@"  "(" "+" ...
>     "@"  "(" "-" ...
>     "@"  "(" "++" ...
>     "@"  "(" "--" ...
>     "@"  "(" "~" ...
>     "@"  "(" "!" ...
>     "@"  "(" "(" ...
>     "@"  "("  ...
>     "@"  "("  ...
>     "@"  "("  ...
>     "@"  "("  "." ...
>     "@"  "("  "[" ...
>     "@"  "("  "(" ...
>     "@"  "("  "++" ...
>     "@"  "("  "--" ...
>     "@"  "("  "*" ...
>     "@"  "("  "/" ...
>     "@"  "("  "%" ...
>     "@"  "("  "+" ...
>     "@"  "("  "-" ...
>     "@"  "("  "<<" ...
>     "@"  "("  ">>" ...
>     "@"  "("  ">>>" ...
>     "@"  "("  "<" ...
>     "@"  "("  ">" ...
>     "@"  "("  "<=" ...
>     "@"  "("  ">=" ...
>     "@"  "("  "instanceof" ...
>     "@"  "("  "==" ...
>     "@"  "("  "!=" ...
>     "@"  "("  "&" ...
>     "@"  "("  "^" ...
>     "@"  "("  "|" ...
>     "@"  "("  "&&" ...
>     "@"  "("  "||" ...
>     "@"  "("  "?" ...
>     "@"  "("  ")" "public" ...
>     "@"  "("  ")" "static" ...
>     "@"  "("  ")" "protected" ...
>     "@"  "("  ")" "private" ...
>     "@"  "("  ")" "final" ...
>     "@"  "("  ")" "abstract" ...
>     "@"  "("  ")" "synchronized" ...
>     "@"  "("  ")" "native" ...
>     "@"  "("  ")" "transient" ...
>     "@"  "("  ")" "volatile" ...
>     "@"  "("  ")" "strictfp" ...
>     "@"  "("  ")" "@" ...
>     "@"  "("  ")" "boolean" ...
>     "@"  "("  ")" "char" ...
>     "@"  "("  ")" "byte" ...
>     "@"  "("  ")" "short" ...
>     "@"  "("  ")" "int" ...
>     "@"  "("  ")" "long" ...
>     "@"  "("  ")" "float" ...
>     "@"  "("  ")" "double" ...
>     "@"  "("  ")" "enum" ...
>     "@"  "("  ")"  "." ...
>     "@"  "("  ")"  "<" ...
>     "@"  "("  ")"  "[" ...
>     "@"  "("  ")"  "enum" ...
>     "@"  "("  ")"   ";" ...
>     "@"  "("  ")"   "=" ...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to