cadonna commented on code in PR #13983:
URL: https://github.com/apache/kafka/pull/13983#discussion_r1269179717


##########
tools/src/main/java/org/apache/kafka/tools/StreamsResetter.java:
##########
@@ -133,77 +112,69 @@ public class StreamsResetter {
             + "*** Warning! This tool makes irreversible changes to your 
application. It is strongly recommended that "
             + "you run this once with \"--dry-run\" to preview your changes 
before making them.\n\n";
 
-    private OptionSet options = null;
     private final List<String> allTopics = new LinkedList<>();
 
-
-    public int run(final String[] args) {
-        return run(args, new Properties());
+    public static void main(final String[] args) {
+        Exit.exit(new StreamsResetter().execute(args));
     }
 
-    public int run(final String[] args,
-                   final Properties config) {
-        int exitCode;
+    public int execute(final String[] args) {
+        return execute(args, new Properties());
+    }
 
-        Admin adminClient = null;
+    public int execute(final String[] args, final Properties config) {
         try {
-            parseArguments(args);
-
-            final boolean dryRun = options.has(dryRunOption);
+            StreamsResetterOptions options = new StreamsResetterOptions(args);
 
-            final String groupId = options.valueOf(applicationIdOption);
-            final Properties properties = new Properties();
-            if (options.has(commandConfigOption)) {
-                
properties.putAll(Utils.loadProps(options.valueOf(commandConfigOption)));
+            String groupId = options.applicationId();

Review Comment:
   > streams used to have this checkstyle that all variables should be final
   
   Yeah, we still have that checkstyle rule. The checkstyle rule is not 
perfect, but it is the best you can get in java to make sure variable are 
changed inadvertently. Unfortunately, changes to a referenced object are not 
affected by final. That is the "not perfect" part.
   
   Regarding applying the rule to the tools package, I would be in favor. 
However, it should not be part of this PR.         



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to