This is an automated email from the ASF dual-hosted git repository.
dongjoon pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/spark-kubernetes-operator.git
The following commit(s) were added to refs/heads/main by this push:
new 4825412 [SPARK-55268] Fix `ConfigOption.getValue` not to invoke
`resolveValue` twice
4825412 is described below
commit 4825412489c85407c4d6b19d5e225feddbf7e3e7
Author: Dongjoon Hyun <[email protected]>
AuthorDate: Thu Jan 29 15:56:32 2026 +0900
[SPARK-55268] Fix `ConfigOption.getValue` not to invoke `resolveValue` twice
### What changes were proposed in this pull request?
This PR aims to fix `ConfigOption.getValue` method to invoke `resolveValue`
only once.
### Why are the changes needed?
Previously, `resolveValue()` is invoked twice at line 58 and 62. We can
remove the second one by reusing `resolvedValue` variable.
https://github.com/apache/spark-kubernetes-operator/blob/fea548118dc4e7daf192595e20cebd8fd5bc12c3/spark-operator/src/main/java/org/apache/spark/k8s/operator/config/ConfigOption.java#L57-L63
### Does this PR introduce _any_ user-facing change?
No behavior change.
### How was this patch tested?
Pass the CIs.
### Was this patch authored or co-authored using generative AI tooling?
Yes (`Opus 4.5` on `Claude Code v2.1.5`)
Closes #473 from dongjoon-hyun/SPARK-55268.
Authored-by: Dongjoon Hyun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
---
.../main/java/org/apache/spark/k8s/operator/config/ConfigOption.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
a/spark-operator/src/main/java/org/apache/spark/k8s/operator/config/ConfigOption.java
b/spark-operator/src/main/java/org/apache/spark/k8s/operator/config/ConfigOption.java
index bcf7260..1130866 100644
---
a/spark-operator/src/main/java/org/apache/spark/k8s/operator/config/ConfigOption.java
+++
b/spark-operator/src/main/java/org/apache/spark/k8s/operator/config/ConfigOption.java
@@ -59,7 +59,7 @@ public class ConfigOption<T> {
if (log.isDebugEnabled()) {
log.debug("Resolved value for property {}={}", key, resolvedValue);
}
- return resolveValue();
+ return resolvedValue;
}
private T resolveValue() {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]