You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2019/06/14 16:58:23 UTC
[GitHub] [accumulo] keith-turner edited a comment on issue #1206: Fix #1181
Update MasterMetadataUtil to use new Ample api
keith-turner edited a comment on issue #1206: Fix #1181 Update MasterMetadataUtil to use new Ample api
URL: https://github.com/apache/accumulo/pull/1206#issuecomment-502186297
> Personally I dislike null checks and usually try to ensure objects floating around are not null and have noticed they are not prevalent in the code base BUT, often the checks do serve a needed purpose.
I like them when it causes fail fast. For example the following code would not fail fast. Adding a null check would fail fast.
```java
void setItems(List items) {
// If null, this code may fail later when something tries to use this.item.. would be nicer to get
// a stacktrace for the code calling set
this.items = items;
}
```
If the function is using the passed in argument a NPE would naturally happen w/o an explicit null check.
> Note my comment on the collections assumed "not null".
Assuming not null is fine because the collection is being used and you would get a NPE at that point if it were 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:
users@infra.apache.org
With regards,
Apache Git Services