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

Todd Lipcon commented on HADOOP-9439:
-------------------------------------

bq. I don't see the point of putting all variable declarations on separate 
lines. Java allows declaration of variables on the same line as well

The point is that when a lot of people see {{int a, b, c = 0;}} they think that 
all three variables are getting set to 0, but in fact it's only {{c}} that is 
set. Putting on separate lines makes it more obvious -- probably not important 
if you expect mostly veteran C programmers to read the code, but given that a 
lot of folks in the Hadoop community rarely look at C, I figured it would be 
more obvious this way.

In Java, you always get a compile time error for accessing an uninitialized 
variable, whereas in C it's just a warning, which I'm certain we'll miss in the 
compile spew of a Hadoop build. So, probably better to explicitly initialize 
all the variables, whether on one line or multiple.
                
> JniBasedUnixGroupsMapping: fix some crash bugs
> ----------------------------------------------
>
>                 Key: HADOOP-9439
>                 URL: https://issues.apache.org/jira/browse/HADOOP-9439
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: native
>    Affects Versions: 2.0.4-alpha
>            Reporter: Colin Patrick McCabe
>            Assignee: Colin Patrick McCabe
>            Priority: Minor
>         Attachments: HADOOP-9439.001.patch, HADOOP-9439.003.patch, 
> HADOOP-9439.005.patch, HDFS-4640.002.patch
>
>
> JniBasedUnixGroupsMapping has some issues.
> * sometimes on error paths variables are freed prior to being initialized
> * re-allocate buffers less frequently (can reuse the same buffer for multiple 
> calls to getgrnam)
> * allow non-reentrant functions to be used, to work around client bugs
> * don't throw IOException from JNI functions if the JNI functions do not 
> declare this checked exception.
> * don't bail out if only one group name among all the ones associated with a 
> user can't be looked up.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to