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:  After:  ### Questions: * Does the licenses files need update? No * Is there breaking changes for older versions? No * Does this needs documentation? No Author: Khalid Huseynov <[email protected]> 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 <[email protected]> Authored: Mon Mar 28 00:05:23 2016 +0900 Committer: Alexander Bezzubov <[email protected]> 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); }
