RFR: 7903965: Fix Launching Tests from Context Menu
Oleksii Sylichenko
duke at openjdk.org
Mon Mar 10 13:27:15 UTC 2025
On Mon, 10 Mar 2025 13:23:11 GMT, Oleksii Sylichenko <duke at openjdk.org> wrote:
>> plugins/idea/src/main/java/com/oracle/plugin/jtreg/configuration/producers/JTRegClassConfigurationProducer.java line 73:
>>
>>> 71: if (element instanceof PsiDirectory runDir) {
>>> 72: configuration.setPackage(runDir.getVirtualFile().getPath());
>>> 73: } else {
>>
>> If this producer can now handle directories too, do we still need `JTRegDirectoryConfigurationProducer`?
>>
>> Also, for a directory this would end up calling `nameForElement` -> `element.getContainingFile().getName()`, where `getContainingFile` seemingly returns `null`, so I think that would fail.
>
> `PsiDirectory#getVirtualFile` should not return `null` due to its annotated with `@NotNull`:
>
> 
On the other hand, a file element could produce null for `getVirtualFile()`:

ok, I will add check there
-------------
PR Review Comment: https://git.openjdk.org/jtreg/pull/252#discussion_r1987280068
More information about the jtreg-dev
mailing list