Tencent / TubeMQ

TubeMQ has been donated to the Apache Software Foundation and renamed to InLong, please visit the new Apache repository: https://github.com/apache/incubator-inlong
https://inlong.apache.org/
2.02k stars 391 forks source link

Useless `main` method in subclass of Action #84

Closed aloyszhang closed 4 years ago

aloyszhang commented 4 years ago

I found some main method just sleep 100000000ms in a new thread in some subClass of Action,

public static void main(String[] args) {
        new Thread() {
            @Override
            public void run() {
                try {
                    Thread.sleep(100000000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }.start();
    }

It seems useless. and I think wo can remove these code. What do think about it ? @gosonzhang

tisonkun commented 4 years ago

Make sense to me. Also I'm curious the history why we introduce such code snippets.

gosonzhang commented 4 years ago

This should be used for unit testing a long time ago, not removed.

Can you fix it?

aloyszhang commented 4 years ago

@gosonzhang ok, I'll contribute a PR.

gosonzhang commented 4 years ago

thanks