Skip to content

Commit f32b50f

Browse files
authored
[ZEPPELIN-6288] Replace Yoda conditions in InterpreterFactory with standard null checks
### What is this PR for? In `src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java` The codebase contains several instances of Yoda conditions (e.g., `if (null != setting)`) which negatively impact code readability. Additionally, the use of these checks causes inconsistencies with the existing codebase style. So, this improvement aligns the code with the standard null-check style. ### What type of PR is it? Refactoring ### Todos * [x] - Refactor null-check style ### What is the Jira issue? * [ZEPPELIN-6288](https://issues.apache.org/jira/browse/ZEPPELIN-6288) ### How should this be tested? * As this modification involves no functional changes but only coding style improvements, passing existing tests ensures there are no issues. ### Screenshots (if appropriate) ### Questions: * Does the license files need to update? - No * Is there breaking changes for older versions? - No * Does this needs documentation? - No Closes #5037 from hyunw9/origin/ZEPPELIN-6288. Signed-off-by: Philipp Dallig <[email protected]>
1 parent 7b26f92 commit f32b50f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public Interpreter getInterpreter(String replName,
5252
String group = replNameSplits[0];
5353
String name = replNameSplits[1];
5454
InterpreterSetting setting = interpreterSettingManager.getByName(group);
55-
if (null != setting) {
55+
if (setting != null) {
5656
Interpreter interpreter = setting.getInterpreter(executionContext, name);
5757
if (null != interpreter) {
5858
return interpreter;
@@ -74,7 +74,7 @@ public Interpreter getInterpreter(String replName,
7474

7575
// then assume interpreter name is omitted
7676
setting = interpreterSettingManager.getByName(replName);
77-
if (null != setting) {
77+
if (setting != null) {
7878
return setting.getDefaultInterpreter(executionContext);
7979
}
8080
}

0 commit comments

Comments
 (0)