You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sqoop.apache.org by ja...@apache.org on 2015/08/24 19:48:25 UTC

sqoop git commit: SQOOP-2522: Sqoop2: Findbugs: Fix warning in security module

Repository: sqoop
Updated Branches:
  refs/heads/sqoop2 709dd3671 -> d64cf2156


SQOOP-2522: Sqoop2: Findbugs: Fix warning in security module

(Colin Ma via Jarek Jarcec Cecho)


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

Branch: refs/heads/sqoop2
Commit: d64cf215630098d7e3f52e994dd277923d35f8e7
Parents: 709dd36
Author: Jarek Jarcec Cecho <ja...@apache.org>
Authored: Mon Aug 24 10:48:02 2015 -0700
Committer: Jarek Jarcec Cecho <ja...@apache.org>
Committed: Mon Aug 24 10:48:02 2015 -0700

----------------------------------------------------------------------
 .../sqoop/security/authorization/AuthorizationEngine.java    | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/d64cf215/security/src/main/java/org/apache/sqoop/security/authorization/AuthorizationEngine.java
----------------------------------------------------------------------
diff --git a/security/src/main/java/org/apache/sqoop/security/authorization/AuthorizationEngine.java b/security/src/main/java/org/apache/sqoop/security/authorization/AuthorizationEngine.java
index 358a8bd..bebbe91 100644
--- a/security/src/main/java/org/apache/sqoop/security/authorization/AuthorizationEngine.java
+++ b/security/src/main/java/org/apache/sqoop/security/authorization/AuthorizationEngine.java
@@ -51,7 +51,7 @@ public class AuthorizationEngine {
           checkPrivilege(doUserName, getPrivilege(type, name, MPrivilege.ACTION.READ));
           // add valid resource
           return true;
-        } catch (Exception e) {
+        } catch (RuntimeException e) {
           //do not add into result if invalid resource
           return false;
         }
@@ -145,7 +145,7 @@ public class AuthorizationEngine {
           checkPrivilege(doUserName, getPrivilege(MResource.TYPE.JOB, jobId, MPrivilege.ACTION.READ));
           // add valid submission
           return true;
-        } catch (Exception e) {
+        } catch (RuntimeException e) {
           //do not add into result if invalid submission
           return false;
         }
@@ -176,12 +176,12 @@ public class AuthorizationEngine {
     for (MPrivilege privilege : privileges) {
       Repository repository = RepositoryManager.getInstance().getRepository();
       if (MResource.TYPE.LINK.name().equalsIgnoreCase(privilege.getResource().getType())) {
-        MLink link = repository.findLink(Long.valueOf(privilege.getResource().getName()));
+        MLink link = repository.findLink(Long.parseLong(privilege.getResource().getName()));
         if (!doUserName.equals(link.getCreationUser())) {
           privilegesNeedCheck.add(privilege);
         }
       } else if (MResource.TYPE.JOB.name().equalsIgnoreCase(privilege.getResource().getType())) {
-        MJob job = repository.findJob(Long.valueOf(privilege.getResource().getName()));
+        MJob job = repository.findJob(Long.parseLong(privilege.getResource().getName()));
         if (!doUserName.equals(job.getCreationUser())) {
           privilegesNeedCheck.add(privilege);
         }