Menu

#167 Javancss error when parsing for statement with annotation

open
nobody
None
5
2014-12-07
2011-10-20
Anonymous
No

The code looks like this:
for (@SuppressWarnings("unchecked")
Iterator<String> i = stateModel.getExpandSelection().iterator();
i.hasNext();) {
String previousAbsolutePath = i.next();
String currentAbsolutePath = getCurrentAbsolutePath(
previousAbsolutePath, orgMap);

if (!previousAbsolutePath.equalsIgnoreCase(currentAbsolutePath)) {
i.remove();
}
}

The error message looks like this, where line 506 is the first line in the code above:
[cobertura-report] Encountered " "@" "@ "" at line 506, column 14.
[cobertura-report] Was expecting one of:
[cobertura-report] "assert" ...
[cobertura-report] "boolean" ...
...

Discussion

  • Thomas Jensen

    Thomas Jensen - 2014-05-22

    This should have much higher priority. I have at least one customer who did not choose Cobertura because of this problem.
    The problem is very easy to reproduce: Just use any annotation in the for loop initializer.

     
  • Steven Christou

    Steven Christou - 2014-05-22

    Please log new bugs to the new issue tracker: https://github.com/cobertura/cobertura/issues. This issue tracker is kept here only for backlog.

     

Log in to post a comment.