The Wayback Machine - https://web.archive.org/web/20230120133943/https://github.com/github/codeql/issues/4119
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java: Add Import.getATypeImport #4119

Open
Marcono1234 opened this issue Aug 23, 2020 · 0 comments · Fixed by #10498
Open

Java: Add Import.getATypeImport #4119

Marcono1234 opened this issue Aug 23, 2020 · 0 comments · Fixed by #10498
Labels
Java question Further information is requested

Comments

@Marcono1234
Copy link
Contributor

Marcono1234 commented Aug 23, 2020

When working with Javadoc it is often necessary to find out to which type a Javadoc tag refers to. Imports are one way to find this out, however the QL Import class does not define a common predicate to get an imported type despite all import types being able to import types in some way.
It would therefore be useful to add a predicate Import.getATypeImport() which would behave like this:

  • ImportType: getImportedType()
  • ImportStaticTypeMember: getATypeImport()
  • ImportOnDemandFromPackage: getAnImport()
  • ImportOnDemandFromType: getAnImport()
  • ImportStaticOnDemand: getATypeImport()

Edit: As described by #10498 instead of adding this predicate, it might make more sense to have a predicate for CompilationUnit which obtains a type which is available by its simple same in that compilation unit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Java question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants