You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by pd...@apache.org on 2021/10/22 06:47:57 UTC

[zeppelin] branch master updated: [ZEPPELIN-5571] Return empty list instead of null

This is an automated email from the ASF dual-hosted git repository.

pdallig pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/zeppelin.git


The following commit(s) were added to refs/heads/master by this push:
     new e9f4119  [ZEPPELIN-5571] Return empty list instead of null
e9f4119 is described below

commit e9f411919a499b03363efc6d064d9b39e945cfe8
Author: Philipp Dallig <ph...@gmail.com>
AuthorDate: Tue Oct 19 17:13:29 2021 +0200

    [ZEPPELIN-5571] Return empty list instead of null
    
    ### What is this PR for?
    This pull request sends an empty list to the zeppelin-web-angular frontend and the variable `settings` is defined with it.
    
    ### What type of PR is it?
     - Bug Fix
    
    ### What is the Jira issue?
    * https://issues.apache.org/jira/browse/ZEPPELIN-5571
    
    ### How should this be tested?
    * Ci
    
    ### Questions:
    * Does the licenses files need update? No
    * Is there breaking changes for older versions? No
    * Does this needs documentation? No
    
    Author: Philipp Dallig <ph...@gmail.com>
    
    Closes #4261 from Reamer/notebookrepo_empty and squashes the following commits:
    
    99721aef9 [Philipp Dallig] Return empty list instead of null
---
 .../org/apache/zeppelin/notebook/repo/FileSystemNotebookRepo.java    | 3 ++-
 .../org/apache/zeppelin/notebook/repo/OldFileSystemNotebookRepo.java | 3 ++-
 .../java/org/apache/zeppelin/notebook/repo/InMemoryNotebookRepo.java | 3 ++-
 .../src/test/java/org/apache/zeppelin/notebook/NotebookTest.java     | 5 +++--
 4 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/zeppelin-plugins/notebookrepo/filesystem/src/main/java/org/apache/zeppelin/notebook/repo/FileSystemNotebookRepo.java b/zeppelin-plugins/notebookrepo/filesystem/src/main/java/org/apache/zeppelin/notebook/repo/FileSystemNotebookRepo.java
index b200364..efa92eb 100644
--- a/zeppelin-plugins/notebookrepo/filesystem/src/main/java/org/apache/zeppelin/notebook/repo/FileSystemNotebookRepo.java
+++ b/zeppelin-plugins/notebookrepo/filesystem/src/main/java/org/apache/zeppelin/notebook/repo/FileSystemNotebookRepo.java
@@ -27,6 +27,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.io.IOException;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -128,7 +129,7 @@ public class FileSystemNotebookRepo implements NotebookRepo {
   @Override
   public List<NotebookRepoSettingsInfo> getSettings(AuthenticationInfo subject) {
     LOGGER.warn("getSettings is not implemented for FileSystemNotebookRepo");
-    return null;
+    return Collections.emptyList();
   }
 
   @Override
diff --git a/zeppelin-plugins/notebookrepo/filesystem/src/main/java/org/apache/zeppelin/notebook/repo/OldFileSystemNotebookRepo.java b/zeppelin-plugins/notebookrepo/filesystem/src/main/java/org/apache/zeppelin/notebook/repo/OldFileSystemNotebookRepo.java
index 378bdc7..4406cda 100644
--- a/zeppelin-plugins/notebookrepo/filesystem/src/main/java/org/apache/zeppelin/notebook/repo/OldFileSystemNotebookRepo.java
+++ b/zeppelin-plugins/notebookrepo/filesystem/src/main/java/org/apache/zeppelin/notebook/repo/OldFileSystemNotebookRepo.java
@@ -11,6 +11,7 @@ import org.slf4j.LoggerFactory;
 
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 
@@ -81,7 +82,7 @@ public class OldFileSystemNotebookRepo implements OldNotebookRepo {
   @Override
   public List<NotebookRepoSettingsInfo> getSettings(AuthenticationInfo subject) {
     LOGGER.warn("getSettings is not implemented for HdfsNotebookRepo");
-    return null;
+    return Collections.emptyList();
   }
 
   @Override
diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/repo/InMemoryNotebookRepo.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/repo/InMemoryNotebookRepo.java
index 187cfc0..1db4fb8 100644
--- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/repo/InMemoryNotebookRepo.java
+++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/repo/InMemoryNotebookRepo.java
@@ -24,6 +24,7 @@ import org.apache.zeppelin.notebook.NoteInfo;
 import org.apache.zeppelin.user.AuthenticationInfo;
 
 import java.io.IOException;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -107,7 +108,7 @@ public class InMemoryNotebookRepo implements NotebookRepo {
 
   @Override
   public List<NotebookRepoSettingsInfo> getSettings(AuthenticationInfo subject) {
-    return null;
+    return Collections.emptyList();
   }
 
   @Override
diff --git a/zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/NotebookTest.java b/zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/NotebookTest.java
index 63a9d4d..ede4d4c 100644
--- a/zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/NotebookTest.java
+++ b/zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/NotebookTest.java
@@ -55,6 +55,7 @@ import java.io.FileWriter;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -184,7 +185,7 @@ public class NotebookTest extends AbstractInterpreterTest implements ParagraphJo
 
     @Override
     public List<NotebookRepoSettingsInfo> getSettings(AuthenticationInfo subject) {
-      return null;
+      return Collections.emptyList();
     }
 
     @Override
@@ -265,7 +266,7 @@ public class NotebookTest extends AbstractInterpreterTest implements ParagraphJo
 
     @Override
     public List<NotebookRepoSettingsInfo> getSettings(AuthenticationInfo subject) {
-      return null;
+      return Collections.emptyList();
     }
 
     @Override