Skip to content

Java: Javadoc.getCommentedElement() returns bogus MetricElement & Annotatable #5289

@Marcono1234

Description

@Marcono1234

Relates to #3698

For some projects the predicate Javadoc.getCommentedElement() returns some bogus element whose only QL classes are MetricElement and Annotatable, and which has no toString():

import java

from Javadoc javadoc, Top commentedElement, boolean hasToString, boolean hasLocation
where
  commentedElement = javadoc.getCommentedElement()
  and forall(string qlClass | qlClass = commentedElement.getAQlClass() |
    qlClass = ["MetricElement", "Annotatable"]
  )
  and if exists(commentedElement.toString()) then hasToString = true else hasToString = false
  and if exists(commentedElement.getLocation()) then hasLocation = true else hasLocation = false
select javadoc, commentedElement.getAPrimaryQlClass(), hasToString, hasLocation

Query console link

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions