Colm - good catch. Thanks! Ramesh - I would suggest using CollectionUtils.isNotEmpty(dbList), which makes it easier to read. Please review and update.
Thanks, Madhan On 3/18/16, 3:48 AM, "Colm O hEigeartaigh" <[email protected]> wrote: >I believe there is an error in this commit... > >+ if (dbList != null && dbList.size() >== 0) { > >It should be if the size() != 0 here. > >Colm. > >On Thu, Mar 17, 2016 at 9:13 PM, <[email protected]> wrote: > >> Repository: incubator-ranger >> Updated Branches: >> refs/heads/master 0ecac71fd -> 4b6068c5b >> >> >> RANGER-878: coverity-scan-fix >> >> >> Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo >> Commit: >> http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/4b6068c5 >> Tree: >> http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/4b6068c5 >> Diff: >> http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/4b6068c5 >> >> Branch: refs/heads/master >> Commit: 4b6068c5be42607e0a731c612a1a9294eae1b9c7 >> Parents: 0ecac71 >> Author: rmani <[email protected]> >> Authored: Thu Mar 17 14:12:55 2016 -0700 >> Committer: rmani <[email protected]> >> Committed: Thu Mar 17 14:12:55 2016 -0700 >> >> ---------------------------------------------------------------------- >> .../org/apache/ranger/services/hive/client/HiveClient.java | 6 ++++-- >> 1 file changed, 4 insertions(+), 2 deletions(-) >> ---------------------------------------------------------------------- >> >> >> >> http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/4b6068c5/hive-agent/src/main/java/org/apache/ranger/services/hive/client/HiveClient.java >> ---------------------------------------------------------------------- >> diff --git >> a/hive-agent/src/main/java/org/apache/ranger/services/hive/client/HiveClient.java >> b/hive-agent/src/main/java/org/apache/ranger/services/hive/client/HiveClient.java >> index fe05ddd..67e47b9 100644 >> --- >> a/hive-agent/src/main/java/org/apache/ranger/services/hive/client/HiveClient.java >> +++ >> b/hive-agent/src/main/java/org/apache/ranger/services/hive/client/HiveClient.java >> @@ -579,8 +579,10 @@ public class HiveClient extends BaseClient implements >> Closeable { >> System.out.println("No database >> found with db filter [" + args[1] + "]") ; >> } >> else { >> - for (String str : dbList ) { >> - >> System.out.println("database: " + str ) ; >> + if (dbList != null && >> dbList.size() == 0) { >> + for (String str : dbList ) >> { >> + >> System.out.println("database: " + str ) ; >> + } >> } >> } >> } >> >> > > >-- >Colm O hEigeartaigh > >Talend Community Coder >http://coders.talend.com
