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

Colin Patrick McCabe commented on HDFS-3643:
--------------------------------------------

We put braces around all "if" statements.  The "else" should be on the same 
line as the close bracket.

{code}
229         if (returnType == '\0')
230             return newRuntimeError(env,
231                                    "invokeMethod: return type missing after 
')'");
{code}
This "if" statement isn't needed since {{strchr}} will either return NULL, or a 
pointer to a the first occurrence of a right paren in the string.  It can't 
return a pointer to a 0 byte.

Looks good aside from that.

> hdfsJniHelper.c unchecked string pointers
> -----------------------------------------
>
>                 Key: HDFS-3643
>                 URL: https://issues.apache.org/jira/browse/HDFS-3643
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: libhdfs
>    Affects Versions: 2.0.0-alpha
>            Reporter: Andy Isaacson
>            Assignee: Andy Isaacson
>         Attachments: HDFS-3643.02.patch, hdfs-3643-1.txt, hdfs3643-2.txt, 
> hdfs3643.txt
>
>
> {code}
>     str = methSignature;
>     while (*str != ')') str++;
>     str++;
>     returnType = *str;
> {code}
> This loop needs to check for {{'\0'}}. Also the following {{if/else if/else 
> if}} cascade doesn't handle unexpected values.



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

Reply via email to