mariofusco commented on code in PR #5675:
URL:
https://github.com/apache/incubator-kie-drools/pull/5675#discussion_r1479590210
##########
drools-util/src/main/java/org/drools/util/RemoveCommentsMain.java:
##########
@@ -10,9 +11,15 @@ public class RemoveCommentsMain {
public static void main(String... args) {
for (String fileName : args) {
try {
- Files.write(Path.of(fileName),
removeComments(fileName).getBytes());
+ final String result = removeComments(fileName);
+ if (result != null) {
+ Files.write(Path.of(fileName), result.getBytes());
+ }
} catch (IOException e) {
- throw new RuntimeException(e);
+ // Ignore non-existant files.
+ if (!(e instanceof NoSuchFileException)) {
Review Comment:
Shouldn't we at least log that the file didn't exist and therefore we
ignored it?
--
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]