提交 6f717c8c 编写于 作者: E emc

6962494: Update documentation on Executable.getParameterAnnotations()

Summary: Update javadoc comments on getParameterAnnotations to correctly describe its behavior
Reviewed-by: darcy, jfranck
上级 a248acb2
...@@ -428,20 +428,32 @@ public abstract class Executable extends AccessibleObject ...@@ -428,20 +428,32 @@ public abstract class Executable extends AccessibleObject
} }
/** /**
* Returns an array of arrays that represent the annotations on * Returns an array of arrays of {@code Annotation}s that
* the formal parameters, in declaration order, of the executable * represent the annotations on the formal parameters, in
* represented by this object. (Returns an array of length zero if * declaration order, of the {@code Executable} represented by
* the underlying executable is parameterless. If the executable has * this object. Synthetic and mandated parameters (see
* one or more parameters, a nested array of length zero is * explanation below), such as the outer "this" parameter to an
* returned for each parameter with no annotations.) The * inner class constructor will be represented in the returned
* annotation objects contained in the returned arrays are * array. If the executable has no parameters (meaning no formal,
* serializable. The caller of this method is free to modify the * no synthetic, and no mandated parameters), a zero-length array
* returned arrays; it will have no effect on the arrays returned * will be returned. If the {@code Executable} has one or more
* to other callers. * parameters, a nested array of length zero is returned for each
* parameter with no annotations. The annotation objects contained
* in the returned arrays are serializable. The caller of this
* method is free to modify the returned arrays; it will have no
* effect on the arrays returned to other callers.
* *
* @return an array of arrays that represent the annotations on the formal * A compiler may add extra parameters that are implicitly
* parameters, in declaration order, of the executable represented by this * declared in source ("mandated"), as well as parameters that
* object * are neither implicitly nor explicitly declared in source
* ("synthetic") to the parameter list for a method. See {@link
* java.lang.reflect.Parameter} for more information.
*
* @see java.lang.reflect.Parameter
* @see java.lang.reflect.Parameter#getAnnotations
* @return an array of arrays that represent the annotations on
* the formal and implicit parameters, in declaration order, of
* the executable represented by this object
*/ */
public abstract Annotation[][] getParameterAnnotations(); public abstract Annotation[][] getParameterAnnotations();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册