Repository: incubator-atlas Updated Branches: refs/heads/0.8-incubating fa75c27d2 -> 68bb6bec7
ATLAS-1735: Coverity Scan Fixes for 4/13 Signed-off-by: apoorvnaik <an...@hortonworks.com> Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/e60b2655 Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/e60b2655 Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/e60b2655 Branch: refs/heads/0.8-incubating Commit: e60b2655d59fff396c4abc7b21a1cf85b453cd89 Parents: fa75c27 Author: ashutoshm <ames...@hortonworks.com> Authored: Tue Apr 18 10:49:00 2017 -0700 Committer: apoorvnaik <an...@hortonworks.com> Committed: Wed Apr 19 07:38:37 2017 -0700 ---------------------------------------------------------------------- .../main/java/org/apache/atlas/utils/AuthenticationUtil.java | 7 ++++++- .../org/apache/atlas/repository/impexp/ExportServiceTest.java | 6 ++++++ .../org/apache/atlas/repository/impexp/ZipSourceTest.java | 3 +++ 3 files changed, 15 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/e60b2655/common/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java b/common/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java index b5b0026..09d8085 100644 --- a/common/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java +++ b/common/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java @@ -54,7 +54,12 @@ public final class AuthenticationUtil { try { Console console = System.console(); username = console.readLine("Enter username for atlas :- "); - password = new String(console.readPassword("Enter password for atlas :- ")); + + char[] pwdChar = console.readPassword("Enter password for atlas :- "); + if(pwdChar != null) { + password = new String(pwdChar); + } + } catch (Exception e) { System.out.print("Error while reading "); System.exit(1); http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/e60b2655/repository/src/test/java/org/apache/atlas/repository/impexp/ExportServiceTest.java ---------------------------------------------------------------------- diff --git a/repository/src/test/java/org/apache/atlas/repository/impexp/ExportServiceTest.java b/repository/src/test/java/org/apache/atlas/repository/impexp/ExportServiceTest.java index bac831b..a7c70a9 100644 --- a/repository/src/test/java/org/apache/atlas/repository/impexp/ExportServiceTest.java +++ b/repository/src/test/java/org/apache/atlas/repository/impexp/ExportServiceTest.java @@ -253,6 +253,8 @@ public class ExportServiceTest { while (zipSource.hasNext()) { AtlasEntity entity = zipSource.next(); + + Assert.assertNotNull(entity); Assert.assertEquals(entity.getStatus(), AtlasEntity.Status.ACTIVE); Assert.assertTrue(expectedEntityTypes.contains(entity.getTypeName())); } @@ -266,6 +268,8 @@ public class ExportServiceTest { Assert.assertTrue(zipSource.hasNext()); AtlasEntity entity = zipSource.next(); + + Assert.assertNotNull(entity); Assert.assertTrue(entity.getTypeName().equals("Department")); Assert.assertEquals(entity.getStatus(), AtlasEntity.Status.ACTIVE); verifyTypeDefs(zipSource); @@ -277,6 +281,8 @@ public class ExportServiceTest { Assert.assertTrue(zipSource.hasNext()); AtlasEntity entity = zipSource.next(); + + Assert.assertNotNull(entity); Assert.assertTrue(entity.getTypeName().equals("Department")); Assert.assertEquals(entity.getStatus(), AtlasEntity.Status.ACTIVE); verifyTypeDefs(zipSource); http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/e60b2655/repository/src/test/java/org/apache/atlas/repository/impexp/ZipSourceTest.java ---------------------------------------------------------------------- diff --git a/repository/src/test/java/org/apache/atlas/repository/impexp/ZipSourceTest.java b/repository/src/test/java/org/apache/atlas/repository/impexp/ZipSourceTest.java index e124ffc..8b042d7 100644 --- a/repository/src/test/java/org/apache/atlas/repository/impexp/ZipSourceTest.java +++ b/repository/src/test/java/org/apache/atlas/repository/impexp/ZipSourceTest.java @@ -49,6 +49,7 @@ public class ZipSourceTest { @Test(dataProvider = "zipFileStocks") public void examineContents_BehavesAsExpected(ZipSource zipSource) throws IOException, AtlasBaseException { List<String> creationOrder = zipSource.getCreationOrder(); + Assert.assertNotNull(creationOrder); Assert.assertEquals(creationOrder.size(), 4); @@ -98,6 +99,8 @@ public class ZipSourceTest { List<String> creationOrder = zipSource.getCreationOrder(); for (int i = 0; i < creationOrder.size(); i++) { AtlasEntity e = zipSource.next(); + + Assert.assertNotNull(e); Assert.assertEquals(e.getGuid(), creationOrder.get(i)); }