On Tue, 11 Apr 2023 18:17:06 GMT, Leonid Mesnik <lmes...@openjdk.org> wrote:

> The plugin which support execution of test's main method in separate virtual 
> thread is added.
> The plugin is built as a part of test image and might be used in testing by 
> adding JTREG_TEST_THREAD_FACTORY=Virtual option.

test/jtreg_test_thread_factory/src/share/classes/Virtual.java line 8:

> 6:  * under the terms of the GNU General Public License version 2 only, as
> 7:  * published by the Free Software Foundation.  Oracle designates this
> 8:  * particular file as subject to the "Classpath" exception as provided

Hello Leonid, is this file expected to have a Classpath exception or should it 
have the same license header that we use for test files?

test/jtreg_test_thread_factory/src/share/classes/Virtual.java line 35:

> 33:             System.setProperty("main.wrapper", "Virtual");
> 34:         } catch (Throwable t) {
> 35:             // might be thrown by security manager

Since tests can be launched in presence of a security manager, would that mean 
that when security manager is enabled, the `main.wrapper` will not get set? 
Would that have any impact on the functioning of the test?

test/jtreg_test_thread_factory/src/share/classes/Virtual.java line 46:

> 44:     public Thread newThread(Runnable task) {
> 45:         try {
> 46:             return Thread.ofVirtual().factory().newThread(task);

As far as I can see, none of these method calls throw a checked exception. 
Should we perhaps remove this try/catch block and let any runtime exception 
that gets thrown be propagated as-is instead of wrapping it in a 
`RuntimException`?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/13432#discussion_r1169503122
PR Review Comment: https://git.openjdk.org/jdk/pull/13432#discussion_r1169504400
PR Review Comment: https://git.openjdk.org/jdk/pull/13432#discussion_r1169505814

Reply via email to