healchow commented on code in PR #3588:
URL: https://github.com/apache/incubator-inlong/pull/3588#discussion_r846569042
##########
inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/trigger/DirectoryTrigger.java:
##########
@@ -159,9 +159,11 @@ private void registerNewDir(PathPattern entity,
LOGGER.info("overflow got {}", parentPath);
// check whether parent path is valid.
if (Files.isDirectory(parentPath)) {
- for (Iterator<Path> it =
Files.list(parentPath).iterator(); it.hasNext();) {
- Path childPath = it.next();
- registerAllSubDir(entity,
parentPath.resolve(childPath), tmpWatchers);
+ try(final Stream<Path> pathStream =
Files.list(parentPath)) {
Review Comment:
Please refer to the link
<https://github.com/apache/incubator-inlong/discussions/3082> to set your code
style, then pull the request again.
--
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]