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

Bharat Viswanadham edited comment on HDDS-1738 at 9/20/19 10:20 PM:
--------------------------------------------------------------------

Hi [~cxorm]

For few of classes OMClientResponse extended classes, we have not added notion 
of @Nullable.

Example:

[lOmBucketCreateResponse|[https://github.com/apache/hadoop/blob/trunk/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/bucket/OMBucketCreateResponse.java]]

In this class OmBucketInfo can be null, in case of error. So, add the notation 
of @Nullable for this field, and similarly, OmResponse field should never be 
null, add @NonNull. This has to be done for all the child classes of 
OmClientResponse.


was (Author: bharatviswa):
Hi [~cxorm]

For few of classes OMClientResponse extended classes, we have not added notion 
of @Nullable.

Example 
[OmBucketCreateResponse.java|[https://github.com/apache/hadoop/blob/trunk/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/bucket/OMBucketCreateResponse.java]]
 in this class OmBucketInfo can be null, in case of error. So, add the notation 
of @Nullable for this field, and similarly OmResponse field should never be 
null, add @NonNull. This has to be done for all the child classes of 
OmClientResponse.

> Add nullable annotation for OMResponse classes
> ----------------------------------------------
>
>                 Key: HDDS-1738
>                 URL: https://issues.apache.org/jira/browse/HDDS-1738
>             Project: Hadoop Distributed Data Store
>          Issue Type: Sub-task
>            Reporter: Bharat Viswanadham
>            Assignee: YiSheng Lien
>            Priority: Major
>              Labels: newbie
>
> This is to address [~arp] comment.
> A future improvement unrelated to your patch - replace null with Optional. Or 
> at least add [@nullable|https://github.com/nullable] annotation on the 
> parameter.
> Add @nullable for all OMResponse fields, where fields can be null.
>  
>   



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to