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

Andrej Golovnin andrej.golovnin at gmail.com
Mon Nov 13 08:15:19 UTC 2017


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

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}.


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.

 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).

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