nemo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] wonook commented on a change in pull request #192: [NEMO-335] DB for storing metrics
Date Wed, 13 Feb 2019 17:21:59 GMT
wonook commented on a change in pull request #192: [NEMO-335] DB for storing metrics
URL: https://github.com/apache/incubator-nemo/pull/192#discussion_r256501797
 
 

 ##########
 File path: runtime/master/src/main/java/org/apache/nemo/runtime/master/metric/MetricStore.java
 ##########
 @@ -232,10 +325,7 @@ public void dumpAllMetricToFile(final String filePath) {
     final T metric = getMetricWithId(metricClass, id);
     final JsonFactory jsonFactory = new JsonFactory();
     final ByteArrayOutputStream stream = new ByteArrayOutputStream();
-    final JsonGenerator jsonGenerator;
-    try {
-      jsonGenerator = jsonFactory.createGenerator(stream, JsonEncoding.UTF8);
-
+    try (final JsonGenerator jsonGenerator = jsonFactory.createGenerator(stream, JsonEncoding.UTF8))
{
 
 Review comment:
   Yup this is the refactoring bit, which SonarLint was complaining about.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message