Junping Du commented on YARN-3276:

Hi [~gtCarrera], you are right that specific case here won't cause NPE. I think 
I should fix my previous comments in YARN-3087 with following: for more generic 
case that it is not a good practice (or even we can say dangerous) to cast a 
null object, which could potentially cause some exceptions, like NPE (if 
unboxing afterwards) or incompatible type exception (null object comes from a 
different type). :)

> Fix NPE and refactor in some map cast for TimelineEntity
> --------------------------------------------------------
>                 Key: YARN-3276
>                 URL: https://issues.apache.org/jira/browse/YARN-3276
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: timelineserver
>            Reporter: Junping Du
>            Assignee: Junping Du
>         Attachments: YARN-3276-v2.patch, YARN-3276.patch
> Per discussion in YARN-3087, we need to refactor some similar logic to cast 
> map to hashmap and get rid of NPE issue.

This message was sent by Atlassian JIRA

Reply via email to