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

Tsz Wo (Nicholas), SZE commented on HADOOP-4204:
------------------------------------------------

For the Findbugs warning SR_NOT_CHECKED in StreamXmlRecordReader, I think we 
should fix it, instead of excluding it.

We may fix it as below:
{code}
-      skippedBytes = bin_.skip(endPos); //Skip succeeds as we have already 
read this is buffer
+      for(long skiplen = endPos; skiplen > 0; ) {
+        skiplen -= bin_.skip(skiplen); //Skip succeeds as we have already read 
this is buffer
+      }
{code}
However, if bin_.skip(skiplen) keeps returning 0, it will end up a infinite 
loop.  We might throw an exception in such case.

> Fix warnings generated by FindBugs
> ----------------------------------
>
>                 Key: HADOOP-4204
>                 URL: https://issues.apache.org/jira/browse/HADOOP-4204
>             Project: Hadoop Core
>          Issue Type: Bug
>         Environment: This is compile time issue
>            Reporter: Suresh Srinivas
>            Assignee: Suresh Srinivas
>             Fix For: 0.19.0
>
>         Attachments: HADOOP-4204.patch, HADOOP-4204.patch
>
>
> There are several warnings currently printed by findbugs. These need to be 
> addressed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to