Uploaded image for project: 'Atlas'
  1. Atlas
  2. ATLAS-1735

Coverity Scan Issues Detected on 4/13

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 0.8-incubating
    • 0.8.1, 1.0.0
    • atlas-core
    • None

    Description

      Please find the latest report on new defect(s) introduced to Apache Atlas found with Coverity Scan.

      6 new defect(s) introduced to Apache Atlas found with Coverity Scan.
      1 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan.

      New defect(s) Reported-by: Coverity Scan
      Showing 6 of 6 defect(s)

        • CID 161397: Null pointer dereferences (NULL_RETURNS)
          /common/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java: 57 in org.apache.atlas.utils.AuthenticationUtil.getBasicAuthenticationInput()()

      ________________________________________________________________________________________________________

          • CID 161397: Null pointer dereferences (NULL_RETURNS)
            /common/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java: 57 in org.apache.atlas.utils.AuthenticationUtil.getBasicAuthenticationInput()()
            51 String username = null;
            52 String password = null;
            53
            54 try { 55 Console console = System.console(); 56 username = console.readLine("Enter username for atlas :- "); >>> CID 161397: Null pointer dereferences (NULL_RETURNS) >>> Dereferencing a pointer that might be null "console.readPassword("Enter password for atlas :- ")" when calling "String". 57 password = new String(console.readPassword("Enter password for atlas :- ")); 58 }

            catch (Exception e)

            { 59 System.out.print("Error while reading "); 60 System.exit(1); 61 }

            62 return new String[]

            {username, password}

            ;
            63 }
            64

        • CID 161396: Null pointer dereferences (NULL_RETURNS)
          /repository/src/test/java/org/apache/atlas/repository/impexp/ZipFileResourceTestUtils.java: 148 in org.apache.atlas.repository.impexp.ZipFileResourceTestUtils.runAndVerifyQuickStart_v1_Import(org.apache.atlas.repository.impexp.ImportService, org.apache.atlas.repository.impexp.ZipSource)()

      ________________________________________________________________________________________________________

          • CID 161396: Null pointer dereferences (NULL_RETURNS)
            /repository/src/test/java/org/apache/atlas/repository/impexp/ZipFileResourceTestUtils.java: 148 in org.apache.atlas.repository.impexp.ZipFileResourceTestUtils.runAndVerifyQuickStart_v1_Import(org.apache.atlas.repository.impexp.ImportService, org.apache.atlas.repository.impexp.ZipSource)()
            142 AtlasImportResult result = importService.run(source, request, userName, hostName, requestingIP);
            143 Assert.assertEquals(result.getOperationStatus(), AtlasImportResult.OperationStatus.SUCCESS);
            144 return result;
            145 }
            146
            147 public static void runAndVerifyQuickStart_v1_Import(ImportService importService, ZipSource zipSource) throws AtlasBaseException, IOException {
            >>> CID 161396: Null pointer dereferences (NULL_RETURNS)
            >>> Assigning: "exportResult" = null return value from "getExportResult".
            148 AtlasExportResult exportResult = zipSource.getExportResult();
            149 List<String> creationOrder = zipSource.getCreationOrder();
            150
            151 AtlasImportRequest request = getDefaultImportRequest();
            152 AtlasImportResult result = runImportWithParameters(importService, request, zipSource);
            153
        • CID 161395: Null pointer dereferences (NULL_RETURNS)
          /repository/src/test/java/org/apache/atlas/repository/impexp/ExportServiceTest.java: 256 in org.apache.atlas.repository.impexp.ExportServiceTest.verifyExportForEmployeeData(org.apache.atlas.repository.impexp.ZipSource)()

      ________________________________________________________________________________________________________

          • CID 161395: Null pointer dereferences (NULL_RETURNS)
            /repository/src/test/java/org/apache/atlas/repository/impexp/ExportServiceTest.java: 256 in org.apache.atlas.repository.impexp.ExportServiceTest.verifyExportForEmployeeData(org.apache.atlas.repository.impexp.ZipSource)()
            250 Assert.assertNotNull(zipSource.getCreationOrder());
            251 Assert.assertEquals(zipSource.getCreationOrder().size(), 2);
            252 Assert.assertTrue(zipSource.hasNext());
            253
            254 while (zipSource.hasNext()) { 255 AtlasEntity entity = zipSource.next(); >>> CID 161395: Null pointer dereferences (NULL_RETURNS) >>> Calling a method on null object "entity". 256 Assert.assertEquals(entity.getStatus(), AtlasEntity.Status.ACTIVE); 257 Assert.assertTrue(expectedEntityTypes.contains(entity.getTypeName())); 258 }

            259
            260 verifyTypeDefs(zipSource);
            261 }

        • CID 161394: Null pointer dereferences (NULL_RETURNS)
          /repository/src/test/java/org/apache/atlas/repository/impexp/ZipSourceTest.java: 101 in org.apache.atlas.repository.impexp.ZipSourceTest.iteratorBehavor_WorksAsExpected(org.apache.atlas.repository.impexp.ZipSource)()

      ________________________________________________________________________________________________________

          • CID 161394: Null pointer dereferences (NULL_RETURNS)
            /repository/src/test/java/org/apache/atlas/repository/impexp/ZipSourceTest.java: 101 in org.apache.atlas.repository.impexp.ZipSourceTest.iteratorBehavor_WorksAsExpected(org.apache.atlas.repository.impexp.ZipSource)()
            95 public void iteratorBehavor_WorksAsExpected(ZipSource zipSource) throws IOException, AtlasBaseException
            Unknown macro: { 96 Assert.assertTrue(zipSource.hasNext()); 97 98 List<String> creationOrder = zipSource.getCreationOrder(); 99 for (int i = 0; i < creationOrder.size(); i++) { 100 AtlasEntity e = zipSource.next(); >>> CID 161394: Null pointer dereferences (NULL_RETURNS) >>> Calling a method on null object "e". 101 Assert.assertEquals(e.getGuid(), creationOrder.get(i)); 102 } 103 104 Assert.assertFalse(zipSource.hasNext()); 105 }
        • CID 161393: Null pointer dereferences (NULL_RETURNS)
          /repository/src/test/java/org/apache/atlas/repository/impexp/ExportServiceTest.java: 269 in org.apache.atlas.repository.impexp.ExportServiceTest.verifyExportForHrData(org.apache.atlas.repository.impexp.ZipSource)()

      ________________________________________________________________________________________________________

          • CID 161393: Null pointer dereferences (NULL_RETURNS)
            /repository/src/test/java/org/apache/atlas/repository/impexp/ExportServiceTest.java: 269 in org.apache.atlas.repository.impexp.ExportServiceTest.verifyExportForHrData(org.apache.atlas.repository.impexp.ZipSource)()
            263 private void verifyExportForHrData(ZipSource zipSource) throws IOException, AtlasBaseException { 264 Assert.assertNotNull(zipSource.getCreationOrder()); 265 Assert.assertTrue(zipSource.getCreationOrder().size() == 1); 266 Assert.assertTrue(zipSource.hasNext()); 267 268 AtlasEntity entity = zipSource.next(); >>> CID 161393: Null pointer dereferences (NULL_RETURNS) >>> Calling a method on null object "entity". 269 Assert.assertTrue(entity.getTypeName().equals("Department")); 270 Assert.assertEquals(entity.getStatus(), AtlasEntity.Status.ACTIVE); 271 verifyTypeDefs(zipSource); 272 }

            273
            274 private void verifyExportForHrDataForConnected(ZipSource zipSource) throws IOException, AtlasBaseException {

        • CID 161392: Null pointer dereferences (NULL_RETURNS)
          /repository/src/test/java/org/apache/atlas/repository/impexp/ExportServiceTest.java: 280 in org.apache.atlas.repository.impexp.ExportServiceTest.verifyExportForHrDataForConnected(org.apache.atlas.repository.impexp.ZipSource)()

      ________________________________________________________________________________________________________

          • CID 161392: Null pointer dereferences (NULL_RETURNS)
            /repository/src/test/java/org/apache/atlas/repository/impexp/ExportServiceTest.java: 280 in org.apache.atlas.repository.impexp.ExportServiceTest.verifyExportForHrDataForConnected(org.apache.atlas.repository.impexp.ZipSource)()
            274 private void verifyExportForHrDataForConnected(ZipSource zipSource) throws IOException, AtlasBaseException { 275 Assert.assertNotNull(zipSource.getCreationOrder()); 276 Assert.assertTrue(zipSource.getCreationOrder().size() == 2); 277 Assert.assertTrue(zipSource.hasNext()); 278 279 AtlasEntity entity = zipSource.next(); >>> CID 161392: Null pointer dereferences (NULL_RETURNS) >>> Calling a method on null object "entity". 280 Assert.assertTrue(entity.getTypeName().equals("Department")); 281 Assert.assertEquals(entity.getStatus(), AtlasEntity.Status.ACTIVE); 282 verifyTypeDefs(zipSource); 283 }

            284
            285 private void verifyTypeDefs(ZipSource zipSource) throws AtlasBaseException {

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            amestry Ashutosh Mestry
            amestry Ashutosh Mestry
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Issue deployment