jborgers / PMD-jPinpoint-rules

PMD rule set for responsible Java and Kotlin coding: performance, sustainability, multi-threading, data mixup and more.
Apache License 2.0
41 stars 10 forks source link

Rule Request: make rule for improper use of @Async and/or ThreadPoolTaskExecutor #303

Open stokpop opened 5 months ago

stokpop commented 5 months ago

As decribed in the async section: https://github.com/jborgers/PMD-jPinpoint-rules/blob/master/docs/JavaCodePerformance.md#improper-asynchrony

Can we make rules to check on new ThreadPoolTaskExector() without sizes being set (default constructor is effectively a single threaded pool).

We can check for @Async in Spring to use a custom pool, e.g. @Async("myPool") that is initialized properly (see above).