LinuxForHealth / hl7v2-fhir-converter

Converts HL7 v2 Messages to FHIR Resources
Apache License 2.0
89 stars 36 forks source link

Check that configured resource paths are not null #435

Closed CJStadler closed 2 years ago

CJStadler commented 2 years ago

Previously, the String from the configuration would always be passed to Paths.get. On openjdk >=16 passing null to Paths.get throws a NullPointerException (see https://bugs.openjdk.java.net/browse/JDK-8254876), so this would occur if a configuration option was missing. additional.resources.location was not included in the default config.properties, so the NullPointerException was always being thrown.

This change moves the null checks before Paths.get is called. It also adds additional.resources.location to the config.properties, mostly as an example since it is not strictly necessary.

I'm not able to run the test suite with openjdk 17 for unrelated reasons, but I did confirm that if I build from this branch and use that as a dependency in my application I can run it successfully with openjdk 17.

Resolves https://github.com/LinuxForHealth/hl7v2-fhir-converter/issues/427

cragun47 commented 2 years ago

@CJStadler Thank you for your contribution. I'll merge it into master, and we'll pull it into the next release.

We're glad you found this limitation. We see the need to do this for OpenJDK 17, however we're not ready to move to full support for OpenJDK 17 because our devops environments don't yet support it (gradle and other dependencies.)

You will see some adjustments to our support statement that will be more limiting.

CJStadler commented 2 years ago

Thanks so much for your help @cragun47! That makes sense re. OpenJDK 17.