-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
questionFurther information is requestedFurther information is requested
Description
Element::getDoc only performs an implicit cast of this:
codeql/java/ql/src/semmle/code/java/Element.qll
Lines 42 to 43 in f9973d1
| /** Cast this element to a `Documentable`. */ | |
| Documentable getDoc() { result = this } |
- This is probably redundant because you can instead write a cast
element.(Document) ... - It is irritating because it suggests that every
Elementcan be 'converted' toDocument, which is not the case - It causes irritating error messages when used on types which cannot be cast to
Document:

Therefore it might be good to deprecate and remove the predicate.
Edit: Package is not a good example for an Element which does not extend Document since it should support documentation, see #5288. Though there are other Element subclasses such as Import or Modifier which cannot be documented in Java.
Relates to #3705
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested