Re: RFR: 8266936: Add a finalization JFR event

2021-05-18 Thread Istvan Neuwirth
On Tue, 18 May 2021 20:55:10 GMT, Brent Christian  wrote:

> Please review this enhancement to add a new JFR event, generated whenever a 
> finalizer is run.
> (The makeup is similar to the Deserialization event, 
> [JDK-8261160](https://bugs.openjdk.java.net/browse/JDK-8261160).)
> 
> The event's only datum (beyond those common to all jfr events) is the class 
> of the object that was finalized.
> 
> The Category for the event:
> `"Java Virtual Machine" / "GC" / "Finalization"`
> is what made sense to me, even though the event is generated from library 
> code.
> 
> Along with the new regtest, I added a run mode to the basic finalizer test to 
> enable jfr.
> Automated testing looks good so far.
> 
> Thanks,
> -Brent

test/jdk/jdk/jfr/event/gc/finalization/TestFinalizerEvent.java line 48:

> 46: 
> 47: public class TestFinalizerEvent {
> 48: static boolean finalizerRun = false;

Should not this be a `volatile` field? (Or alternatively, using 
`AtomicBoolean`). As the `finalize` is invoked on the finalizer thread, the 
other thread executing the test might not see the change.

-

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


Re: RFR: 8266846: Add java.time.InstantSource

2021-05-15 Thread Istvan Neuwirth
On Thu, 13 May 2021 20:52:33 GMT, Stephen Colebourne  
wrote:

> 8266846: Add java.time.InstantSource

src/java.base/share/classes/java/time/InstantSource.java line 93:

> 91:  * @since 17
> 92:  */
> 93: public interface InstantSource {

Should not we add `@FunctionalInterface`? I can easily imagine this interface 
being used in tests where we can define the `InstantSource` with lambdas.

-

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