diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/AccessAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/AccessAPI.java index 7bd593393b..ac41871a15 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/AccessAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/AccessAPI.java @@ -149,6 +149,8 @@ public void delete(@Context GraphManager manager, @PathParam("id") String id) { LOG.debug("Graph [{}] delete access: {}", graph, id); + @SuppressWarnings("unused") // just check if the graph exists + HugeGraph g = graph(manager, graph); try { manager.userManager().deleteAccess(UserAPI.parseId(id)); } catch (NotFoundException e) { diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/BelongAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/BelongAPI.java index efff34862f..8aa02ef06c 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/BelongAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/BelongAPI.java @@ -148,6 +148,8 @@ public void delete(@Context GraphManager manager, @PathParam("id") String id) { LOG.debug("Graph [{}] delete belong: {}", graph, id); + @SuppressWarnings("unused") // just check if the graph exists + HugeGraph g = graph(manager, graph); try { manager.userManager().deleteBelong(UserAPI.parseId(id)); } catch (NotFoundException e) { diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/GroupAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/GroupAPI.java index acbc494414..262ee00e10 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/GroupAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/GroupAPI.java @@ -134,6 +134,8 @@ public void delete(@Context GraphManager manager, @PathParam("id") String id) { LOG.debug("Graph [{}] delete group: {}", graph, id); + @SuppressWarnings("unused") // just check if the graph exists + HugeGraph g = graph(manager, graph); try { manager.userManager().deleteGroup(IdGenerator.of(id)); } catch (NotFoundException e) { diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/TargetAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/TargetAPI.java index 3c3385f56d..47ea5e710f 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/TargetAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/TargetAPI.java @@ -134,6 +134,9 @@ public void delete(@Context GraphManager manager, @PathParam("graph") String graph, @PathParam("id") String id) { LOG.debug("Graph [{}] delete target: {}", graph, id); + + @SuppressWarnings("unused") // just check if the graph exists + HugeGraph g = graph(manager, graph); try { manager.userManager().deleteTarget(UserAPI.parseId(id)); } catch (NotFoundException e) { diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/UserAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/UserAPI.java index a1e675eee3..5199a79fa1 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/UserAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/auth/UserAPI.java @@ -136,6 +136,8 @@ public String role(@Context GraphManager manager, @PathParam("id") String id) { LOG.debug("Graph [{}] get user role: {}", graph, id); + @SuppressWarnings("unused") // just check if the graph exists + HugeGraph g = graph(manager, graph); HugeUser user = manager.userManager().getUser(IdGenerator.of(id)); return manager.userManager().rolePermission(user).toJson(); } @@ -149,6 +151,8 @@ public void delete(@Context GraphManager manager, @PathParam("id") String id) { LOG.debug("Graph [{}] delete user: {}", graph, id); + @SuppressWarnings("unused") // just check if the graph exists + HugeGraph g = graph(manager, graph); try { manager.userManager().deleteUser(IdGenerator.of(id)); } catch (NotFoundException e) { diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/graph/BatchAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/graph/BatchAPI.java index 3343f06233..ebc54be66e 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/graph/BatchAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/graph/BatchAPI.java @@ -148,7 +148,7 @@ protected void updateExistElement(HugeGraph g, } else if (oldElement.property(key).isPresent() && newElement.properties.get(key) == null) { // If new property is null & old is present, use old property - newElement.properties.put(key, oldElement.property(key).value()); + newElement.properties.put(key, oldElement.value(key)); } } }