DanGuge commented on code in PR #2262:
URL:
https://github.com/apache/incubator-hugegraph/pull/2262#discussion_r1292234628
##########
hugegraph-api/src/main/java/org/apache/hugegraph/api/API.java:
##########
@@ -44,29 +44,25 @@
public class API {
- protected static final Logger LOG = Log.logger(API.class);
-
public static final String CHARSET = "UTF-8";
-
public static final String TEXT_PLAIN = MediaType.TEXT_PLAIN;
public static final String APPLICATION_JSON = MediaType.APPLICATION_JSON;
public static final String APPLICATION_JSON_WITH_CHARSET =
- APPLICATION_JSON + ";charset=" + CHARSET;
+ APPLICATION_JSON + ";charset=" + CHARSET;
public static final String JSON = MediaType.APPLICATION_JSON_TYPE
- .getSubtype();
-
+ .getSubtype();
Review Comment:
fixed
##########
hugegraph-api/src/main/java/org/apache/hugegraph/api/API.java:
##########
@@ -224,8 +220,7 @@ protected void addCount(String key, long value) {
if (current == null) {
measures.put(key, new MutableLong(value));
} else if (current instanceof MutableLong) {
- MutableLong currentMutableLong = (MutableLong) current;
- currentMutableLong.add(value);
+ ((MutableLong) measures.computeIfAbsent(key,
MutableLong::new)).add(value);
} else if (current instanceof Long) {
Review Comment:
fixed
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]