Uploaded image for project: 'SonarJava'
  1. SonarJava
  2. SONARJAVA-1585

Absent type in static on demand import causes class cast exception

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.12
    • Fix Version/s: 3.12
    • Component/s: Semantic
    • Labels:
      None

      Description

      If a type is not found in a static import, it will be resolved as a ABSENT type.
      As this is also a type, a lookup will be attempted resulting in class cast exception.

      import static java.util.Collections.FOO.*;
      

        Attachments

          Activity

            People

            • Assignee:
              nicolas.peru Nicolas Peru
              Reporter:
              nicolas.peru Nicolas Peru
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved: