mirror of
https://github.com/github/codeql.git
synced 2026-02-20 00:43:44 +01:00
Java: Deprecate error-prone and rarely used annotation predicates
This commit is contained in:
committed by
Chris Smowton
parent
e3c1b96830
commit
4ef2d156c4
@@ -45,12 +45,18 @@ class Annotation extends @annotation, Expr {
|
||||
}
|
||||
|
||||
/**
|
||||
* DEPRECATED: Getting the value of _any_ annotation element is error-prone because
|
||||
* it could lead to selecting the value of the wrong element by accident (for example
|
||||
* when an annotation type is extended in the future). Prefer the predicate `getValue(string)`
|
||||
* and explicitly specify the element name. Use `getValue(_)` if it is really desired to
|
||||
* get the value of any element.
|
||||
*
|
||||
* Gets a value of an annotation element. This includes default values in case
|
||||
* no explicit value is specified. For elements with an array value type this
|
||||
* might have an `ArrayInit` as result. To properly handle array values, prefer
|
||||
* the predicate `getAnArrayValue`.
|
||||
*/
|
||||
Expr getAValue() { filteredAnnotValue(this, _, result) }
|
||||
deprecated Expr getAValue() { filteredAnnotValue(this, _, result) }
|
||||
|
||||
/**
|
||||
* Gets the value of the annotation element with the specified `name`.
|
||||
|
||||
Reference in New Issue
Block a user