reprogrammer/keshmesh — Issue #40: Is the use of getClass in a final class an instance of LCK02J?
Author: reprogrammer
Created: 2011-11-01 20:57:34+00:00
State: open
Labels: LCK02J

Since final classes cannot be subclassed, the use of the return value of `getClass` as a lock object inside a final class is safe. Anonymous classes are a special kind of final classes. So, the use of `getClass` inside an anonymous class is safe. If our detector reports too many false positives in these cases, we can have the detector check for these corner cases.