[SPARK-33346][CORE][SQL][MLLIB][DSTREAM][K8S] Change the never changed 'var' to 'val'#31142
[SPARK-33346][CORE][SQL][MLLIB][DSTREAM][K8S] Change the never changed 'var' to 'val'#31142LuciferYang wants to merge 10 commits intoapache:masterfrom
Conversation
|
Kubernetes integration test starting |
|
Kubernetes integration test status success |
|
Test build #133961 has finished for PR 31142 at commit
|
jaceklaskowski
left a comment
There was a problem hiding this comment.
LGTM (non-binding)
|
Test build #133955 has finished for PR 31142 at commit
|
|
@srowen Let me check test dir today |
|
Kubernetes integration test starting |
|
Kubernetes integration test status failure |
|
Test build #134016 has finished for PR 31142 at commit
|
| import org.apache.spark.deploy.DeployTestUtils._ | ||
|
|
||
| @Mock(answer = RETURNS_SMART_NULLS) private var shuffleService: ExternalShuffleService = _ | ||
| @Mock(answer = RETURNS_SMART_NULLS) private val shuffleService: ExternalShuffleService = null |
There was a problem hiding this comment.
Hm, I was going to wonder if we have to leave mocked members as 'var' because the framework will change them. But it looks like tests pass.
There was a problem hiding this comment.
mockito use reflection api to change them, so they can be val, although var seems easier to understand.
So for ease of understanding, we can also not change the case related to @Mock
There was a problem hiding this comment.
Sure, maybe revert those just to be conservative.
|
Test build #134058 has started for PR 31142 at commit |
|
Kubernetes integration test starting |
|
Kubernetes integration test status success |
|
Kubernetes integration test starting |
|
Kubernetes integration test status success |
|
Jenkins retest this please |
|
Test build #134068 has finished for PR 31142 at commit
|
|
retest this please |
|
Test build #134077 has finished for PR 31142 at commit
|
|
Test build #134088 has finished for PR 31142 at commit
|
|
Merged to master |
|
thx~ @srowen and @HyukjinKwon |

What changes were proposed in this pull request?
Some local variables are declared as
var, but they are never reassigned and should be declared asval, so this pr turn these fromvartovalexcept formockitorelated cases.Why are the changes needed?
Use
valinstead ofvarwhen possible.Does this PR introduce any user-facing change?
No
How was this patch tested?
Pass the Jenkins or GitHub Action