79266213

Date: 2024-12-09 19:24:59
Score: 1
Natty:
Report link

https://stackoverflow.com/a/54762909/4026629 is a nice idea, but seems unnecessarily verbose, and it can be simplified for most use cases.
Adding this line in one's main application class:

new CountDownLatch(1).await();

e.g.

    public static void main(String[] args) throws InterruptedException {
        SpringApplication.run(DemoApplication.class, args);
        new CountDownLatch(1).await();
    }

seems to do the trick.

Reasons:
  • Blacklisted phrase (1): stackoverflow
  • Has code block (-0.5):
  • Starts with a question (0.5): is a
Posted by: JL_SO