Hi, all Recently I found a bug that could be avoided if we have a CI to detect unused variables. See https://github.com/apache/pulsar/pull/13233 <https://github.com/apache/pulsar/pull/13233>. We can see the private field `recycleHandle` was not used before this PR.
Generally, we should avoid all unused private fields except some special cases like `AtomicIntegerFieldUpdater`, while the warning should be suppressed by `@SuppressWarnings(“unused”)`. I see checkstyle plugins are still not applied for all modules, so the code quality Is not guaranteed well. BTW, I found checkstyle plugin cannot detect unused variables. Does anyone know any plugin to do this work? There is much work to enhance our code quality. Thanks, Yunze