RFR: 8188075: [Nestmates] Add a core reflection API to get nestmate information

David Holmes david.holmes at oracle.com
Mon Nov 13 11:16:23 UTC 2017


Hi Andrej,

Thanks for taking a look.

On 13/11/2017 6:15 PM, Andrej Golovnin wrote:
> Hi David,
> 
> src/java.base/share/classes/java/lang/Class.java
> 
> 3884         }
> 3885         catch (LinkageError e) {
> 
> The catch keyword should be on the same line as the closing brace of
> the preceding block. For details see
> http://cr.openjdk.java.net/~alundblad/styleguide/index-v6.html#toc-braces

Fixed.

> 3898      * @return true if this class and {@code c} are valid members
> of the same
> 3899      * nest; and false otherwise.
> 
> true and false should be replaced by {@code true} and {@code false}.

Changed - though I note this is not consistently applied in this file. 
(And overall I see by rough grepping 2779 plain cases and 1532 @code 
cases.) :)

> 
> test/hotspot/jtreg/runtime/Nestmates/reflectionAPI/TestReflectionAPI.java
> 
>   190             }
>   191             catch (LinkageError e) {
> 
> The catch keyword should be on the same line as the closing brace of
> the preceding block.

Fixed.

>   228     static Comparator<Class<?>> cmp = new Comparator<Class<?>>() {
>   229             public int compare(Class<?> a, Class<?> b) {
>   230                 return a.getName().compareTo(b.getName());
>   231             }
>   232         };
> 
> Instead of an anonymous class you can use Comparator.comparing(Class::getName).

Great suggestion! I forget about these modern tools :)

Webrev updated in place as these are very simple updates.

Thanks,
David
-----

> Best regards,
> Andrej Golovnin
> 
> On Mon, Nov 13, 2017 at 8:43 AM, David Holmes <david.holmes at oracle.com> wrote:
>> bug: https://bugs.openjdk.java.net/browse/JDK-8188075
>>
>> webrev: http://cr.openjdk.java.net/~dholmes/8188075/webrev.full/index.html
>>
>> The Nestmate core reflection API was discussed on the EG list:
>>
>> http://mail.openjdk.java.net/pipermail/valhalla-spec-experts/2017-November/000411.html
>>
>> so any concerns about the API itself should be discussed there or on the
>> observers list please - thank you.
>>
>> This is the implementation of that API in java.lang.Class and implemented in
>> the JVM, together with an extensive set of tests.
>>
>> Thanks,
>> David



More information about the valhalla-dev mailing list