zhan7236 opened a new pull request, #9281: URL: https://github.com/apache/gravitino/pull/9281
### What changes were proposed in this pull request? Use `orElseGet()` instead of `orElse()` when determining the configuration directory in `Config.loadFromFile()`. ### Why are the changes needed? - `orElse()` eagerly evaluates its argument, meaning the fallback expression is computed even when the Optional contains a value. - This causes the lookup and mapping for `GRAVITINO_HOME` to run unnecessarily whenever `GRAVITINO_CONF_DIR` is set. - Using `orElseGet()` with a Supplier lambda ensures the fallback expression is only evaluated when needed. Fixes #9143 ### How was this patch tested? - Compiled successfully with `./gradlew :common:compileJava` - All tests pass with `./gradlew :common:test` and `./gradlew :server:test` -- 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]
