From 3adbaf77da6c0834e38f971f8ca684862eefa929 Mon Sep 17 00:00:00 2001 From: Arindam Mondal Date: Tue, 10 Jul 2018 16:45:42 +0900 Subject: Use try-with-resources Issue-ID: DMAAP-539 Change-Id: Ic2c2eeb4ada3e05de695d108de37129a8aa39ad1 Signed-off-by: Arindam Mondal --- .../java/com/att/nsa/mr/dme/client/PreferredRouteReplyHandler.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/main') diff --git a/src/main/java/com/att/nsa/mr/dme/client/PreferredRouteReplyHandler.java b/src/main/java/com/att/nsa/mr/dme/client/PreferredRouteReplyHandler.java index 26d74ee..0878359 100644 --- a/src/main/java/com/att/nsa/mr/dme/client/PreferredRouteReplyHandler.java +++ b/src/main/java/com/att/nsa/mr/dme/client/PreferredRouteReplyHandler.java @@ -60,9 +60,7 @@ public class PreferredRouteReplyHandler implements DME2ExchangeReplyHandler { } public void routeWriter(String routeKey, String routeValue){ - try{ - - FileWriter routeWriter=new FileWriter(new File (MRSimplerBatchPublisher.routerFilePath)); + try(FileWriter routeWriter=new FileWriter(new File (MRSimplerBatchPublisher.routerFilePath))){ routeWriter.write(routeKey+"="+routeValue); routeWriter.close(); -- cgit 1.2.3-korg