@@ -115,21 +115,25 @@ class Annotation extends @annotation, Expr {
115115 * Gets a value of the annotation element with the specified `name`, which must be declared as an array
116116 * type. This includes default values in case no explicit value is specified.
117117 *
118- * If the annotation element is defined with an array initializer, then the returned value will
119- * be one of the elements of that array. Otherwise, the returned value will be the single
120- * expression defined for the value.
118+ * If the annotation element is defined with an array initializer, then the result will be one of the
119+ * elements of that array. Otherwise, the result will be the single expression defined for the value.
121120 */
122- Expr getAValue ( string name ) { result = getAValue ( name , _) }
121+ Expr getAnArrayValue ( string name ) { result = getAnArrayValue ( name , _) }
122+
123+ /**
124+ * DEPRECATED: Predicate has been renamed to `getAnArrayValue`
125+ */
126+ deprecated Expr getAValue ( string name ) { result = getAnArrayValue ( name ) }
123127
124128 /**
125129 * Gets the value at a given index of the annotation element with the specified `name`, which must be
126130 * declared as an array type. This includes default values in case no explicit value is specified.
127131 *
128- * If the annotation element is defined with an array initializer, then the returned value will
129- * be the elements at the given index of that array. Otherwise, if the index is 0 the returned value
130- * will be the single expression defined for the value .
132+ * If the annotation element is defined with an array initializer, then the result will be the element
133+ * at the given index of that array. Otherwise, the result will be the single expression defined for
134+ * the value and the `index` will be 0 .
131135 */
132- Expr getAValue ( string name , int index ) {
136+ Expr getAnArrayValue ( string name , int index ) {
133137 this .getType ( ) .getAnnotationElement ( name ) .getType ( ) instanceof Array and
134138 exists ( Expr value | value = this .getValue ( name ) |
135139 if value instanceof ArrayInit
@@ -140,6 +144,11 @@ class Annotation extends @annotation, Expr {
140144 )
141145 }
142146
147+ /**
148+ * DEPRECATED: Predicate has been renamed to `getAnArrayValue`
149+ */
150+ deprecated Expr getAValue ( string name , int index ) { result = getAnArrayValue ( name , index ) }
151+
143152 override string getAPrimaryQlClass ( ) { result = "Annotation" }
144153}
145154
@@ -204,7 +213,7 @@ class Annotatable extends Element {
204213 containerAnn = getADeclaredAnnotation ( ) and
205214 containerAnn .getType ( ) = t .getContainingAnnotationType ( )
206215 |
207- result = containerAnn .getAValue ( "value" )
216+ result = containerAnn .getAnArrayValue ( "value" )
208217 )
209218 }
210219
0 commit comments