You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sqoop.apache.org by "Sqoop QA bot (JIRA)" <ji...@apache.org> on 2016/02/06 02:40:39 UTC

[jira] [Commented] (SQOOP-2823) Sqoop2: RESTiliency: Remove repetitive try-catch block for accessing POST and PUT request

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

Sqoop QA bot commented on SQOOP-2823:
-------------------------------------

Testing file [SQOOP-2823.patch|https://issues.apache.org/jira/secure/attachment/12786590/SQOOP-2823.patch] against branch sqoop2 took 1:31:03.249232.

{color:red}Overall:{color} -1 due to an error(s), see details below:

{color:green}SUCCESS:{color} Clean was successful
{color:green}SUCCESS:{color} Patch applied correctly
{color:red}ERROR:{color} Patch does not add/modify any test case
{color:green}SUCCESS:{color} License check passed
{color:green}SUCCESS:{color} Patch compiled
{color:green}SUCCESS:{color} All unit tests passed (executed 1700 tests)
{color:green}SUCCESS:{color} Test coverage did not decreased ([report|https://builds.apache.org/job/PreCommit-SQOOP-Build/2177/artifact/patch-process/cobertura_report.txt])
{color:green}SUCCESS:{color} No new findbugs warnings ([report|https://builds.apache.org/job/PreCommit-SQOOP-Build/2177/artifact/patch-process/findbugs_report.txt])
{color:red}ERROR:{color} Some of integration tests failed ([report|https://builds.apache.org/job/PreCommit-SQOOP-Build/2177/artifact/patch-process/test_integration.txt], executed 0 tests)

Console output is available [here|https://builds.apache.org/job/PreCommit-SQOOP-Build/2177/console].

This message is automatically generated.

> Sqoop2: RESTiliency: Remove repetitive try-catch block for accessing POST and PUT request
> -----------------------------------------------------------------------------------------
>
>                 Key: SQOOP-2823
>                 URL: https://issues.apache.org/jira/browse/SQOOP-2823
>             Project: Sqoop
>          Issue Type: Bug
>            Reporter: Jarek Jarcec Cecho
>            Assignee: Jarek Jarcec Cecho
>             Fix For: 1.99.7
>
>         Attachments: SQOOP-2823.patch
>
>
> I've noticed that we have quite a few repetition of code like this one:
> {code}
>      RoleBean bean = new RoleBean();
>     try {
>       JSONObject json = JSONUtils.parse(ctx.getRequest().getReader());
>       bean.restore(json);
>     } catch (IOException e) {
>       throw new SqoopException(ServerError.SERVER_0003, "Can't read request content", e);
>     }
> {code}
> It's relatively a lot of code just because {{ctx.getRequest()}} can throw an exception. I would like to propose to create a method in our {{ctx}} wrapper to provide the {{getReader}} method without any exception, which will simplify the code to:
> {code}
>     bean.restore(JSONUtils.parse(ctx.getReader()));
> {code}
> We'll of course throw an exception on failure - but using our {{SqoopException}} mechanism.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)