jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • JavaNCSS
  • JAVANCSS-49

parse error on java 1.7 feature: catching multiple exception types

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: 32.53
  • Labels:
    None

Description

I get the following parse error, when using the cobertura-maven-plugin (2.5.1) with the javancss-maven-plugin (2.0):

[cobertura] WARN [main] net.sourceforge.cobertura.reporting.ComplexityCalculator - JavaNCSS got an error while parsing the java file ... CircleImpl.java
ParseException in STDIN
Last useful checkpoint: "...CircleImpl.main(String[])"
Encountered " "|" "| "" at line 35, column 51.
Was expecting one of:
"assert" ...
"enum" ...
<IDENTIFIER> ...
"..." ...

Report time: 97ms

[ERROR] net.sourceforge.cobertura.javancss.parser.ParseException: Encountered " "|" "| "" at line 35, column 51.
Was expecting one of:
"assert" ...
"enum" ...
<IDENTIFIER> ...
"..." ...

at net.sourceforge.cobertura.javancss.parser.JavaParser.generateParseException(JavaParser.java:10296)
at net.sourceforge.cobertura.javancss.parser.JavaParser.jj_consume_token(JavaParser.java:10172)
at net.sourceforge.cobertura.javancss.parser.JavaParser.VariableDeclaratorId(JavaParser.java:1747)
at net.sourceforge.cobertura.javancss.parser.JavaParser.FormalParameter(JavaParser.java:2225)
at net.sourceforge.cobertura.javancss.parser.JavaParser.TryStatement(JavaParser.java:4631)
at net.sourceforge.cobertura.javancss.parser.JavaParser.Statement(JavaParser.java:3847)
at net.sourceforge.cobertura.javancss.parser.JavaParser.BlockStatement(JavaParser.java:3997)
at net.sourceforge.cobertura.javancss.parser.JavaParser.Block(JavaParser.java:3947)
at net.sourceforge.cobertura.javancss.parser.JavaParser.MethodDeclaration(JavaParser.java:2039)
at net.sourceforge.cobertura.javancss.parser.JavaParser.ClassBodyDeclaration(JavaParser.java:1082)
at net.sourceforge.cobertura.javancss.parser.JavaParser.ClassBody(JavaParser.java:941)
at net.sourceforge.cobertura.javancss.parser.JavaParser.UnmodifiedClassDeclaration(JavaParser.java:854)
at net.sourceforge.cobertura.javancss.parser.JavaParser.ClassDeclaration(JavaParser.java:761)
at net.sourceforge.cobertura.javancss.parser.JavaParser.TypeDeclaration(JavaParser.java:608)
at net.sourceforge.cobertura.javancss.parser.JavaParser.CompilationUnit(JavaParser.java:353)
at net.sourceforge.cobertura.javancss.parser.JavaParser.parse(JavaParser.java:137)
at net.sourceforge.cobertura.javancss.Javancss._measureSource(Javancss.java:256)
at net.sourceforge.cobertura.javancss.Javancss._measureRoot(Javancss.java:339)
at net.sourceforge.cobertura.javancss.Javancss.<init>(Javancss.java:419)
at net.sourceforge.cobertura.reporting.ComplexityCalculator.getAccumlatedCCNForSource(ComplexityCalculator.java:102)
at net.sourceforge.cobertura.reporting.ComplexityCalculator.getAccumlatedCCNForSingleFile(ComplexityCalculator.java:139)
at net.sourceforge.cobertura.reporting.ComplexityCalculator.getCCNForSourceFileNameInternal(ComplexityCalculator.java:224)
at net.sourceforge.cobertura.reporting.ComplexityCalculator.getCCNForPackageInternal(ComplexityCalculator.java:194)
at net.sourceforge.cobertura.reporting.ComplexityCalculator.getCCNForProject(ComplexityCalculator.java:164)
at net.sourceforge.cobertura.reporting.html.HTMLReport.generateTableRowForTotal(HTMLReport.java:704)
at net.sourceforge.cobertura.reporting.html.HTMLReport.generateOverview(HTMLReport.java:336)
at net.sourceforge.cobertura.reporting.html.HTMLReport.generateOverviews(HTMLReport.java:271)
at net.sourceforge.cobertura.reporting.html.HTMLReport.<init>(HTMLReport.java:96)
at net.sourceforge.cobertura.reporting.Main.parseArguments(Main.java:105)
at net.sourceforge.cobertura.reporting.Main.main(Main.java:174)

[INFO] Cobertura Report generation was successful.
[INFO] Generating "Continuous Integration" report — maven-project-info-reports-plugin:2.4
[INFO] Generating "Dependencies" report — maven-project-info-reports-plugin:2.4
[WARNING] The repository url 'http://smalinux01/nexus/content/groups/public' is invalid - Repository 'smartengine-remote-repository' will be blacklisted.
[INFO] Generating "Dependency Convergence" report — maven-project-info-reports-plugin:2.4
[INFO] Generating "About" report — maven-project-info-reports-plugin:2.4
[INFO] Generating "Issue Tracking" report — maven-project-info-reports-plugin:2.4
[INFO] Generating "Project Team" report — maven-project-info-reports-plugin:2.4
[INFO] Generating "Source Repository" report — maven-project-info-reports-plugin:2.4
[INFO] Generating "Project Summary" report — maven-project-info-reports-plugin:2.4
[INFO] Generating "JDepend" report — jdepend-maven-plugin:2.0-beta-2
[INFO] Generating "JavaNCSS Report" report — javancss-maven-plugin:2.0
ParseException in C:\DATA\Workspace\sandbox\sandbox-module2\sandbox-module2-submodule1\src\main\java\at\smartengine\sandbox\CircleImpl.java
Last useful checkpoint: "at.smartengine.sandbox.CircleImpl.main(String[])"
Encountered " "|" "| "" at line 35, column 51.
Was expecting one of:
"assert" ...
"enum" ...
<IDENTIFIER> ...
"..." ...

The code piece uses Java 1.7 catching of multiple exception types:

try { ... } catch (IllegalArgumentException | IllegalStateException e) { ... }
}

Maybe this problem is already solved with the curernt version, but it is not solved for the last release maven plugins:

  • cobertura-maven-plugin (2.5.1)
  • javancss-maven-plugin (2.0)

Activity

  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Roman Cerny added a comment - 07/Nov/11 9:43 AM

http://download.oracle.com/javase/7/docs/technotes/guides/language/catch-multiple.html

Show
Roman Cerny added a comment - 07/Nov/11 9:43 AM http://download.oracle.com/javase/7/docs/technotes/guides/language/catch-multiple.html

People

  • Assignee:
    Unassigned
    Reporter:
    Roman Cerny
Vote (2)
Watch (2)

Dates

  • Created:
    07/Nov/11 9:41 AM
    Updated:
    07/Nov/11 9:43 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.