imbajin commented on code in PR #2016:
URL: 
https://github.com/apache/incubator-hugegraph/pull/2016#discussion_r1021447927


##########
hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/AdamicAdarAPI.java:
##########
@@ -80,9 +80,10 @@ public String get(@Context GraphManager manager,
         Directions dir = Directions.convert(EdgeAPI.parseDirection(direction));
 
         HugeGraph g = graph(manager, graph);
-        PredictionTraverser traverser = new PredictionTraverser(g);
-        double score = traverser.adamicAdar(sourceId, targetId, dir,
-                                            edgeLabel, maxDegree, limit);
-        return JsonUtil.toJson(ImmutableMap.of("adamic_adar", score));
+        try (PredictionTraverser traverser = new PredictionTraverser(g)) {
+            double score = traverser.adamicAdar(sourceId, targetId, dir,
+                edgeLabel, maxDegree, limit);

Review Comment:
   use one line if it < 100 chars, it's fine
   
   and we have a code-style setting file in root for IDEA, use it to modify 
code is much more easy



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to