You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by bz...@apache.org on 2016/03/29 07:57:36 UTC

incubator-zeppelin git commit: Fix removing notes without specified interpreter settings

Repository: incubator-zeppelin
Updated Branches:
  refs/heads/master c4917ade1 -> d47418bb4


Fix removing notes without specified interpreter settings

### What is this PR for?
This PR fixes incorrect behavior when trying to remove note without saving its interpreter binding settings.

### What type of PR is it?
Bug Fix

### Todos
* [x] - don't let null return value

### What is the Jira issue?
[ZEPPELIN-765] (https://issues.apache.org/jira/browse/ZEPPELIN-765)

### How should this be tested?
Try to remove some notebook without saving its interpreter bindings when first entering it

### Screenshots (if appropriate)
Before:
![remove_before](https://cloud.githubusercontent.com/assets/1642088/14064278/8f1737ea-f438-11e5-978c-44cdaddfd94f.gif)

After:
![remove_after](https://cloud.githubusercontent.com/assets/1642088/14064281/9a034e6e-f438-11e5-999f-e4cc802b234a.gif)

### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No

Author: Khalid Huseynov <kh...@nflabs.com>

Closes #798 from khalidhuseynov/fix/remove-note-binding-npe and squashes the following commits:

4efb77b [Khalid Huseynov] fix warning
71a0308 [Khalid Huseynov] dont return null for bindings


Project: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/commit/d47418bb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/tree/d47418bb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/diff/d47418bb

Branch: refs/heads/master
Commit: d47418bb4fecc8587da8cebd70d99cf34f6eb288
Parents: c4917ad
Author: Khalid Huseynov <kh...@nflabs.com>
Authored: Mon Mar 28 00:05:23 2016 +0900
Committer: Alexander Bezzubov <bz...@apache.org>
Committed: Tue Mar 29 14:57:25 2016 +0900

----------------------------------------------------------------------
 .../java/org/apache/zeppelin/interpreter/InterpreterFactory.java  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/d47418bb/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java
----------------------------------------------------------------------
diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java
index f0fa385..7df7bb3 100644
--- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java
+++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java
@@ -627,7 +627,8 @@ public class InterpreterFactory {
 
   public void removeNoteInterpreterSettingBinding(String noteId) {
     synchronized (interpreterSettings) {
-      List<String> settingIds = interpreterBindings.remove(noteId);
+      List<String> settingIds = (interpreterBindings.containsKey(noteId) ?
+          interpreterBindings.remove(noteId) : Collections.<String>emptyList());
       for (String settingId : settingIds) {
         this.removeInterpretersForNote(get(settingId), noteId);
       }