Repository: zeppelin
Updated Branches:
  refs/heads/master 54d435303 -> d5528f00c


[ZEPPELIN-1162] Fix rawType in NotebookRestApi

### What is this PR for?
Some HashSet is declared without types. Fix it in NotebookRestApi

### What type of PR is it?
Refactoring

### Todos

### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-1162

### How should this be tested?
All existing test cases related to permissions

### Screenshots (if appropriate)

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

Author: rajarajan-g <[email protected]>

Closes #1341 from rajarajan-g/ZEPPELIN-1162 and squashes the following commits:

87b13f7 [rajarajan-g] fix for rawtype


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

Branch: refs/heads/master
Commit: d5528f00cc11339928b9dce76fb911dffbcddece
Parents: 54d4353
Author: rajarajan-g <[email protected]>
Authored: Thu Aug 18 14:55:52 2016 +0530
Committer: Jongyoul Lee <[email protected]>
Committed: Mon Aug 22 18:55:17 2016 +0900

----------------------------------------------------------------------
 .../java/org/apache/zeppelin/rest/NotebookRestApi.java    | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/d5528f00/zeppelin-server/src/main/java/org/apache/zeppelin/rest/NotebookRestApi.java
----------------------------------------------------------------------
diff --git 
a/zeppelin-server/src/main/java/org/apache/zeppelin/rest/NotebookRestApi.java 
b/zeppelin-server/src/main/java/org/apache/zeppelin/rest/NotebookRestApi.java
index a724003..2f0a825 100644
--- 
a/zeppelin-server/src/main/java/org/apache/zeppelin/rest/NotebookRestApi.java
+++ 
b/zeppelin-server/src/main/java/org/apache/zeppelin/rest/NotebookRestApi.java
@@ -116,8 +116,8 @@ public class NotebookRestApi {
      * TODO(jl): Fixed the type of HashSet
      * https://issues.apache.org/jira/browse/ZEPPELIN-1162
      */
-    HashMap<String, HashSet> permMap =
-        gson.fromJson(req, new TypeToken<HashMap<String, HashSet>>() {
+    HashMap<String, HashSet<String>> permMap =
+        gson.fromJson(req, new TypeToken<HashMap<String, HashSet<String>>>() {
         }.getType());
     Note note = notebook.getNote(noteId);
     String principal = SecurityUtils.getPrincipal();
@@ -133,9 +133,9 @@ public class NotebookRestApi {
           ownerPermissionError(userAndRoles, 
notebookAuthorization.getOwners(noteId))).build();
     }
 
-    HashSet readers = permMap.get("readers");
-    HashSet owners = permMap.get("owners");
-    HashSet writers = permMap.get("writers");
+    HashSet<String> readers = permMap.get("readers");
+    HashSet<String> owners = permMap.get("owners");
+    HashSet<String> writers = permMap.get("writers");
     // Set readers, if writers and owners is empty -> set to user requesting 
the change
     if (readers != null && !readers.isEmpty()) {
       if (writers.isEmpty()) {

Reply via email to