Review request for JDK-8251538: Modernize and lint Dynalink code

Remi Forax forax at univ-mlv.fr
Thu Aug 20 21:43:26 UTC 2020


----- Mail original -----
> De: "Attila Szegedi" <szegedia at gmail.com>
> À: "core-libs-dev" <core-libs-dev at openjdk.java.net>
> Envoyé: Jeudi 20 Août 2020 22:40:53
> Objet: Review request for JDK-8251538: Modernize and lint Dynalink code

> Following up on the previous e-mail, here’s the modernization and linting work
> on the existing Dynalink codebase:
> 
> Please review JDK-8251538 "Modernize and lint Dynalink code" at
> <http://cr.openjdk.java.net/~attila/8251538/webrev.jdk16> for
> <https://bugs.openjdk.java.net/browse/JDK-8251538>
> 
> The Jira issue has a full enumeration of kinds of changes I did here; they’re
> mostly all source text removals :-)
> 
> Oh, BTW, I really got an inspiration for adding “public static ClassValue<T>
> computingValue(Function<Class<?>, T> f)” method to ClassValue class, similar to
> Comparator.comparing. It’d allow lambdifying class values. (If you’re
> listening, John :-) I suspect it being in java.lang would be a JCP-level change
> so I kind-of don’t want to take it upon myself…)

this is also very similar to 
https://docs.oracle.com/en/java/javase/14/docs/api/java.base/java/lang/ThreadLocal.html#withInitial(java.util.function.Supplier)

and the proposed signature doesn't have the right wildcards, it should be
  public static ClassValue<T> computingValue(Function<? super Class<?>, ? extends T> f)
  

> 
> Thanks,
>   Attila.

regards,
Rémi


More information about the core-libs-dev mailing list