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

Peter Bacsko commented on OOZIE-3002:
-------------------------------------

I ran the findbugs-diff part locally and it returned the same errors as above:

{noformat}
 At JsonToBean.java:[line 259]: Primitive value is boxed and then immediately 
unboxed in 
org.apache.oozie.client.rest.JsonToBean$JsonInvocationHandler.parseType(Class, 
Object)
 At JsonToBean.java:[line 259]: Boxed value is unboxed and then immediately 
reboxed in 
org.apache.oozie.client.rest.JsonToBean$JsonInvocationHandler.parseType(Class, 
Object)
 At JsonToBean.java:[line 259]: Boxed value is unboxed and then immediately 
reboxed in 
org.apache.oozie.client.rest.JsonToBean$JsonInvocationHandler.parseType(Class, 
Object)
{noformat}

[~dbist13] could you explain this part?

{noformat}
            else if (type == Integer.TYPE) {
                return (obj != null) ? Long.valueOf((long) obj).intValue() : 
new Integer(0);
            }
{noformat}

Why do we cast the incoming object to a long if we expect an integer?

I opened {{TestJsonToBean.java}} and found some weird things:

{noformat}
json.put(JsonTags.WORKFLOW_ACTION_RETRIES, (long)1);
...
json.put(JsonTags.COORDINATOR_JOB_CONCURRENCY, (long)2);
json.put(JsonTags.COORDINATOR_JOB_TIMEOUT, (long)3);
{noformat}

What's the point of all this?

> address findbugs errors in client lib
> -------------------------------------
>
>                 Key: OOZIE-3002
>                 URL: https://issues.apache.org/jira/browse/OOZIE-3002
>             Project: Oozie
>          Issue Type: Bug
>          Components: client
>    Affects Versions: 4.3.0
>         Environment: Java 1.8.0.131
> Maven 3.5.0
> OSX 10.12.5
> commit 18694b616f419ed958230cedb2dc0431a9f9cb5d
>            Reporter: Artem Ervits
>            Assignee: Artem Ervits
>         Attachments: OOZIE-3002-0.patch
>
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to