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:
[email protected]


With regards,
Apache Git Services

Reply via email to