You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@sentry.apache.org by "Hadoop QA (JIRA)" <ji...@apache.org> on 2019/01/03 18:19:00 UTC

[jira] [Commented] (SENTRY-2469) Fix bugs in RoleServlet

    [ https://issues.apache.org/jira/browse/SENTRY-2469?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16733322#comment-16733322 ] 

Hadoop QA commented on SENTRY-2469:
-----------------------------------

Here are the results of testing the latest attachment
https://issues.apache.org/jira/secure/attachment/12952919/SENTRY-2469.001.patch against master.

{color:green}Overall:{color} +1 all checks pass

{color:green}SUCCESS:{color} all tests passed

Console output: https://builds.apache.org/job/PreCommit-SENTRY-Build/4303/console

This message is automatically generated.

> Fix bugs in RoleServlet
> -----------------------
>
>                 Key: SENTRY-2469
>                 URL: https://issues.apache.org/jira/browse/SENTRY-2469
>             Project: Sentry
>          Issue Type: Bug
>          Components: Sentry
>    Affects Versions: 2.2.0
>            Reporter: Na Li
>            Priority: Major
>         Attachments: SENTRY-2469.001.patch
>
>
> Fredy found several issues in RoleServlet.java. We need to fix it.
> 1. `RoleServlet` at L62 needs to use either `try` resource or put it in the `finally` block to avoid resource leak
> 2. `if (conf.getBoolean(ServerConfig.SENTRY_WEB_ENABLE, ServerConfig.SENTRY_WEB_ENABLE_DEFAULT))` may return an NPE if `conf.getBoolean` returns a `null` `Boolean` (not the primitive type)
> 3. `RoleServlet` at L45, use `Preconditions.checkNotNull` or `Objects.requreNonNull` instead of `assert`
> 4. `RoleServlet` at L55: `String json = new Gson().toJson(roleMap);`, it's better to reuse the `Gson` instance.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)