zeppelin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From felixche...@apache.org
Subject [5/5] zeppelin git commit: ZEPPELIN-3140. Fixed Checkstyle issues in zeppelin-server
Date Thu, 05 Apr 2018 06:10:01 GMT
ZEPPELIN-3140. Fixed Checkstyle issues in zeppelin-server

### What is this PR for?
Fixed Checkstyle issues in zeppelin-server module.

### What type of PR is it?
Improvement

### Todos
* [ ] - Task

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

### How should this be tested?
* CI pass

### 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: Jan Hentschel <jan.hentschel@ultratendency.com>

Closes #2902 from HorizonNet/ZEPPELIN-3140 and squashes the following commits:

98ceb92 [Jan Hentschel] ZEPPELIN-3140. Addressed review comment
c75b693 [Jan Hentschel] ZEPPELIN-3140. Fixed review comments
23a3a4d [Jan Hentschel] ZEPPELIN-3140. Fixed Checkstyle issues in zeppelin-server


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

Branch: refs/heads/master
Commit: 1add74b4b2a1c7fb63b8249b9574ac3e148d3b81
Parents: fe07e5a
Author: Jan Hentschel <jan.hentschel@ultratendency.com>
Authored: Mon Apr 2 15:07:48 2018 +0200
Committer: Felix Cheung <felixcheung@apache.org>
Committed: Wed Apr 4 23:09:44 2018 -0700

----------------------------------------------------------------------
 zeppelin-server/pom.xml                         |   7 +
 .../realm/ActiveDirectoryGroupRealm.java        |  63 ++--
 .../apache/zeppelin/realm/LdapGroupRealm.java   |  21 +-
 .../org/apache/zeppelin/realm/LdapRealm.java    |  54 ++-
 .../org/apache/zeppelin/realm/PamRealm.java     |  11 +-
 .../apache/zeppelin/realm/UserPrincipal.java    |   2 +-
 .../apache/zeppelin/realm/ZeppelinHubRealm.java |  48 +--
 .../realm/jwt/JWTAuthenticationToken.java       |   3 +-
 .../realm/jwt/KnoxAuthenticationFilter.java     |  13 +-
 .../apache/zeppelin/realm/jwt/KnoxJwtRealm.java |  60 ++--
 .../zeppelin/realm/jwt/PrincipalMapper.java     |  13 +-
 .../realm/jwt/PrincipalMappingException.java    |   5 +-
 .../zeppelin/rest/ConfigurationsRestApi.java    |  16 +-
 .../apache/zeppelin/rest/CredentialRestApi.java |  64 ++--
 .../org/apache/zeppelin/rest/GetUserList.java   |  52 +--
 .../org/apache/zeppelin/rest/HeliumRestApi.java |  72 ++--
 .../zeppelin/rest/InterpreterRestApi.java       |  38 +--
 .../org/apache/zeppelin/rest/LoginRestApi.java  |  29 +-
 .../zeppelin/rest/NotebookRepoRestApi.java      |  20 +-
 .../apache/zeppelin/rest/NotebookRestApi.java   | 212 ++++++------
 .../apache/zeppelin/rest/SecurityRestApi.java   |  39 ++-
 .../apache/zeppelin/rest/ZeppelinRestApi.java   |  12 +-
 .../rest/exception/BadRequestException.java     |   6 +-
 .../rest/exception/ForbiddenException.java      |   3 -
 .../zeppelin/rest/message/CronRequest.java      |   9 +-
 .../message/NewInterpreterSettingRequest.java   |   7 +-
 .../zeppelin/rest/message/NewNoteRequest.java   |  10 +-
 .../rest/message/NewParagraphRequest.java       |   9 +-
 .../message/NotebookRepoSettingsRequest.java    |   6 +-
 .../rest/message/RestartInterpreterRequest.java |   5 +-
 .../RunParagraphWithParametersRequest.java      |   7 +-
 .../UpdateInterpreterSettingRequest.java        |   6 +-
 .../rest/message/UpdateParagraphRequest.java    |   6 +-
 .../org/apache/zeppelin/server/CorsFilter.java  |  10 +-
 .../zeppelin/server/JsonExclusionStrategy.java  |   6 -
 .../apache/zeppelin/server/JsonResponse.java    |   8 +-
 .../apache/zeppelin/server/ZeppelinServer.java  |  65 ++--
 .../apache/zeppelin/socket/NotebookServer.java  | 335 +++++++++----------
 .../apache/zeppelin/socket/NotebookSocket.java  |  12 +-
 .../zeppelin/socket/NotebookSocketListener.java |   2 +-
 .../zeppelin/types/InterpreterSettingsList.java |   3 +-
 .../utils/AnyOfRolesAuthorizationFilter.java    |   7 +-
 .../apache/zeppelin/utils/CommandLineUtils.java |   6 +-
 .../zeppelin/utils/InterpreterBindingUtils.java |  10 +-
 .../apache/zeppelin/utils/SecurityUtils.java    |  38 +--
 .../org/apache/zeppelin/ZeppelinITUtils.java    |   7 +-
 .../configuration/RequestHeaderSizeTest.java    |  65 ++--
 .../zeppelin/display/AngularObjectBuilder.java  |   4 +-
 .../apache/zeppelin/realm/LdapRealmTest.java    |  81 ++---
 .../org/apache/zeppelin/realm/PamRealmTest.java |  30 +-
 .../apache/zeppelin/recovery/RecoveryTest.java  |  37 +-
 .../zeppelin/rest/AbstractTestRestApi.java      | 151 +++++----
 .../rest/ConfigurationsRestApiTest.java         |   6 +-
 .../zeppelin/rest/CredentialsRestApiTest.java   |  31 +-
 .../apache/zeppelin/rest/HeliumRestApiTest.java | 333 +++++++++---------
 .../zeppelin/rest/InterpreterRestApiTest.java   |  98 +++---
 .../apache/zeppelin/rest/KnoxRestApiTest.java   |  16 +-
 .../zeppelin/rest/NotebookRepoRestApiTest.java  |  44 ++-
 .../zeppelin/rest/NotebookRestApiTest.java      |  74 ++--
 .../rest/NotebookSecurityRestApiTest.java       |  72 ++--
 .../zeppelin/rest/SecurityRestApiTest.java      |  12 +-
 .../zeppelin/rest/ZeppelinRestApiTest.java      | 137 ++++----
 .../zeppelin/rest/ZeppelinSparkClusterTest.java |  66 ++--
 .../apache/zeppelin/security/DirAccessTest.java |  11 +-
 .../zeppelin/security/SecurityUtilsTest.java    |  37 +-
 .../apache/zeppelin/server/CorsFilterTest.java  | 105 +++---
 .../zeppelin/socket/NotebookServerTest.java     |  78 +++--
 .../zeppelin/ticket/TicketContainerTest.java    |  21 +-
 .../src/test/resources/log4j.properties         |   2 +-
 69 files changed, 1470 insertions(+), 1478 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/1add74b4/zeppelin-server/pom.xml
----------------------------------------------------------------------
diff --git a/zeppelin-server/pom.xml b/zeppelin-server/pom.xml
index fc6d0dd..411a97f 100644
--- a/zeppelin-server/pom.xml
+++ b/zeppelin-server/pom.xml
@@ -423,6 +423,13 @@
         <artifactId>maven-dependency-plugin</artifactId>
       </plugin>
 
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <configuration>
+          <skip>false</skip>
+        </configuration>
+      </plugin>
     </plugins>
   </build>
 

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/1add74b4/zeppelin-server/src/main/java/org/apache/zeppelin/realm/ActiveDirectoryGroupRealm.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/main/java/org/apache/zeppelin/realm/ActiveDirectoryGroupRealm.java b/zeppelin-server/src/main/java/org/apache/zeppelin/realm/ActiveDirectoryGroupRealm.java
index 4f3626c..3ca8c4e 100644
--- a/zeppelin-server/src/main/java/org/apache/zeppelin/realm/ActiveDirectoryGroupRealm.java
+++ b/zeppelin-server/src/main/java/org/apache/zeppelin/realm/ActiveDirectoryGroupRealm.java
@@ -20,15 +20,14 @@ import org.apache.commons.lang.StringUtils;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.security.alias.CredentialProvider;
 import org.apache.hadoop.security.alias.CredentialProviderFactory;
+import org.apache.shiro.authc.AuthenticationException;
 import org.apache.shiro.authc.AuthenticationInfo;
 import org.apache.shiro.authc.AuthenticationToken;
 import org.apache.shiro.authc.SimpleAuthenticationInfo;
 import org.apache.shiro.authc.UsernamePasswordToken;
-import org.apache.shiro.authc.AuthenticationException;
 import org.apache.shiro.authz.AuthorizationException;
 import org.apache.shiro.authz.AuthorizationInfo;
 import org.apache.shiro.authz.SimpleAuthorizationInfo;
-import org.apache.shiro.realm.Realm;
 import org.apache.shiro.realm.ldap.AbstractLdapRealm;
 import org.apache.shiro.realm.ldap.DefaultLdapContextFactory;
 import org.apache.shiro.realm.ldap.LdapContextFactory;
@@ -37,6 +36,16 @@ import org.apache.shiro.subject.PrincipalCollection;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
@@ -44,11 +53,9 @@ import javax.naming.directory.Attributes;
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 import javax.naming.ldap.LdapContext;
-import java.util.*;
-
 
 /**
- * A {@link Realm} that authenticates with an active directory LDAP
+ * A {@link org.apache.shiro.realm.Realm} that authenticates with an active directory LDAP
  * server to determine the roles for a particular user.  This implementation
  * queries for the user's groups and then maps the group names to roles using the
  * {@link #groupRolesMap}.
@@ -56,22 +63,17 @@ import java.util.*;
  * @since 0.1
  */
 public class ActiveDirectoryGroupRealm extends AbstractLdapRealm {
-
   private static final Logger log = LoggerFactory.getLogger(ActiveDirectoryGroupRealm.class);
 
   private static final String ROLE_NAMES_DELIMETER = ",";
 
-  String KEYSTORE_PASS = "activeDirectoryRealm.systemPassword";
+  final String keystorePass = "activeDirectoryRealm.systemPassword";
   private String hadoopSecurityCredentialPath;
 
   public void setHadoopSecurityCredentialPath(String hadoopSecurityCredentialPath) {
     this.hadoopSecurityCredentialPath = hadoopSecurityCredentialPath;
   }
 
-    /*--------------------------------------------
-    |    I N S T A N C E   V A R I A B L E S    |
-    ============================================*/
-
   /**
    * Mapping from fully qualified active directory
    * group names (e.g. CN=Group,OU=Company,DC=MyDomain,DC=local)
@@ -79,18 +81,10 @@ public class ActiveDirectoryGroupRealm extends AbstractLdapRealm {
    */
   private Map<String, String> groupRolesMap;
 
-    /*--------------------------------------------
-    |         C O N S T R U C T O R S           |
-    ============================================*/
-
   public void setGroupRolesMap(Map<String, String> groupRolesMap) {
     this.groupRolesMap = groupRolesMap;
   }
 
-    /*--------------------------------------------
-    |               M E T H O D S               |
-    ============================================*/
-
   LdapContextFactory ldapContextFactory;
 
   protected void onInit() {
@@ -117,7 +111,7 @@ public class ActiveDirectoryGroupRealm extends AbstractLdapRealm {
   }
 
   protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token)
-      throws AuthenticationException {
+          throws AuthenticationException {
     try {
       AuthenticationInfo info = this.queryForAuthenticationInfo(token,
           this.getLdapContextFactory());
@@ -150,16 +144,15 @@ public class ActiveDirectoryGroupRealm extends AbstractLdapRealm {
       try {
         Configuration configuration = new Configuration();
         configuration.set(CredentialProviderFactory.CREDENTIAL_PROVIDER_PATH,
-          this.hadoopSecurityCredentialPath);
-        CredentialProvider provider =
-          CredentialProviderFactory.getProviders(configuration).get(0);
+                this.hadoopSecurityCredentialPath);
+        CredentialProvider provider = CredentialProviderFactory.getProviders(configuration).get(0);
         CredentialProvider.CredentialEntry credEntry = provider.getCredentialEntry(
-            KEYSTORE_PASS);
+                keystorePass);
         if (credEntry != null) {
           password = new String(credEntry.getCredential());
         }
       } catch (Exception e) {
-
+        log.debug("ignored error from getting credential entry from keystore", e);
       }
     }
     return password;
@@ -177,9 +170,8 @@ public class ActiveDirectoryGroupRealm extends AbstractLdapRealm {
    * @return an {@link AuthenticationInfo} instance containing information retrieved from LDAP.
    * @throws NamingException if any LDAP errors occur during the search.
    */
-  protected AuthenticationInfo queryForAuthenticationInfo(
-      AuthenticationToken token, LdapContextFactory ldapContextFactory) throws NamingException {
-
+  protected AuthenticationInfo queryForAuthenticationInfo(AuthenticationToken token,
+          LdapContextFactory ldapContextFactory) throws NamingException {
     UsernamePasswordToken upToken = (UsernamePasswordToken) token;
 
     // Binds using the username and password provided by the user.
@@ -222,7 +214,6 @@ public class ActiveDirectoryGroupRealm extends AbstractLdapRealm {
     return new SimpleAuthenticationInfo(username, password, getName());
   }
 
-
   /**
    * Builds an {@link org.apache.shiro.authz.AuthorizationInfo} object by querying the active
    * directory LDAP context for the groups that a user is a member of.  The groups are then
@@ -239,10 +230,8 @@ public class ActiveDirectoryGroupRealm extends AbstractLdapRealm {
    * @return the AuthorizationInfo for the given Subject principal.
    * @throws NamingException if an error occurs when searching the LDAP server.
    */
-  protected AuthorizationInfo queryForAuthorizationInfo(
-      PrincipalCollection principals,
-      LdapContextFactory ldapContextFactory) throws NamingException {
-
+  protected AuthorizationInfo queryForAuthorizationInfo(PrincipalCollection principals,
+          LdapContextFactory ldapContextFactory) throws NamingException {
     String username = (String) getAvailablePrincipal(principals);
 
     // Perform context search
@@ -263,8 +252,8 @@ public class ActiveDirectoryGroupRealm extends AbstractLdapRealm {
     return new SimpleAuthorizationInfo(roleNames);
   }
 
-  public List<String> searchForUserName(String containString, LdapContext ldapContext) throws
-      NamingException {
+  public List<String> searchForUserName(String containString, LdapContext ldapContext)
+          throws NamingException {
     List<String> userNameList = new ArrayList<>();
 
     SearchControls searchCtls = new SearchControls();
@@ -308,7 +297,7 @@ public class ActiveDirectoryGroupRealm extends AbstractLdapRealm {
   }
 
   private Set<String> getRoleNamesForUser(String username, LdapContext ldapContext)
-      throws NamingException {
+          throws NamingException {
     Set<String> roleNames = new LinkedHashSet<>();
 
     SearchControls searchCtls = new SearchControls();
@@ -385,6 +374,4 @@ public class ActiveDirectoryGroupRealm extends AbstractLdapRealm {
     }
     return roleNames;
   }
-
 }
-

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/1add74b4/zeppelin-server/src/main/java/org/apache/zeppelin/realm/LdapGroupRealm.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/main/java/org/apache/zeppelin/realm/LdapGroupRealm.java b/zeppelin-server/src/main/java/org/apache/zeppelin/realm/LdapGroupRealm.java
index 4133ce0..cdc2c22 100644
--- a/zeppelin-server/src/main/java/org/apache/zeppelin/realm/LdapGroupRealm.java
+++ b/zeppelin-server/src/main/java/org/apache/zeppelin/realm/LdapGroupRealm.java
@@ -24,6 +24,10 @@ import org.apache.shiro.subject.PrincipalCollection;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.util.HashSet;
+import java.util.LinkedHashSet;
+import java.util.Set;
+
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
@@ -31,30 +35,23 @@ import javax.naming.directory.Attributes;
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 import javax.naming.ldap.LdapContext;
-import java.util.HashSet;
-import java.util.LinkedHashSet;
-import java.util.Set;
-
 
 /**
- * Created for org.apache.zeppelin.server on 09/06/16.
+ * Created for org.apache.zeppelin.server.
  */
 public class LdapGroupRealm extends JndiLdapRealm {
   private static final Logger LOG = LoggerFactory.getLogger(LdapGroupRealm.class);
 
-  public AuthorizationInfo queryForAuthorizationInfo(
-      PrincipalCollection principals,
-      LdapContextFactory ldapContextFactory) throws NamingException {
+  public AuthorizationInfo queryForAuthorizationInfo(PrincipalCollection principals,
+          LdapContextFactory ldapContextFactory) throws NamingException {
     String username = (String) getAvailablePrincipal(principals);
     LdapContext ldapContext = ldapContextFactory.getSystemLdapContext();
     Set<String> roleNames = getRoleNamesForUser(username, ldapContext, getUserDnTemplate());
     return new SimpleAuthorizationInfo(roleNames);
   }
 
-
-  public Set<String> getRoleNamesForUser(String username,
-                                         LdapContext ldapContext,
-                                         String userDnTemplate) throws NamingException {
+  public Set<String> getRoleNamesForUser(String username, LdapContext ldapContext,
+          String userDnTemplate) throws NamingException {
     try {
       Set<String> roleNames = new LinkedHashSet<>();
 

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/1add74b4/zeppelin-server/src/main/java/org/apache/zeppelin/realm/LdapRealm.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/main/java/org/apache/zeppelin/realm/LdapRealm.java b/zeppelin-server/src/main/java/org/apache/zeppelin/realm/LdapRealm.java
index b41ac68..c6359e5 100644
--- a/zeppelin-server/src/main/java/org/apache/zeppelin/realm/LdapRealm.java
+++ b/zeppelin-server/src/main/java/org/apache/zeppelin/realm/LdapRealm.java
@@ -16,7 +16,6 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-
 package org.apache.zeppelin.realm;
 
 import org.apache.shiro.SecurityUtils;
@@ -53,6 +52,7 @@ import java.util.Set;
 import java.util.StringTokenizer;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
+
 import javax.naming.AuthenticationException;
 import javax.naming.Context;
 import javax.naming.NamingEnumeration;
@@ -67,7 +67,6 @@ import javax.naming.ldap.LdapContext;
 import javax.naming.ldap.LdapName;
 import javax.naming.ldap.PagedResultsControl;
 
-
 /**
  * Implementation of {@link org.apache.shiro.realm.ldap.JndiLdapRealm} that also
  * returns each user's groups. This implementation is heavily based on
@@ -127,7 +126,6 @@ import javax.naming.ldap.PagedResultsControl;
  * 
  */
 public class LdapRealm extends JndiLdapRealm {
-
   private static final SearchControls SUBTREE_SCOPE = new SearchControls();
   private static final SearchControls ONELEVEL_SCOPE = new SearchControls();
   private static final SearchControls OBJECT_SCOPE = new SearchControls();
@@ -142,13 +140,12 @@ public class LdapRealm extends JndiLdapRealm {
   private static final String MATCHING_RULE_IN_CHAIN_FORMAT = 
       "(&(objectClass=%s)(%s:1.2.840.113556.1.4.1941:=%s))";
 
-  private static Pattern TEMPLATE_PATTERN = Pattern.compile("\\{(\\d+?)\\}");
-  private static String DEFAULT_PRINCIPAL_REGEX = "(.*)";
+  private static final Pattern TEMPLATE_PATTERN = Pattern.compile("\\{(\\d+?)\\}");
+  private static final String DEFAULT_PRINCIPAL_REGEX = "(.*)";
   private static final String MEMBER_SUBSTITUTION_TOKEN = "{0}";
   private static final String HASHING_ALGORITHM = "SHA-1";
   private static final Logger log = LoggerFactory.getLogger(LdapRealm.class);
 
-
   static {
     SUBTREE_SCOPE.setSearchScope(SearchControls.SUBTREE_SCOPE);
     ONELEVEL_SCOPE.setSearchScope(SearchControls.ONELEVEL_SCOPE);
@@ -169,7 +166,6 @@ public class LdapRealm extends JndiLdapRealm {
   private String groupSearchScope = "subtree";
   private boolean groupSearchEnableMatchingRuleInChain;
 
-
   private String groupSearchBase;
 
   private String groupObjectClass = "groupOfNames";
@@ -182,10 +178,9 @@ public class LdapRealm extends JndiLdapRealm {
   private String memberAttributeValuePrefix = "uid=";
   private String memberAttributeValueSuffix = "";
 
-  private final Map<String, String> rolesByGroup = new LinkedHashMap<String, String>();
-  private final List<String> allowedRolesForAuthentication = new ArrayList<String>();
-  private final Map<String, List<String>> permissionsByRole = 
-      new LinkedHashMap<String, List<String>>();
+  private final Map<String, String> rolesByGroup = new LinkedHashMap<>();
+  private final List<String> allowedRolesForAuthentication = new ArrayList<>();
+  private final Map<String, List<String>> permissionsByRole = new LinkedHashMap<>();
 
   private boolean authorizationEnabled;
 
@@ -200,7 +195,6 @@ public class LdapRealm extends JndiLdapRealm {
   }
 
   @Override
-
   protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token)
       throws org.apache.shiro.authc.AuthenticationException {
     try {
@@ -223,8 +217,7 @@ public class LdapRealm extends JndiLdapRealm {
    */
   @Override
   protected AuthenticationInfo queryForAuthenticationInfo(AuthenticationToken token,
-                                                          LdapContextFactory ldapContextFactory)
-      throws NamingException {
+          LdapContextFactory ldapContextFactory) throws NamingException {
     AuthenticationInfo info = super.queryForAuthenticationInfo(token, ldapContextFactory);
     // Credentials were verified. Verify that the principal has all allowedRulesForAuthentication
     if (!hasAllowedAuthenticationRules(info.getPrincipals(), ldapContextFactory)) {
@@ -248,7 +241,7 @@ public class LdapRealm extends JndiLdapRealm {
   */
   @Override
   public AuthorizationInfo queryForAuthorizationInfo(final PrincipalCollection principals,
-      final LdapContextFactory ldapContextFactory) throws NamingException {
+          final LdapContextFactory ldapContextFactory) throws NamingException {
     if (!isAuthorizationEnabled()) {
       return null;
     }
@@ -263,8 +256,7 @@ public class LdapRealm extends JndiLdapRealm {
   }
 
   private boolean hasAllowedAuthenticationRules(PrincipalCollection principals,
-                                                final LdapContextFactory ldapContextFactory)
-      throws NamingException {
+          final LdapContextFactory ldapContextFactory) throws NamingException {
     boolean allowed = allowedRolesForAuthentication.isEmpty();
     if (!allowed) {
       Set<String> roles = getRoles(principals, ldapContextFactory);
@@ -279,9 +271,8 @@ public class LdapRealm extends JndiLdapRealm {
     return allowed;
   }
 
-  private Set<String> getRoles(PrincipalCollection principals, 
-        final LdapContextFactory ldapContextFactory)
-      throws NamingException {
+  private Set<String> getRoles(PrincipalCollection principals,
+          final LdapContextFactory ldapContextFactory) throws NamingException {
     final String username = (String) getAvailablePrincipal(principals);
 
     LdapContext systemLdapCtx = null;
@@ -297,9 +288,9 @@ public class LdapRealm extends JndiLdapRealm {
     }
   }
 
-  protected Set<String> rolesFor(PrincipalCollection principals,
-        String userNameIn, final LdapContext ldapCtx,
-      final LdapContextFactory ldapContextFactory, Session session) throws NamingException {
+  protected Set<String> rolesFor(PrincipalCollection principals, String userNameIn,
+          final LdapContext ldapCtx, final LdapContextFactory ldapContextFactory, Session session)
+          throws NamingException {
     final Set<String> roleNames = new HashSet<>();
     final Set<String> groupNames = new HashSet<>();
     final String userName;
@@ -418,9 +409,8 @@ public class LdapRealm extends JndiLdapRealm {
   }
 
   private void addRoleIfMember(final String userDn, final SearchResult group,
-        final Set<String> roleNames, final Set<String> groupNames, 
-        final LdapContextFactory ldapContextFactory) throws NamingException {
-
+          final Set<String> roleNames, final Set<String> groupNames,
+          final LdapContextFactory ldapContextFactory) throws NamingException {
     NamingEnumeration<? extends Attribute> attributeEnum = null;
     NamingEnumeration<?> ne = null;
     try {
@@ -498,7 +488,7 @@ public class LdapRealm extends JndiLdapRealm {
   }
 
   private Set<String> permsFor(Set<String> roleNames) {
-    Set<String> perms = new LinkedHashSet<String>(); // preserve order
+    Set<String> perms = new LinkedHashSet<>(); // preserve order
     for (String role : roleNames) {
       List<String> permsForRole = permissionsByRole.get(role);
       if (log.isDebugEnabled()) {
@@ -670,10 +660,8 @@ public class LdapRealm extends JndiLdapRealm {
   }
 
   boolean isUserMemberOfDynamicGroup(LdapName userLdapDn, String memberUrl,
-        final LdapContextFactory ldapContextFactory) throws NamingException {
-
+          final LdapContextFactory ldapContextFactory) throws NamingException {
     // ldap://host:port/dn?attributes?scope?filter?extensions
-
     if (memberUrl == null) {
       return false;
     }
@@ -863,7 +851,7 @@ public class LdapRealm extends JndiLdapRealm {
   */
   @Override
   protected String getUserDn(final String principal) throws IllegalArgumentException, 
-        IllegalStateException {
+          IllegalStateException {
     String userDn;
     String matchedPrincipal = matchPrincipal(principal);
     String userSearchBase = getUserSearchBase();
@@ -936,8 +924,8 @@ public class LdapRealm extends JndiLdapRealm {
 
   @Override
   protected AuthenticationInfo createAuthenticationInfo(AuthenticationToken token, 
-        Object ldapPrincipal,
-        Object ldapCredentials, LdapContext ldapContext) throws NamingException {
+          Object ldapPrincipal, Object ldapCredentials, LdapContext ldapContext)
+          throws NamingException {
     HashRequest.Builder builder = new HashRequest.Builder();
     Hash credentialsHash = hashService
           .computeHash(builder.setSource(token.getCredentials())

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/1add74b4/zeppelin-server/src/main/java/org/apache/zeppelin/realm/PamRealm.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/main/java/org/apache/zeppelin/realm/PamRealm.java b/zeppelin-server/src/main/java/org/apache/zeppelin/realm/PamRealm.java
index d7f62ec..0622673 100644
--- a/zeppelin-server/src/main/java/org/apache/zeppelin/realm/PamRealm.java
+++ b/zeppelin-server/src/main/java/org/apache/zeppelin/realm/PamRealm.java
@@ -23,10 +23,6 @@ import org.apache.shiro.authc.SimpleAuthenticationInfo;
 import org.apache.shiro.authc.UsernamePasswordToken;
 import org.apache.shiro.authz.AuthorizationInfo;
 import org.apache.shiro.authz.SimpleAuthorizationInfo;
-import org.apache.shiro.crypto.hash.DefaultHashService;
-import org.apache.shiro.crypto.hash.Hash;
-import org.apache.shiro.crypto.hash.HashRequest;
-import org.apache.shiro.crypto.hash.HashService;
 import org.apache.shiro.realm.AuthorizingRealm;
 import org.apache.shiro.subject.PrincipalCollection;
 import org.jvnet.libpam.PAM;
@@ -39,10 +35,9 @@ import java.util.LinkedHashSet;
 import java.util.Set;
 
 /**
- * An {@code AuthorizingRealm} base on libpam4j.
+ * An {@code AuthorizingRealm} based on libpam4j.
  */
 public class PamRealm extends AuthorizingRealm {
-
   private static final Logger LOG = LoggerFactory.getLogger(PamRealm.class);
 
   private String service;
@@ -62,8 +57,7 @@ public class PamRealm extends AuthorizingRealm {
 
   @Override
   protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token)
-      throws AuthenticationException {
-
+          throws AuthenticationException {
     UsernamePasswordToken userToken = (UsernamePasswordToken) token;
     UnixUser user;
 
@@ -87,5 +81,4 @@ public class PamRealm extends AuthorizingRealm {
   public void setService(String service) {
     this.service = service;
   }
-
 }

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/1add74b4/zeppelin-server/src/main/java/org/apache/zeppelin/realm/UserPrincipal.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/main/java/org/apache/zeppelin/realm/UserPrincipal.java b/zeppelin-server/src/main/java/org/apache/zeppelin/realm/UserPrincipal.java
index d1710ce..c1221e7 100644
--- a/zeppelin-server/src/main/java/org/apache/zeppelin/realm/UserPrincipal.java
+++ b/zeppelin-server/src/main/java/org/apache/zeppelin/realm/UserPrincipal.java
@@ -21,7 +21,7 @@ import org.jvnet.libpam.UnixUser;
 import java.security.Principal;
 
 /**
- * A {@code java.security.Principal} implememtation for use with Shiro {@code PamRealm}
+ * A {@code java.security.Principal} implememtation for use with Shiro {@code PamRealm}.
  */
 public class UserPrincipal implements Principal {
   private final UnixUser userName;

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/1add74b4/zeppelin-server/src/main/java/org/apache/zeppelin/realm/ZeppelinHubRealm.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/main/java/org/apache/zeppelin/realm/ZeppelinHubRealm.java b/zeppelin-server/src/main/java/org/apache/zeppelin/realm/ZeppelinHubRealm.java
index 1d6cdf9..265ecbd 100644
--- a/zeppelin-server/src/main/java/org/apache/zeppelin/realm/ZeppelinHubRealm.java
+++ b/zeppelin-server/src/main/java/org/apache/zeppelin/realm/ZeppelinHubRealm.java
@@ -16,12 +16,9 @@
  */
 package org.apache.zeppelin.realm;
 
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.HashSet;
-import java.util.concurrent.atomic.AtomicInteger;
+import com.google.common.base.Joiner;
+import com.google.gson.Gson;
+import com.google.gson.JsonParseException;
 
 import org.apache.commons.httpclient.HttpClient;
 import org.apache.commons.httpclient.HttpStatus;
@@ -37,23 +34,26 @@ import org.apache.shiro.authc.UsernamePasswordToken;
 import org.apache.shiro.authz.AuthorizationInfo;
 import org.apache.shiro.realm.AuthorizingRealm;
 import org.apache.shiro.subject.PrincipalCollection;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.HashSet;
+import java.util.concurrent.atomic.AtomicInteger;
+
 import org.apache.zeppelin.common.JsonSerializable;
 import org.apache.zeppelin.notebook.repo.zeppelinhub.model.UserSessionContainer;
 import org.apache.zeppelin.notebook.repo.zeppelinhub.websocket.utils.ZeppelinhubUtils;
 import org.apache.zeppelin.server.ZeppelinServer;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.Joiner;
-import com.google.gson.Gson;
-import com.google.gson.JsonParseException;
 
 /**
  * A {@code Realm} implementation that uses the ZeppelinHub to authenticate users.
  *
  */
 public class ZeppelinHubRealm extends AuthorizingRealm {
-
   private static final Logger LOG = LoggerFactory.getLogger(ZeppelinHubRealm.class);
   private static final String DEFAULT_ZEPPELINHUB_URL = "https://www.zeppelinhub.com";
   private static final String USER_LOGIN_API_ENDPOINT = "api/v1/users/login";
@@ -78,7 +78,7 @@ public class ZeppelinHubRealm extends AuthorizingRealm {
 
   @Override
   protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken authToken)
-      throws AuthenticationException {
+          throws AuthenticationException {
     UsernamePasswordToken token = (UsernamePasswordToken) authToken;
     if (StringUtils.isBlank(token.getUsername())) {
       throw new AccountException("Empty usernames are not allowed by this realm.");
@@ -101,7 +101,8 @@ public class ZeppelinHubRealm extends AuthorizingRealm {
 
   /**
    * Setter of ZeppelinHub URL, this will be called by Shiro based on zeppelinhubUrl property
-   * in shiro.ini file.</p>
+   * in shiro.ini file.
+   *
    * It will also perform a check of ZeppelinHub url {@link #isZeppelinHubUrlValid},
    * if the url is not valid, the default zeppelinhub url will be used.
    *
@@ -127,8 +128,8 @@ public class ZeppelinHubRealm extends AuthorizingRealm {
    */
   protected User authenticateUser(String requestBody) {
     PutMethod put = new PutMethod(Joiner.on("/").join(zeppelinhubUrl, USER_LOGIN_API_ENDPOINT));
-    String responseBody = StringUtils.EMPTY;
-    String userSession = StringUtils.EMPTY;
+    String responseBody;
+    String userSession;
     try {
       put.setRequestEntity(new StringRequestEntity(requestBody, JSON_CONTENT_TYPE, UTF_8_ENCODING));
       int statusCode = httpClient.executeMethod(put);
@@ -147,7 +148,7 @@ public class ZeppelinHubRealm extends AuthorizingRealm {
       throw new AuthenticationException(e.getMessage());
     }
 
-    User account = null;
+    User account;
     try {
       account = User.fromJson(responseBody);
     } catch (JsonParseException e) {
@@ -161,14 +162,15 @@ public class ZeppelinHubRealm extends AuthorizingRealm {
   }
 
   /**
-   * Create a JSON String that represent login payload.</p>
+   * Create a JSON String that represent login payload.
+   *
    * Payload will look like:
-   * <code>
+   * {@code
    *  {
    *   'login': 'userLogin',
    *   'password': 'userpassword'
    *  }
-   * </code>
+   * }
    * @param login
    * @param pwd
    * @return
@@ -179,7 +181,7 @@ public class ZeppelinHubRealm extends AuthorizingRealm {
   }
 
   /**
-   * Perform a Simple URL check by using <code>URI(url).toURL()</code>.
+   * Perform a Simple URL check by using {@code URI(url).toURL()}.
    * If the url is not valid, the try-catch condition will catch the exceptions and return false,
    * otherwise true will be returned.
    *
@@ -220,7 +222,7 @@ public class ZeppelinHubRealm extends AuthorizingRealm {
     UserSessionContainer.instance.setSession(username, session);
 
     /* TODO(xxx): add proper roles */
-    HashSet<String> userAndRoles = new HashSet<String>();
+    HashSet<String> userAndRoles = new HashSet<>();
     userAndRoles.add(username);
     ZeppelinServer.notebookWsServer.broadcastReloadedNoteList(
         new org.apache.zeppelin.user.AuthenticationInfo(username), userAndRoles);

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/1add74b4/zeppelin-server/src/main/java/org/apache/zeppelin/realm/jwt/JWTAuthenticationToken.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/main/java/org/apache/zeppelin/realm/jwt/JWTAuthenticationToken.java b/zeppelin-server/src/main/java/org/apache/zeppelin/realm/jwt/JWTAuthenticationToken.java
index 2214125..8dc86ed 100644
--- a/zeppelin-server/src/main/java/org/apache/zeppelin/realm/jwt/JWTAuthenticationToken.java
+++ b/zeppelin-server/src/main/java/org/apache/zeppelin/realm/jwt/JWTAuthenticationToken.java
@@ -19,10 +19,9 @@ package org.apache.zeppelin.realm.jwt;
 import org.apache.shiro.authc.AuthenticationToken;
 
 /**
- * Created for org.apache.zeppelin.server
+ * Created for org.apache.zeppelin.server.
  */
 public class JWTAuthenticationToken implements AuthenticationToken {
-
   private Object userId;
   private String token;
 

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/1add74b4/zeppelin-server/src/main/java/org/apache/zeppelin/realm/jwt/KnoxAuthenticationFilter.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/main/java/org/apache/zeppelin/realm/jwt/KnoxAuthenticationFilter.java b/zeppelin-server/src/main/java/org/apache/zeppelin/realm/jwt/KnoxAuthenticationFilter.java
index de19664..eccf6de 100644
--- a/zeppelin-server/src/main/java/org/apache/zeppelin/realm/jwt/KnoxAuthenticationFilter.java
+++ b/zeppelin-server/src/main/java/org/apache/zeppelin/realm/jwt/KnoxAuthenticationFilter.java
@@ -18,7 +18,6 @@ package org.apache.zeppelin.realm.jwt;
 
 import org.apache.shiro.web.filter.authc.FormAuthenticationFilter;
 import org.apache.shiro.web.servlet.ShiroHttpServletRequest;
-import org.apache.zeppelin.utils.SecurityUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -26,21 +25,21 @@ import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
 import javax.servlet.http.Cookie;
 
+import org.apache.zeppelin.utils.SecurityUtils;
+
 /**
- * Created for org.apache.zeppelin.server
+ * Created for org.apache.zeppelin.server.
  */
 public class KnoxAuthenticationFilter extends FormAuthenticationFilter {
-
   private static final Logger LOGGER = LoggerFactory.getLogger(KnoxAuthenticationFilter.class);
 
-  protected boolean isAccessAllowed(ServletRequest request,
-                                    ServletResponse response, Object mappedValue) {
-
+  protected boolean isAccessAllowed(ServletRequest request, ServletResponse response,
+          Object mappedValue) {
     //Check with existing shiro authentication logic
     //https://github.com/apache/shiro/blob/shiro-root-1.3.2/web/src/main/java/org/apache/shiro/
     // web/filter/authc/AuthenticatingFilter.java#L123-L124
     Boolean accessAllowed = super.isAccessAllowed(request, response, mappedValue) ||
-      !isLoginRequest(request, response) && isPermissive(mappedValue);
+            !isLoginRequest(request, response) && isPermissive(mappedValue);
 
     if (accessAllowed) {
       accessAllowed = false;

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/1add74b4/zeppelin-server/src/main/java/org/apache/zeppelin/realm/jwt/KnoxJwtRealm.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/main/java/org/apache/zeppelin/realm/jwt/KnoxJwtRealm.java b/zeppelin-server/src/main/java/org/apache/zeppelin/realm/jwt/KnoxJwtRealm.java
index a903e6e..7c13590 100644
--- a/zeppelin-server/src/main/java/org/apache/zeppelin/realm/jwt/KnoxJwtRealm.java
+++ b/zeppelin-server/src/main/java/org/apache/zeppelin/realm/jwt/KnoxJwtRealm.java
@@ -16,10 +16,19 @@
  */
 package org.apache.zeppelin.realm.jwt;
 
-import com.nimbusds.jose.JWSObject;
-import com.nimbusds.jose.JWSVerifier;
-import com.nimbusds.jose.crypto.RSASSAVerifier;
-import com.nimbusds.jwt.SignedJWT;
+import org.apache.commons.io.FileUtils;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.security.Groups;
+import org.apache.shiro.authc.AuthenticationInfo;
+import org.apache.shiro.authc.AuthenticationToken;
+import org.apache.shiro.authc.SimpleAccount;
+import org.apache.shiro.authz.AuthorizationInfo;
+import org.apache.shiro.authz.SimpleAuthorizationInfo;
+import org.apache.shiro.realm.AuthorizingRealm;
+import org.apache.shiro.subject.PrincipalCollection;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import java.io.ByteArrayInputStream;
 import java.io.File;
 import java.io.IOException;
@@ -33,25 +42,18 @@ import java.text.ParseException;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
+
 import javax.servlet.ServletException;
-import org.apache.commons.io.FileUtils;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.security.Groups;
-import org.apache.shiro.authc.AuthenticationInfo;
-import org.apache.shiro.authc.AuthenticationToken;
-import org.apache.shiro.authc.SimpleAccount;
-import org.apache.shiro.authz.AuthorizationInfo;
-import org.apache.shiro.authz.SimpleAuthorizationInfo;
-import org.apache.shiro.realm.AuthorizingRealm;
-import org.apache.shiro.subject.PrincipalCollection;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+
+import com.nimbusds.jose.JWSObject;
+import com.nimbusds.jose.JWSVerifier;
+import com.nimbusds.jose.crypto.RSASSAVerifier;
+import com.nimbusds.jwt.SignedJWT;
 
 /**
- * Created for org.apache.zeppelin.server
+ * Created for org.apache.zeppelin.server.
  */
 public class KnoxJwtRealm extends AuthorizingRealm {
-
   private static final Logger LOGGER = LoggerFactory.getLogger(KnoxJwtRealm.class);
 
   private String providerUrl;
@@ -66,8 +68,9 @@ public class KnoxJwtRealm extends AuthorizingRealm {
   private String groupPrincipalMapping;
 
   private SimplePrincipalMapper mapper = new SimplePrincipalMapper();
+
   /**
-   * Configuration object needed by for hadoop classes
+   * Configuration object needed by for Hadoop classes.
    */
   private Configuration hadoopConfig;
 
@@ -94,7 +97,6 @@ public class KnoxJwtRealm extends AuthorizingRealm {
     } catch (final Exception e) {
       LOGGER.error("Exception in onInit", e);
     }
-
   }
 
   @Override
@@ -102,7 +104,6 @@ public class KnoxJwtRealm extends AuthorizingRealm {
     return token != null && token instanceof JWTAuthenticationToken;
   }
 
-
   @Override
   protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) {
     JWTAuthenticationToken upToken = (JWTAuthenticationToken) token;
@@ -135,11 +136,10 @@ public class KnoxJwtRealm extends AuthorizingRealm {
     }
   }
 
-  public static RSAPublicKey parseRSAPublicKey(String pem)
-      throws IOException, ServletException {
-    String PEM_HEADER = "-----BEGIN CERTIFICATE-----\n";
-    String PEM_FOOTER = "\n-----END CERTIFICATE-----";
-    String fullPem = PEM_HEADER + pem + PEM_FOOTER;
+  public static RSAPublicKey parseRSAPublicKey(String pem) throws IOException, ServletException {
+    final String pemHeader = "-----BEGIN CERTIFICATE-----\n";
+    final String pemFooter = "\n-----END CERTIFICATE-----";
+    String fullPem = pemHeader + pem + pemFooter;
     PublicKey key = null;
     try {
       CertificateFactory fact = CertificateFactory.getInstance("X.509");
@@ -149,7 +149,7 @@ public class KnoxJwtRealm extends AuthorizingRealm {
       key = cer.getPublicKey();
     } catch (CertificateException ce) {
       String message = null;
-      if (pem.startsWith(PEM_HEADER)) {
+      if (pem.startsWith(pemHeader)) {
         message = "CertificateException - be sure not to include PEM header "
             + "and footer in the PEM configuration element.";
       } else {
@@ -167,9 +167,7 @@ public class KnoxJwtRealm extends AuthorizingRealm {
   protected boolean validateSignature(SignedJWT jwtToken) {
     boolean valid = false;
     if (JWSObject.State.SIGNED == jwtToken.getState()) {
-
       if (jwtToken.getSignature() != null) {
-
         try {
           RSAPublicKey publicKey = parseRSAPublicKey(publicKeyPath);
           JWSVerifier verifier = new RSASSAVerifier(publicKey);
@@ -191,8 +189,7 @@ public class KnoxJwtRealm extends AuthorizingRealm {
   }
 
   /**
-   * Query the Hadoop implementation of {@link Groups} to retrieve groups for
-   * provided user.
+   * Query the Hadoop implementation of {@link Groups} to retrieve groups for provided user.
    */
   public Set<String> mapGroupPrincipals(final String mappedPrincipalName) {
     /* return the groups as seen by Hadoop */
@@ -295,4 +292,3 @@ public class KnoxJwtRealm extends AuthorizingRealm {
     this.groupPrincipalMapping = groupPrincipalMapping;
   }
 }
-

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/1add74b4/zeppelin-server/src/main/java/org/apache/zeppelin/realm/jwt/PrincipalMapper.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/main/java/org/apache/zeppelin/realm/jwt/PrincipalMapper.java b/zeppelin-server/src/main/java/org/apache/zeppelin/realm/jwt/PrincipalMapper.java
index d96efa4..fec276c 100644
--- a/zeppelin-server/src/main/java/org/apache/zeppelin/realm/jwt/PrincipalMapper.java
+++ b/zeppelin-server/src/main/java/org/apache/zeppelin/realm/jwt/PrincipalMapper.java
@@ -17,19 +17,15 @@
  */
 package org.apache.zeppelin.realm.jwt;
 
-/***
- * 
- */
 public interface PrincipalMapper {
-
   /**
    * Load the internal principal mapping table from the provided
    * string value which conforms to the following semicolon delimited format:
    * actual[,another-actual]=mapped;...
    * @param principalMapping
    */
-  public abstract void loadMappingTable(String principalMapping, String groupMapping)
-      throws PrincipalMappingException;
+  void loadMappingTable(String principalMapping, String groupMapping)
+          throws PrincipalMappingException;
 
   /**
    * Acquire a mapped principal name from the mapping table
@@ -38,7 +34,7 @@ public interface PrincipalMapper {
    * @param principalName
    * @return principal name to be used in the assertion
    */
-  public abstract String mapUserPrincipal(String principalName);
+  String mapUserPrincipal(String principalName);
 
   /**
    * Acquire array of group principal names from the mapping table
@@ -46,6 +42,5 @@ public interface PrincipalMapper {
    * @param principalName
    * @return group principal names to be used in the assertion
    */
-  public abstract String[] mapGroupPrincipal(String principalName);
+  String[] mapGroupPrincipal(String principalName);
 }
-

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/1add74b4/zeppelin-server/src/main/java/org/apache/zeppelin/realm/jwt/PrincipalMappingException.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/main/java/org/apache/zeppelin/realm/jwt/PrincipalMappingException.java b/zeppelin-server/src/main/java/org/apache/zeppelin/realm/jwt/PrincipalMappingException.java
index c3ca02f..50e5036 100644
--- a/zeppelin-server/src/main/java/org/apache/zeppelin/realm/jwt/PrincipalMappingException.java
+++ b/zeppelin-server/src/main/java/org/apache/zeppelin/realm/jwt/PrincipalMappingException.java
@@ -18,10 +18,9 @@
 package org.apache.zeppelin.realm.jwt;
 
 /***
- * {@link System}
+ * {@link System}.
  */
 public class PrincipalMappingException extends Exception {
-
   public PrincipalMappingException(String message) {
     super(message);
   }
@@ -29,6 +28,4 @@ public class PrincipalMappingException extends Exception {
   public PrincipalMappingException(String message, Exception e) {
     super(message, e);
   }
-
-
 }

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/1add74b4/zeppelin-server/src/main/java/org/apache/zeppelin/rest/ConfigurationsRestApi.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/main/java/org/apache/zeppelin/rest/ConfigurationsRestApi.java b/zeppelin-server/src/main/java/org/apache/zeppelin/rest/ConfigurationsRestApi.java
index 68cffed..9c3d128 100644
--- a/zeppelin-server/src/main/java/org/apache/zeppelin/rest/ConfigurationsRestApi.java
+++ b/zeppelin-server/src/main/java/org/apache/zeppelin/rest/ConfigurationsRestApi.java
@@ -14,13 +14,9 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.zeppelin.rest;
 
-import org.apache.zeppelin.annotation.ZeppelinApi;
-import org.apache.zeppelin.conf.ZeppelinConfiguration;
-import org.apache.zeppelin.notebook.Notebook;
-import org.apache.zeppelin.server.JsonResponse;
+import java.util.Map;
 
 import javax.ws.rs.GET;
 import javax.ws.rs.Path;
@@ -28,15 +24,18 @@ import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.Response.Status;
-import java.util.Map;
+
+import org.apache.zeppelin.annotation.ZeppelinApi;
+import org.apache.zeppelin.conf.ZeppelinConfiguration;
+import org.apache.zeppelin.notebook.Notebook;
+import org.apache.zeppelin.server.JsonResponse;
 
 /**
- * Configurations Rest API Endpoint
+ * Configurations Rest API Endpoint.
  */
 @Path("/configurations")
 @Produces("application/json")
 public class ConfigurationsRestApi {
-
   private Notebook notebook;
 
   public ConfigurationsRestApi() {}
@@ -89,5 +88,4 @@ public class ConfigurationsRestApi {
 
     return new JsonResponse(Status.OK, "", configurations).build();
   }
-
 }

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/1add74b4/zeppelin-server/src/main/java/org/apache/zeppelin/rest/CredentialRestApi.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/main/java/org/apache/zeppelin/rest/CredentialRestApi.java b/zeppelin-server/src/main/java/org/apache/zeppelin/rest/CredentialRestApi.java
index 74412c4..10ca50f 100755
--- a/zeppelin-server/src/main/java/org/apache/zeppelin/rest/CredentialRestApi.java
+++ b/zeppelin-server/src/main/java/org/apache/zeppelin/rest/CredentialRestApi.java
@@ -14,31 +14,37 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.zeppelin.rest;
 
 import com.google.common.base.Strings;
 import com.google.gson.Gson;
 import com.google.gson.reflect.TypeToken;
-import org.apache.zeppelin.user.Credentials;
-import org.apache.zeppelin.user.UserCredentials;
-import org.apache.zeppelin.user.UsernamePassword;
-import org.apache.zeppelin.server.JsonResponse;
-import org.apache.zeppelin.utils.SecurityUtils;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.io.IOException;
+import java.util.Map;
+
 import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.*;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.Response.Status;
-import java.io.IOException;
-import java.util.Map;
+
+import org.apache.zeppelin.server.JsonResponse;
+import org.apache.zeppelin.user.Credentials;
+import org.apache.zeppelin.user.UserCredentials;
+import org.apache.zeppelin.user.UsernamePassword;
+import org.apache.zeppelin.utils.SecurityUtils;
 
 /**
- * Credential Rest API
- *
+ * Credential Rest API.
  */
 @Path("/credential")
 @Produces("application/json")
@@ -58,21 +64,23 @@ public class CredentialRestApi {
   }
 
   /**
-   * Put User Credentials REST API
+   * Put User Credentials REST API.
+   *
    * @param message - JSON with entity, username, password.
    * @return JSON with status.OK
-   * @throws IOException, IllegalArgumentException
+   * @throws IOException
+   * @throws IllegalArgumentException
    */
   @PUT
   public Response putCredentials(String message) throws IOException, IllegalArgumentException {
     Map<String, String> messageMap = gson.fromJson(message,
-      new TypeToken<Map<String, String>>(){}.getType());
+            new TypeToken<Map<String, String>>(){}.getType());
     String entity = messageMap.get("entity");
     String username = messageMap.get("username");
     String password = messageMap.get("password");
 
     if (Strings.isNullOrEmpty(entity)
-            || Strings.isNullOrEmpty(username) || Strings.isNullOrEmpty(password) ) {
+            || Strings.isNullOrEmpty(username) || Strings.isNullOrEmpty(password)) {
       return new JsonResponse(Status.BAD_REQUEST).build();
     }
 
@@ -85,10 +93,12 @@ public class CredentialRestApi {
   }
 
   /**
-   * Get User Credentials list REST API
+   * Get User Credentials list REST API.
+   *
    * @param
    * @return JSON with status.OK
-   * @throws IOException, IllegalArgumentException
+   * @throws IOException
+   * @throws IllegalArgumentException
    */
   @GET
   public Response getCredentials(String message) throws
@@ -99,12 +109,14 @@ public class CredentialRestApi {
     return new JsonResponse(Status.OK, uc).build();
   }
 
- /**
-  * Remove User Credentials REST API
-  * @param
-  * @return JSON with status.OK
-  * @throws IOException, IllegalArgumentException
-  */
+  /**
+   * Remove User Credentials REST API.
+   *
+   * @param
+   * @return JSON with status.OK
+   * @throws IOException
+   * @throws IllegalArgumentException
+   */
   @DELETE
   public Response removeCredentials(String message) throws
       IOException, IllegalArgumentException {
@@ -118,10 +130,12 @@ public class CredentialRestApi {
   }
 
   /**
-   * Remove Entity of User Credential entity REST API
+   * Remove Entity of User Credential entity REST API.
+   *
    * @param
    * @return JSON with status.OK
-   * @throws IOException, IllegalArgumentException
+   * @throws IOException
+   * @throws IllegalArgumentException
    */
   @DELETE
   @Path("{entity}")

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/1add74b4/zeppelin-server/src/main/java/org/apache/zeppelin/rest/GetUserList.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/main/java/org/apache/zeppelin/rest/GetUserList.java b/zeppelin-server/src/main/java/org/apache/zeppelin/rest/GetUserList.java
index 954ee1a..1cbb4a6 100644
--- a/zeppelin-server/src/main/java/org/apache/zeppelin/rest/GetUserList.java
+++ b/zeppelin-server/src/main/java/org/apache/zeppelin/rest/GetUserList.java
@@ -14,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.zeppelin.rest;
 
 import org.apache.commons.lang3.StringUtils;
@@ -24,17 +23,9 @@ import org.apache.shiro.realm.ldap.JndiLdapContextFactory;
 import org.apache.shiro.realm.ldap.JndiLdapRealm;
 import org.apache.shiro.realm.text.IniRealm;
 import org.apache.shiro.util.JdbcUtils;
-import org.apache.zeppelin.realm.ActiveDirectoryGroupRealm;
-import org.apache.zeppelin.realm.LdapRealm;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.naming.NamingEnumeration;
-import javax.naming.directory.Attributes;
-import javax.naming.directory.SearchControls;
-import javax.naming.directory.SearchResult;
-import javax.naming.ldap.LdapContext;
-import javax.sql.DataSource;
 import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
@@ -43,17 +34,26 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
+import javax.naming.NamingEnumeration;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
+import javax.naming.ldap.LdapContext;
+import javax.sql.DataSource;
+
+import org.apache.zeppelin.realm.ActiveDirectoryGroupRealm;
+import org.apache.zeppelin.realm.LdapRealm;
+
 /**
  * This is class which help fetching users from different realms.
  * getUserList() function is overloaded and according to the realm passed to the function it
  * extracts users from its respective realm
  */
 public class GetUserList {
-
   private static final Logger LOG = LoggerFactory.getLogger(GetUserList.class);
 
   /**
-   * function to extract users from shiro.ini
+   * Function to extract users from shiro.ini.
    */
   public List<String> getUserList(IniRealm r) {
     List<String> userList = new ArrayList<>();
@@ -70,7 +70,8 @@ public class GetUserList {
 
 
   /***
-   * Get user roles from shiro.ini
+   * Get user roles from shiro.ini.
+   *
    * @param r
    * @return
    */
@@ -88,7 +89,7 @@ public class GetUserList {
   }
 
   /**
-   * function to extract users from LDAP
+   * Function to extract users from LDAP.
    */
   public List<String> getUserList(JndiLdapRealm r, String searchText) {
     List<String> userList = new ArrayList<>();
@@ -96,9 +97,9 @@ public class GetUserList {
     String userDn[] = userDnTemplate.split(",", 2);
     String userDnPrefix = userDn[0].split("=")[0];
     String userDnSuffix = userDn[1];
-    JndiLdapContextFactory CF = (JndiLdapContextFactory) r.getContextFactory();
+    JndiLdapContextFactory cf = (JndiLdapContextFactory) r.getContextFactory();
     try {
-      LdapContext ctx = CF.getSystemLdapContext();
+      LdapContext ctx = cf.getSystemLdapContext();
       SearchControls constraints = new SearchControls();
       constraints.setSearchScope(SearchControls.SUBTREE_SCOPE);
       String[] attrIDs = {userDnPrefix};
@@ -120,7 +121,7 @@ public class GetUserList {
   }
   
   /**
-   * function to extract users from Zeppelin LdapRealm
+   * Function to extract users from Zeppelin LdapRealm.
    */
   public List<String> getUserList(LdapRealm r, String searchText) {
     List<String> userList = new ArrayList<>();
@@ -130,9 +131,9 @@ public class GetUserList {
     String userAttribute = r.getUserSearchAttributeName();
     String userSearchRealm = r.getUserSearchBase();
     String userObjectClass = r.getUserObjectClass();
-    JndiLdapContextFactory CF = (JndiLdapContextFactory) r.getContextFactory();
+    JndiLdapContextFactory cf = (JndiLdapContextFactory) r.getContextFactory();
     try {
-      LdapContext ctx = CF.getSystemLdapContext();
+      LdapContext ctx = cf.getSystemLdapContext();
       SearchControls constraints = new SearchControls();
       constraints.setSearchScope(SearchControls.SUBTREE_SCOPE);
       String[] attrIDs = {userAttribute};
@@ -164,7 +165,8 @@ public class GetUserList {
   }
   
   /***
-   * Get user roles from shiro.ini for Zeppelin LdapRealm
+   * Get user roles from shiro.ini for Zeppelin LdapRealm.
+   *
    * @param r
    * @return
    */
@@ -184,7 +186,6 @@ public class GetUserList {
     }
     return roleList;
   }
-  
 
   public List<String> getUserList(ActiveDirectoryGroupRealm r, String searchText) {
     List<String> userList = new ArrayList<>();
@@ -198,7 +199,7 @@ public class GetUserList {
   }
 
   /**
-   * function to extract users from JDBCs
+   * Function to extract users from JDBCs.
    */
   public List<String> getUserList(JdbcRealm obj) {
     List<String> userlist = new ArrayList<>();
@@ -210,7 +211,7 @@ public class GetUserList {
     String retval[];
     String tablename = "";
     String username = "";
-    String userquery = "";
+    String userquery;
     try {
       dataSource = (DataSource) FieldUtils.readField(obj, "dataSource", true);
       authQuery = (String) FieldUtils.readField(obj, "authenticationQuery", true);
@@ -221,10 +222,11 @@ public class GetUserList {
         retval = retval[1].split("with|where", 2);
         tablename = retval[0];
         retval = retval[1].split("where", 2);
-        if (retval.length >= 2)
+        if (retval.length >= 2) {
           retval = retval[1].split("=", 2);
-        else
+        } else {
           retval = retval[0].split("=", 2);
+        }
         username = retval[0];
       }
 
@@ -233,7 +235,6 @@ public class GetUserList {
       }
 
       userquery = String.format("SELECT %s FROM %s", username, tablename);
-
     } catch (IllegalAccessException e) {
       LOG.error("Error while accessing dataSource for JDBC Realm", e);
       return null;
@@ -255,5 +256,4 @@ public class GetUserList {
     }
     return userlist;
   }
-
 }

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/1add74b4/zeppelin-server/src/main/java/org/apache/zeppelin/rest/HeliumRestApi.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/main/java/org/apache/zeppelin/rest/HeliumRestApi.java b/zeppelin-server/src/main/java/org/apache/zeppelin/rest/HeliumRestApi.java
index 1c8f44f..fd70de3 100644
--- a/zeppelin-server/src/main/java/org/apache/zeppelin/rest/HeliumRestApi.java
+++ b/zeppelin-server/src/main/java/org/apache/zeppelin/rest/HeliumRestApi.java
@@ -14,33 +14,40 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.zeppelin.rest;
 
 import com.google.gson.Gson;
 import com.google.gson.JsonParseException;
 import com.google.gson.reflect.TypeToken;
+
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang3.StringUtils;
-import org.apache.zeppelin.helium.Helium;
-import org.apache.zeppelin.helium.HeliumPackage;
-import org.apache.zeppelin.helium.HeliumPackageSearchResult;
-import org.apache.zeppelin.notebook.Note;
-import org.apache.zeppelin.notebook.Notebook;
-import org.apache.zeppelin.notebook.Paragraph;
-import org.apache.zeppelin.server.JsonResponse;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.ws.rs.*;
-import javax.ws.rs.core.Response;
 import java.io.File;
 import java.io.IOException;
 import java.util.List;
 import java.util.Map;
 
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Response;
+
+import org.apache.zeppelin.helium.Helium;
+import org.apache.zeppelin.helium.HeliumPackage;
+import org.apache.zeppelin.helium.HeliumPackageSearchResult;
+import org.apache.zeppelin.notebook.Note;
+import org.apache.zeppelin.notebook.Notebook;
+import org.apache.zeppelin.notebook.Paragraph;
+import org.apache.zeppelin.server.JsonResponse;
+
 /**
- * Helium Rest Api
+ * Helium Rest Api.
  */
 @Path("/helium")
 @Produces("application/json")
@@ -57,7 +64,7 @@ public class HeliumRestApi {
   }
 
   /**
-   * Get all packages info
+   * Get all packages info.
    */
   @GET
   @Path("package")
@@ -71,7 +78,7 @@ public class HeliumRestApi {
   }
 
   /**
-   * Get all enabled packages info
+   * Get all enabled packages info.
    */
   @GET
   @Path("enabledPackage")
@@ -85,15 +92,14 @@ public class HeliumRestApi {
   }
 
   /**
-   * Get single package info
+   * Get single package info.
    */
   @GET
   @Path("package/{packageName}")
   public Response getSinglePackageInfo(@PathParam("packageName") String packageName) {
     if (StringUtils.isEmpty(packageName)) {
-      return new JsonResponse(
-          Response.Status.BAD_REQUEST,
-          "Can't get package info for empty name").build();
+      return new JsonResponse(Response.Status.BAD_REQUEST,
+              "Can't get package info for empty name").build();
     }
 
     try {
@@ -108,7 +114,7 @@ public class HeliumRestApi {
   @GET
   @Path("suggest/{noteId}/{paragraphId}")
   public Response suggest(@PathParam("noteId") String noteId,
-                          @PathParam("paragraphId") String paragraphId) {
+          @PathParam("paragraphId") String paragraphId) {
     Note note = notebook.getNote(noteId);
     if (note == null) {
       return new JsonResponse(Response.Status.NOT_FOUND, "Note " + noteId + " not found").build();
@@ -121,8 +127,7 @@ public class HeliumRestApi {
     }
     try {
       return new JsonResponse<>(Response.Status.OK, "", helium.suggestApp(paragraph)).build();
-    }
-    catch (RuntimeException e) {
+    } catch (RuntimeException e) {
       logger.error(e.getMessage(), e);
       return new JsonResponse(Response.Status.INTERNAL_SERVER_ERROR, e.getMessage()).build();
     }
@@ -132,9 +137,7 @@ public class HeliumRestApi {
   @POST
   @Path("load/{noteId}/{paragraphId}")
   public Response load(@PathParam("noteId") String noteId,
-                          @PathParam("paragraphId") String paragraphId,
-                          String heliumPackage) {
-
+          @PathParam("paragraphId") String paragraphId, String heliumPackage) {
     Note note = notebook.getNote(noteId);
     if (note == null) {
       return new JsonResponse(Response.Status.NOT_FOUND, "Note " + noteId + " not found").build();
@@ -149,8 +152,7 @@ public class HeliumRestApi {
     try {
       return new JsonResponse<>(Response.Status.OK, "",
               helium.getApplicationFactory().loadAndRun(pkg, paragraph)).build();
-    }
-    catch (RuntimeException e) {
+    } catch (RuntimeException e) {
       logger.error(e.getMessage(), e);
       return new JsonResponse(Response.Status.INTERNAL_SERVER_ERROR, e.getMessage()).build();
     }
@@ -160,7 +162,7 @@ public class HeliumRestApi {
   @Path("bundle/load/{packageName}")
   @Produces("text/javascript")
   public Response bundleLoad(@QueryParam("refresh") String refresh,
-                             @PathParam("packageName") String packageName) {
+          @PathParam("packageName") String packageName) {
     if (StringUtils.isEmpty(packageName)) {
       return new JsonResponse(
           Response.Status.BAD_REQUEST,
@@ -203,13 +205,11 @@ public class HeliumRestApi {
 
   @POST
   @Path("enable/{packageName}")
-  public Response enablePackage(@PathParam("packageName") String packageName,
-                                String artifact) {
+  public Response enablePackage(@PathParam("packageName") String packageName, String artifact) {
     try {
       if (helium.enable(packageName, artifact)) {
         return new JsonResponse(Response.Status.OK).build();
-      }
-      else {
+      } else {
         return new JsonResponse(Response.Status.NOT_FOUND).build();
       }
     } catch (IOException e) {
@@ -224,8 +224,7 @@ public class HeliumRestApi {
     try {
       if (helium.disable(packageName)) {
         return new JsonResponse(Response.Status.OK).build();
-      }
-      else {
+      } else {
         return new JsonResponse(Response.Status.NOT_FOUND).build();
       }
     } catch (IOException e) {
@@ -238,8 +237,7 @@ public class HeliumRestApi {
   @Path("spell/config/{packageName}")
   public Response getSpellConfigUsingMagic(@PathParam("packageName") String packageName) {
     if (StringUtils.isEmpty(packageName)) {
-      return new JsonResponse(Response.Status.BAD_REQUEST,
-          "packageName is empty" ).build();
+      return new JsonResponse(Response.Status.BAD_REQUEST, "packageName is empty").build();
     }
 
     try {
@@ -273,7 +271,7 @@ public class HeliumRestApi {
   @GET
   @Path("config/{packageName}/{artifact}")
   public Response getPackageConfig(@PathParam("packageName") String packageName,
-                                   @PathParam("artifact") String artifact) {
+          @PathParam("artifact") String artifact) {
     if (StringUtils.isEmpty(packageName) || StringUtils.isEmpty(artifact)) {
       return new JsonResponse(Response.Status.BAD_REQUEST,
           "package name or artifact is empty"
@@ -299,9 +297,7 @@ public class HeliumRestApi {
   @POST
   @Path("config/{packageName}/{artifact}")
   public Response updatePackageConfig(@PathParam("packageName") String packageName,
-                                      @PathParam("artifact") String artifact,
-                                      String rawConfig) {
-
+          @PathParam("artifact") String artifact, String rawConfig) {
     if (StringUtils.isEmpty(packageName) || StringUtils.isEmpty(artifact)) {
       return new JsonResponse(Response.Status.BAD_REQUEST,
           "package name or artifact is empty"

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/1add74b4/zeppelin-server/src/main/java/org/apache/zeppelin/rest/InterpreterRestApi.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/main/java/org/apache/zeppelin/rest/InterpreterRestApi.java b/zeppelin-server/src/main/java/org/apache/zeppelin/rest/InterpreterRestApi.java
index e2a10e6..479740d 100644
--- a/zeppelin-server/src/main/java/org/apache/zeppelin/rest/InterpreterRestApi.java
+++ b/zeppelin-server/src/main/java/org/apache/zeppelin/rest/InterpreterRestApi.java
@@ -14,11 +14,14 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.zeppelin.rest;
 
+import org.apache.commons.lang.exception.ExceptionUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.sonatype.aether.repository.RemoteRepository;
+
 import java.io.IOException;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -34,7 +37,6 @@ import javax.ws.rs.core.Context;
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.Response.Status;
 
-import org.apache.commons.lang.exception.ExceptionUtils;
 import org.apache.zeppelin.annotation.ZeppelinApi;
 import org.apache.zeppelin.dep.Repository;
 import org.apache.zeppelin.interpreter.InterpreterException;
@@ -47,12 +49,9 @@ import org.apache.zeppelin.rest.message.UpdateInterpreterSettingRequest;
 import org.apache.zeppelin.server.JsonResponse;
 import org.apache.zeppelin.socket.NotebookServer;
 import org.apache.zeppelin.utils.SecurityUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.sonatype.aether.repository.RemoteRepository;
 
 /**
- * Interpreter Rest API
+ * Interpreter Rest API.
  */
 @Path("/interpreter")
 @Produces("application/json")
@@ -66,13 +65,13 @@ public class InterpreterRestApi {
   }
 
   public InterpreterRestApi(InterpreterSettingManager interpreterSettingManager,
-      NotebookServer notebookWsServer) {
+          NotebookServer notebookWsServer) {
     this.interpreterSettingManager = interpreterSettingManager;
     this.notebookServer = notebookWsServer;
   }
 
   /**
-   * List all interpreter settings
+   * List all interpreter settings.
    */
   @GET
   @Path("setting")
@@ -82,7 +81,7 @@ public class InterpreterRestApi {
   }
 
   /**
-   * Get a setting
+   * Get a setting.
    */
   @GET
   @Path("setting/{settingId}")
@@ -103,7 +102,7 @@ public class InterpreterRestApi {
   }
 
   /**
-   * Add new interpreter setting
+   * Add new interpreter setting.
    *
    * @param message NewInterpreterSettingRequest
    */
@@ -159,7 +158,7 @@ public class InterpreterRestApi {
   }
 
   /**
-   * Remove interpreter setting
+   * Remove interpreter setting.
    */
   @DELETE
   @Path("setting/{settingId}")
@@ -171,7 +170,7 @@ public class InterpreterRestApi {
   }
 
   /**
-   * Restart interpreter setting
+   * Restart interpreter setting.
    */
   @PUT
   @Path("setting/restart/{settingId}")
@@ -203,7 +202,7 @@ public class InterpreterRestApi {
   }
 
   /**
-   * List all available interpreters by group
+   * List all available interpreters by group.
    */
   @GET
   @ZeppelinApi
@@ -213,7 +212,7 @@ public class InterpreterRestApi {
   }
 
   /**
-   * List of dependency resolving repositories
+   * List of dependency resolving repositories.
    */
   @GET
   @Path("repository")
@@ -224,7 +223,7 @@ public class InterpreterRestApi {
   }
 
   /**
-   * Add new repository
+   * Add new repository.
    *
    * @param message Repository
    */
@@ -246,7 +245,7 @@ public class InterpreterRestApi {
   }
 
   /**
-   * get metadata values
+   * Get metadata values.
    */
   @GET
   @Path("metadata/{settingId}")
@@ -262,7 +261,7 @@ public class InterpreterRestApi {
   }
 
   /**
-   * Delete repository
+   * Delete repository.
    *
    * @param repoId ID of repository
    */
@@ -282,12 +281,11 @@ public class InterpreterRestApi {
   }
 
   /**
-   * Get available types for property
+   * Get available types for property.
    */
   @GET
   @Path("property/types")
   public Response listInterpreterPropertyTypes() {
     return new JsonResponse<>(Status.OK, InterpreterPropertyType.getTypes()).build();
   }
-
 }

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/1add74b4/zeppelin-server/src/main/java/org/apache/zeppelin/rest/LoginRestApi.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/main/java/org/apache/zeppelin/rest/LoginRestApi.java b/zeppelin-server/src/main/java/org/apache/zeppelin/rest/LoginRestApi.java
index b590bdb..0bfcdef 100644
--- a/zeppelin-server/src/main/java/org/apache/zeppelin/rest/LoginRestApi.java
+++ b/zeppelin-server/src/main/java/org/apache/zeppelin/rest/LoginRestApi.java
@@ -16,11 +16,23 @@
  */
 package org.apache.zeppelin.rest;
 
+import org.apache.shiro.authc.AuthenticationException;
+import org.apache.shiro.authc.AuthenticationToken;
+import org.apache.shiro.authc.IncorrectCredentialsException;
+import org.apache.shiro.authc.LockedAccountException;
+import org.apache.shiro.authc.UnknownAccountException;
+import org.apache.shiro.authc.UsernamePasswordToken;
+import org.apache.shiro.realm.Realm;
+import org.apache.shiro.subject.Subject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Map;
+
 import javax.ws.rs.FormParam;
 import javax.ws.rs.GET;
 import javax.ws.rs.POST;
@@ -31,14 +43,7 @@ import javax.ws.rs.core.Cookie;
 import javax.ws.rs.core.HttpHeaders;
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.Response.Status;
-import org.apache.shiro.authc.AuthenticationException;
-import org.apache.shiro.authc.AuthenticationToken;
-import org.apache.shiro.authc.IncorrectCredentialsException;
-import org.apache.shiro.authc.LockedAccountException;
-import org.apache.shiro.authc.UnknownAccountException;
-import org.apache.shiro.authc.UsernamePasswordToken;
-import org.apache.shiro.realm.Realm;
-import org.apache.shiro.subject.Subject;
+
 import org.apache.zeppelin.annotation.ZeppelinApi;
 import org.apache.zeppelin.notebook.NotebookAuthorization;
 import org.apache.zeppelin.realm.jwt.JWTAuthenticationToken;
@@ -46,17 +51,13 @@ import org.apache.zeppelin.realm.jwt.KnoxJwtRealm;
 import org.apache.zeppelin.server.JsonResponse;
 import org.apache.zeppelin.ticket.TicketContainer;
 import org.apache.zeppelin.utils.SecurityUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
- * Created for org.apache.zeppelin.rest.message on 17/03/16.
+ * Created for org.apache.zeppelin.rest.message.
  */
-
 @Path("/login")
 @Produces("application/json")
 public class LoginRestApi {
-
   private static final Logger LOG = LoggerFactory.getLogger(LoginRestApi.class);
 
   /**
@@ -66,7 +67,6 @@ public class LoginRestApi {
     super();
   }
 
-
   @GET
   @ZeppelinApi
   public Response getLogin(@Context HttpHeaders headers) {
@@ -229,5 +229,4 @@ public class LoginRestApi {
     }
     return redirectURL.toString();
   }
-
 }

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/1add74b4/zeppelin-server/src/main/java/org/apache/zeppelin/rest/NotebookRepoRestApi.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/main/java/org/apache/zeppelin/rest/NotebookRepoRestApi.java b/zeppelin-server/src/main/java/org/apache/zeppelin/rest/NotebookRepoRestApi.java
index a8bcbef..9127ac0 100644
--- a/zeppelin-server/src/main/java/org/apache/zeppelin/rest/NotebookRepoRestApi.java
+++ b/zeppelin-server/src/main/java/org/apache/zeppelin/rest/NotebookRepoRestApi.java
@@ -16,6 +16,13 @@
  */
 package org.apache.zeppelin.rest;
 
+import com.google.common.collect.ImmutableMap;
+import com.google.gson.JsonSyntaxException;
+
+import org.apache.commons.lang.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import java.util.Collections;
 import java.util.List;
 
@@ -26,7 +33,6 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.Response.Status;
 
-import org.apache.commons.lang.StringUtils;
 import org.apache.zeppelin.annotation.ZeppelinApi;
 import org.apache.zeppelin.notebook.repo.NotebookRepoSync;
 import org.apache.zeppelin.notebook.repo.NotebookRepoWithSettings;
@@ -35,11 +41,6 @@ import org.apache.zeppelin.server.JsonResponse;
 import org.apache.zeppelin.socket.NotebookServer;
 import org.apache.zeppelin.user.AuthenticationInfo;
 import org.apache.zeppelin.utils.SecurityUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.collect.ImmutableMap;
-import com.google.gson.JsonSyntaxException;
 
 /**
  * NoteRepo rest API endpoint.
@@ -48,7 +49,6 @@ import com.google.gson.JsonSyntaxException;
 @Path("/notebook-repositories")
 @Produces("application/json")
 public class NotebookRepoRestApi {
-
   private static final Logger LOG = LoggerFactory.getLogger(NotebookRepoRestApi.class);
 
   private NotebookRepoSync noteRepos;
@@ -62,7 +62,7 @@ public class NotebookRepoRestApi {
   }
 
   /**
-   * List all notebook repository
+   * List all notebook repository.
    */
   @GET
   @ZeppelinApi
@@ -74,7 +74,7 @@ public class NotebookRepoRestApi {
   }
 
   /**
-   * Reload notebook repository
+   * Reload notebook repository.
    */
   @GET
   @Path("reload")
@@ -99,7 +99,7 @@ public class NotebookRepoRestApi {
       return new JsonResponse<>(Status.NOT_FOUND, "", Collections.emptyMap()).build();
     }
     AuthenticationInfo subject = new AuthenticationInfo(SecurityUtils.getPrincipal());
-    NotebookRepoSettingsRequest newSettings = NotebookRepoSettingsRequest.EMPTY;
+    NotebookRepoSettingsRequest newSettings;
     try {
       newSettings = NotebookRepoSettingsRequest.fromJson(payload);
     } catch (JsonSyntaxException e) {


Mime
View raw message