> On Jan. 14, 2020, 12:29 p.m., Abhay Kulkarni wrote: > > agents-common/src/main/java/org/apache/ranger/plugin/store/EmbeddedServiceDefsUtil.java > > Lines 304 (patched) > > <https://reviews.apache.org/r/71992/diff/2/?file=2205599#file2205599line304> > > > > Is there any specific reason to use Objects.noNull(ret) construct? > > Would the following be easier to read? > > > > if (ret != null && StringUtils.isBlank(ret.getDisplayName())) { > > ret.setDisplayName(ret.getName()); > > }
Objects.noNull(ret) construct is similar to StringUtils.isBlank(ret.getDisplayName()). We are already using StringUtils.isBlank(ret.getDisplayName()) style construct. Hence for consistency and readability I have used it. - Kishor ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/71992/#review219253 ----------------------------------------------------------- On Jan. 14, 2020, 10:38 a.m., Kishor Gollapalliwar wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/71992/ > ----------------------------------------------------------- > > (Updated Jan. 14, 2020, 10:38 a.m.) > > > Review request for ranger, Jayendra Parab, Abhay Kulkarni, Madhan Neethiraj, > Mehul Parikh, Pradeep Agrawal, and Velmurugan Periasamy. > > > Bugs: RANGER-2695 > https://issues.apache.org/jira/browse/RANGER-2695 > > > Repository: ranger > > > Description > ------- > > Ranger creates ServiceDef(s) as part of initial setup. While creating these > ServiceDef(s) it refers respective JSON file. If display name for a > ServiceDef is not provided OR it is empty, ServiceDef's name should be used > as DEFAULT displayName for that ServiceDef. > > > Diffs > ----- > > > agents-common/src/main/java/org/apache/ranger/plugin/store/EmbeddedServiceDefsUtil.java > e96f881ac > > > Diff: https://reviews.apache.org/r/71992/diff/2/ > > > Testing > ------- > > Setup Ranger using following scenarios: > 1. No displayName attribute in JSON file. > 2. displayName attribute with empty string. > 3. displayName attribute with string other than name. > > > Thanks, > > Kishor Gollapalliwar > >