Re: RFR: 8266936: Add a finalization JFR event

2021-07-10 Thread Markus Grönlund
On Fri, 9 Jul 2021 18:21:25 GMT, Brent Christian  wrote:

>> Greetings,
>> 
>> Object.finalize() was deprecated in JDK9. There is an ongoing effort to 
>> replace and mitigate Object.finalize() uses in the JDK libraries; please see 
>> https://bugs.openjdk.java.net/browse/JDK-8253568 for more information. 
>> 
>> We would also like to assist users in replacing and mitigating uses in 
>> non-JDK code.
>> 
>> Hence, this changeset adds a periodic JFR event to help identify which 
>> classes are overriding Object.finalize().
>> 
>> Thanks
>> Markus
>
> src/hotspot/share/jfr/metadata/metadata.xml line 1084:
> 
>> 1082:   
>> 1083: 
>> 1084:   > label="Finalizer" thread="false" startTime="false" period="endChunk">
> 
> Would it make sense for this event to be under the "Java Virtual Machine, GC" 
> category?

My argument for placing the event in the Java Application category:

The finalization concept is, or maybe more correctly has been, reified in the 
Java language. The Java programmer decides to enlist the exposed functionality, 
similar to Java language Exceptions and Errors. JFR already represents events 
for these latter concepts in the Java Application category because programmers 
directly interact with and, in contrast to many events in the JVM category, 
have more control over them.

-

PR: https://git.openjdk.java.net/jdk/pull/4731


[jdk17] RFR: 8270025: DynamicCallSiteDesc::withArgs doesn't throw NPE

2021-07-10 Thread Vicente Romero
Please review this PR that is fixing a mismatch between the implementation for 
method `java.lang.constant.DynamicCallSiteDesc::withArgs` and its 
implementation. I made a mistake while working on a recent CSR 
[JDK-8224985](https://bugs.openjdk.java.net/browse/JDK-8224985) and fixed the 
API but mistakenly thought that the implementation was in sync with the spec. 
This is why this change is also including a unit test of the API for 
`java.lang.constant.DynamicCallSiteDesc` module for method 
`resolveCallSiteDesc` which is covered in test `IndyDescTest` in the same test 
suite. Also this change needs a CSR while fixing the implementation of method 
`::withArgs` I realized that the API of the varargs overloaded version of 
method `::of` needed some rewording too as it is invoking the same private 
constructor `::withArgs` is invoking. So it didn't make sense for the API of 
one method to be more restrictive than the other. Please review also the 
accompanying CSR.

Thanks,
Vicente

-

Commit messages:
 - 8270025: DynamicCallSiteDesc.withArgs doesn't throw NPE

Changes: https://git.openjdk.java.net/jdk17/pull/242/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk17&pr=242&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8270025
  Stats: 212 lines in 2 files changed: 210 ins; 0 del; 2 mod
  Patch: https://git.openjdk.java.net/jdk17/pull/242.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk17 pull/242/head:pull/242

PR: https://git.openjdk.java.net/jdk17/pull/242