You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@atlas.apache.org by "Apoorv Naik (JIRA)" <ji...@apache.org> on 2017/04/19 14:46:41 UTC
[jira] [Commented] (ATLAS-1735) Coverity Scan Issues Detected on
4/13
[ https://issues.apache.org/jira/browse/ATLAS-1735?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15974809#comment-15974809 ]
Apoorv Naik commented on ATLAS-1735:
------------------------------------
Committed to master and 0.8 incubating
master = https://git1-us-west.apache.org/repos/asf/incubator-atlas/commit?p=incubator-atlas.git;a=commit;h=29524aa06de730ce80b2a42672e46d1f5492d4cd
0.8 = https://git1-us-west.apache.org/repos/asf/incubator-atlas/commit?p=incubator-atlas.git;a=commit;h=e60b2655d59fff396c4abc7b21a1cf85b453cd89
Thanks Ashutosh
> Coverity Scan Issues Detected on 4/13
> -------------------------------------
>
> Key: ATLAS-1735
> URL: https://issues.apache.org/jira/browse/ATLAS-1735
> Project: Atlas
> Issue Type: Bug
> Components: atlas-core
> Affects Versions: trunk, 0.8-incubating
> Reporter: Ashutosh Mestry
> Assignee: Ashutosh Mestry
> Priority: Minor
> Fix For: trunk, 0.8-incubating
>
> Attachments: ATLAS-1735-Coverity-Scan-fixes.patch
>
>
> 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 {
> 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 {
>
>
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)