atlas-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mad...@apache.org
Subject [2/2] incubator-atlas git commit: ATLAS-1663: Fix defects reported by Coverity Scan
Date Fri, 24 Mar 2017 01:24:46 GMT
ATLAS-1663: Fix defects reported by Coverity Scan

Signed-off-by: Madhan Neethiraj <madhan@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/220213db
Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/220213db
Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/220213db

Branch: refs/heads/master
Commit: 220213dba5c6a9766efe33723f873143c09a8a77
Parents: ae6fd0a
Author: Sarath Subramanian <ssubramanian@hortonworks.com>
Authored: Thu Mar 16 14:32:13 2017 -0700
Committer: Madhan Neethiraj <madhan@apache.org>
Committed: Thu Mar 23 17:56:16 2017 -0700

----------------------------------------------------------------------
 .../org/apache/atlas/repository/graphdb/titan0/Titan0Graph.java  | 4 +++-
 webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java   | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/220213db/graphdb/titan0/src/main/java/org/apache/atlas/repository/graphdb/titan0/Titan0Graph.java
----------------------------------------------------------------------
diff --git a/graphdb/titan0/src/main/java/org/apache/atlas/repository/graphdb/titan0/Titan0Graph.java
b/graphdb/titan0/src/main/java/org/apache/atlas/repository/graphdb/titan0/Titan0Graph.java
index 3e44ce4..e114daa 100644
--- a/graphdb/titan0/src/main/java/org/apache/atlas/repository/graphdb/titan0/Titan0Graph.java
+++ b/graphdb/titan0/src/main/java/org/apache/atlas/repository/graphdb/titan0/Titan0Graph.java
@@ -290,7 +290,9 @@ public class Titan0Graph implements AtlasGraph<Titan0Vertex, Titan0Edge>
{
         ScriptEngine        engine  = manager.getEngineByName("gremlin-groovy");
 
         //Do not cache script compilations due to memory implications
-        engine.getContext().setAttribute("#jsr223.groovy.engine.keep.globals", "phantom",
ScriptContext.ENGINE_SCOPE);
+        if (engine != null) {
+            engine.getContext().setAttribute("#jsr223.groovy.engine.keep.globals", "phantom",
ScriptContext.ENGINE_SCOPE);
+        }
 
         return engine;
     }

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/220213db/webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java
----------------------------------------------------------------------
diff --git a/webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java b/webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java
index 671590d..362fb67 100644
--- a/webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java
+++ b/webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java
@@ -424,7 +424,7 @@ public class EntityREST {
         try {
             if (AtlasPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
                 perf = AtlasPerfTracer.getPerfTracer(PERF_LOG, "EntityREST.createOrUpdate(entityCount="
+
-                                                               (entities == null || entities.getEntities()
== null ? 0 : entities.getEntities().size()) + ")");
+                                                               (CollectionUtils.isEmpty(entities.getEntities())
? 0 : entities.getEntities().size()) + ")");
             }
 
             EntityStream entityStream = new AtlasEntityStream(entities);


Mime
View raw message