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)
  • Sonar
  • SONAR-1865

Dollars ($) are not accepted in java class names

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.3
  • Fix Version/s: 2.8
  • Component/s: Squid
  • Labels:
    None
  • Environment:
    GNU/Linux ubuntu 10.10

Description

I have a class with a dollar $ in its name (this is allowed according to http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#40625). Squid treats it as an inner class (which it is not) and displays:

java.lang.IllegalArgumentException: Java inner classes are not supported : pack.Name$Test
at org.sonar.api.resources.JavaFile.<init>(JavaFile.java:93)
at org.sonar.api.resources.JavaFile.<init>(JavaFile.java:80)
at org.sonar.api.batch.SquidUtils.convertJavaFileKeyFromSquidFormat(SquidUtils.java:45)
at org.sonar.plugins.squid.bridges.ResourceIndex.loadSquidFiles(ResourceIndex.java:62)
at org.sonar.plugins.squid.bridges.ResourceIndex.loadSquidResources(ResourceIndex.java:42)
at org.sonar.plugins.squid.SquidExecutor.save(SquidExecutor.java:96)
at org.sonar.plugins.squid.SquidSensor.analyse(SquidSensor.java:82)

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Hide
    Zip Archive
    test_dollar_in_classname_sonar.zip
    15/Oct/10 4:58 AM
    6 kB
    Damien Cassou
    1. Java Source File
      TestDollarInClassNameSonar/.../Name$Test.java 0.1 kB
    2. File
      TestDollarInClassNameSonar/.../Name$Test.class 0.5 kB
    3. XML File
      TestDollarInClassNameSonar/.../sonar-pom.xml 6 kB
    4. File
      TestDollarInClassNameSonar/.../Name$Test.class 0.5 kB
    5. File
      TestDollarInClassNameSonar/.classpath 0.2 kB
    6. File
      TestDollarInClassNameSonar/.project 0.4 kB
    7. XML File
      TestDollarInClassNameSonar/pom.xml 1 kB
    Download Zip
    Show
    Zip Archive
    test_dollar_in_classname_sonar.zip
    15/Oct/10 4:58 AM
    6 kB
    Damien Cassou

Issue Links

is duplicated by

Bug - A problem which impairs or prevents the functions of the product. SONAR-2026 Squid extraction fails in inner class : java.lang.IllegalArgumentException: Java inner classes are not supported

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.
is related to

Bug - A problem which impairs or prevents the functions of the product. SONAR-2677 JUnit tests containing several level of nested inner classes can't be analysed by Sonar

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Damien Cassou added a comment - 15/Oct/10 4:59 AM

I attached a sample project which will show the issue when running 'mvn sonar:sonar'

Show
Damien Cassou added a comment - 15/Oct/10 4:59 AM I attached a sample project which will show the issue when running 'mvn sonar:sonar'
Hide
Permalink
Simon Brandhof added a comment - 03/Jan/11 3:14 AM

The solution is to stop throwing an exception when a java resource contains a '$' character. Indeed, we added this constraint to prevent cobertura and findbugs plugins to store any measures on inner classes but we've updated those two plugins to store measures only on existing resources

Show
Simon Brandhof added a comment - 03/Jan/11 3:14 AM The solution is to stop throwing an exception when a java resource contains a '$' character. Indeed, we added this constraint to prevent cobertura and findbugs plugins to store any measures on inner classes but we've updated those two plugins to store measures only on existing resources

People

  • Assignee:
    Simon Brandhof
    Reporter:
    Damien Cassou
Vote (3)
Watch (3)

Dates

  • Created:
    15/Oct/10 4:58 AM
    Updated:
    16/Aug/11 7:12 AM
    Resolved:
    20/Apr/11 7:31 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.