hiSandog opened a new pull request, #18408: URL: https://github.com/apache/dolphinscheduler/pull/18408
## Was this PR generated or assisted by AI? YES. The implementation and regression test were assisted by Codex. ## Purpose of the pull request `FileUtils.writeContent2File` dereferences `getParentFile()` unconditionally. A valid relative filename such as `output.txt` has no parent component, so the method throws a `NullPointerException` instead of writing the file. ## Brief change log - Guard parent-directory creation when the destination has no parent component. - Add a regression test that writes and cleans up a parentless relative path. ## Verify this pull request This change added tests and was verified as follows: - `./mvnw -q -pl dolphinscheduler-common -Dlombok.version=1.18.36 -Dspotless.skip=true -Dtest=FileUtilsTest test` (9 tests passed; overrides only adapt the local JDK 21 environment) - `./mvnw -q -pl dolphinscheduler-common -Dspotless.version=2.44.3 -DspotlessFiles='src/main/java/org/apache/dolphinscheduler/common/utils/FileUtils.java,src/test/java/org/apache/dolphinscheduler/common/utils/FileUtilsTest.java' spotless:check` - `git diff --check upstream/dev...HEAD` ## Pull Request Notice [Pull Request Notice](https://github.com/apache/dolphinscheduler/blob/dev/docs/docs/en/contribute/join/pull-request.md) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
