pandaapo commented on code in PR #4573:
URL: https://github.com/apache/eventmesh/pull/4573#discussion_r1403025884


##########
eventmesh-common/src/test/java/org/apache/eventmesh/common/file/WatchFileManagerTest.java:
##########
@@ -51,11 +51,13 @@ public boolean support(FileChangeContext changeContext) {
         };
         WatchFileManager.registerFileChangeListener(f.getParent(), 
fileChangeListener);
 
-        Properties properties = new Properties();
-        properties.load(new BufferedReader(new FileReader(file)));
-        properties.setProperty("eventMesh.server.newAdd", "newAdd");
-        FileWriter fw = new FileWriter(file);
-        properties.store(fw, "newAdd");
+        try (BufferedReader reader = new BufferedReader(new FileReader(file))) 
{
+            Properties properties = new Properties();
+            properties.load(reader);
+            properties.setProperty("eventMesh.server.newAdd", "newAdd");
+            FileWriter fw = new FileWriter(file);

Review Comment:
   Welcome! It would be even better if the blank lines left after modification 
were removed.



-- 
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]

Reply via email to