Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
c3318467
Commit
c3318467
authored
Dec 25, 2016
by
Madhan Neethiraj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-1415: fix potential NPE issues found by Coverity scan
parent
0e7ef3af
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
AtlasStructFormatConverter.java
...apache/atlas/web/adapters/AtlasStructFormatConverter.java
+7
-1
EntitiesREST.java
...src/main/java/org/apache/atlas/web/rest/EntitiesREST.java
+6
-2
No files found.
webapp/src/main/java/org/apache/atlas/web/adapters/AtlasStructFormatConverter.java
View file @
c3318467
...
...
@@ -125,7 +125,13 @@ public class AtlasStructFormatConverter extends AtlasAbstractFormatConverter {
ret
=
new
HashMap
<>();
for
(
AtlasStructDef
.
AtlasAttributeDef
attrDef
:
getAttributeDefs
(
structType
))
{
AtlasType
attrType
=
structType
.
getAttributeType
(
attrDef
.
getName
());
AtlasType
attrType
=
structType
.
getAttributeType
(
attrDef
.
getName
());
if
(
attrType
==
null
)
{
LOG
.
warn
(
"ignored attribute {}.{}: failed to find AtlasType"
,
structType
.
getTypeName
(),
attrDef
.
getName
());
continue
;
}
AtlasFormatConverter
attrConverter
=
converterRegistry
.
getConverter
(
attrType
.
getTypeCategory
());
Object
v2Value
=
attributes
.
get
(
attrDef
.
getName
());
...
...
webapp/src/main/java/org/apache/atlas/web/rest/EntitiesREST.java
View file @
c3318467
...
...
@@ -174,9 +174,13 @@ public class EntitiesREST {
AtlasEntity
.
AtlasEntities
atlasEntities
=
entitiesStore
.
searchEntities
(
searchFilter
);
AtlasEntityHeader
.
AtlasEntityHeaders
entityHeaders
=
new
AtlasEntityHeader
.
AtlasEntityHeaders
();
entityHeaders
.
setList
(
new
LinkedList
<
AtlasEntityHeader
>());
for
(
AtlasEntity
atlasEntity
:
atlasEntities
.
getList
())
{
entityHeaders
.
getList
().
add
(
new
AtlasEntityHeader
(
atlasEntity
.
getTypeName
(),
atlasEntity
.
getAttributes
()));
if
(
atlasEntities
!=
null
)
{
for
(
AtlasEntity
atlasEntity
:
atlasEntities
.
getList
())
{
entityHeaders
.
getList
().
add
(
new
AtlasEntityHeader
(
atlasEntity
.
getTypeName
(),
atlasEntity
.
getAttributes
()));
}
}
return
entityHeaders
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment