atlas-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apoorvn...@apache.org
Subject [1/2] incubator-atlas git commit: ATLAS-1735: Coverity Scan Fixes for 4/13
Date Wed, 19 Apr 2017 14:36:21 GMT
Repository: incubator-atlas
Updated Branches:
  refs/heads/master be93da8b8 -> 0fc1c1161


ATLAS-1735: Coverity Scan Fixes for 4/13

Signed-off-by: apoorvnaik <anaik@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/29524aa0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/29524aa0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/29524aa0

Branch: refs/heads/master
Commit: 29524aa06de730ce80b2a42672e46d1f5492d4cd
Parents: be93da8
Author: ashutoshm <amestry@hortonworks.com>
Authored: Tue Apr 18 10:49:00 2017 -0700
Committer: apoorvnaik <anaik@hortonworks.com>
Committed: Wed Apr 19 07:35:32 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/29524aa0/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/29524aa0/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/29524aa0/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));
         }
 


Mime
View raw message