JDK 15 RFR of JDK-8225540: In core reflection note whether returned annotations are declaration or type annotations

Joe Darcy joe.darcy at oracle.com
Thu Apr 9 17:14:12 UTC 2020


Hi Pavel,

On 4/9/2020 3:46 AM, Pavel Rappo wrote:
>> http://cr.openjdk.java.net/~darcy/8225540.1/
> I'm not an expert in this area, but AFAIK this looks good.
>
> A couple of nits.
>
> 1. The newly added text in the top-level doc comment for AnnotatedElement is missing some <p> tags. It looks nice in source, but it won't be like that in the output. (For better or worse, this is not Markdown.)

That is intentional; I prefer to separate the lines with white-space.


>
> 2. @implSpec for AnnotatedElement.isAnnotationPresent reads pretty unconventionally. There's nothing wrong with that. I simply wonder if there are any reasons why you picked that wording as opposed to the typical "The default implementation calls/returns/performs/etc. ..."? Also, there's a typo: "the the".

Good point; changed to the conventional "The default implementation 
returns $EXPRESSION."


>
> 3. Since we are in this area, would you care to fix a couple of typos?


Why not :-)

>
> diff -r 193e4179def8 src/java.base/share/classes/java/lang/reflect/Modifier.java
> --- a/src/java.base/share/classes/java/lang/reflect/Modifier.java       Wed Apr 08 22:58:42 2020 -0700
> +++ b/src/java.base/share/classes/java/lang/reflect/Modifier.java       Thu Apr 09 11:28:32 2020 +0100
> @@ -377,7 +377,7 @@
>   
>       /**
>        * The Java source modifiers that can be applied to a method.
> -     * @jls8.4.3  Method Modifiers
> +     * @jls 8.4.3 Method Modifiers
>        */
>       private static final int METHOD_MODIFIERS =
>           Modifier.PUBLIC         | Modifier.PROTECTED    | Modifier.PRIVATE |
> @@ -400,9 +400,6 @@
>       private static final int PARAMETER_MODIFIERS =
>           Modifier.FINAL;
>   
> -    /**
> -     *
> -     */
>       static final int ACCESS_MODIFIERS =
>           Modifier.PUBLIC | Modifier.PROTECTED | Modifier.PRIVATE;

Thanks for the review,

-Joe



More information about the core-libs-dev mailing list