RFR: 7903151: NPE when resolving @library from jtreg plugin

Maurizio Cimadamore mcimadamore at openjdk.java.net
Fri Apr 8 14:32:33 UTC 2022


On Fri, 8 Apr 2022 14:25:21 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> This pathc fixes a trivial NPE which occurs when the plugin is attempting to resolve an absolute library in a `@library` tag. If no library is found starting from TEST.ROOT, and if TEST.ROOT does not specify any alternate library root, the plugin fails with a NPE, as the code is eagerly trimming the property value "external.lib.roots", which might not exist.
> 
> The solution is simple, e.g. check for null before trimming.

plugins/idea/build.gradle line 29:

> 27: // See https://github.com/JetBrains/gradle-intellij-plugin/
> 28: intellij {
> 29:     version = '2021.3.3'

This change to the build was necessary as the 1.0 of the IntelliJ gradle plugin seems to have an issue when working with the latest IntelliJ EAP (which the build downloads so that it can build against it). This problem is documented here:

https://youtrack.jetbrains.com/issue/IDEA-291192

The solution would be to update to plugin version 1.5.2 - but that plugin version still requires an intellij version to be specified manually. I found that by specify the current IntelliJ version as the IntelliJ API we wanna build against, things work just fine, even with the 1.0 plugin.

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

PR: https://git.openjdk.java.net/jtreg/pull/70


More information about the jtreg-dev mailing list