bharatviswa504 edited a comment on pull request #1244:
URL: https://github.com/apache/hadoop-ozone/pull/1244#issuecomment-663149010


   >As the parameter omMultipartKeyInfo of S3MultipartUploadCommitPartResponse 
is annotation to Nullable, so, we should >consider possible NPE, for this, i 
have two suggestion
   >Mark omMultipartKeyInfo Nonnull, and keep the callee never give a null to 
it.
   
   When NO_SUCH_MULTIPART_UPLOAD_ERROR omMultipartKeyInfo will be null. So, in 
this case we should not use omMultipartKeyInfo. The previous code has bug that 
caused this issue.
   
   >Also give a null pointer check for omMultipartKeyInfo int 
S3MultipartUploadCommitPartResponse#addToDBBatch, to avoid >NPE.
   And when Status is OK, omMultipartKeyInfo will not be null, so we don't need 
an additional null check here. We have already checked the Status, and we 
access omMultipartKeyInfo only when the status is OK. I don't see any 
possibility when the status is OK, omMultipartKeyInfo to be null. Let me know 
if you still see any possibility. We can add a null check, but trying to 
understand here if there is any missed case, as already status OK check guarded 
it.
   
   Tagged omMultipartKeyInfo as nullable because when error is 
NO_SUCH_MULTIPART_UPLOAD_ERROR, the value will be null.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org

Reply via email to