You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the explicit form of synchronized, e.g. @Synchronized("myVar"), try to detect (it's not a perfect science without resolution, but the vast majority are detectable without resolution) if the field being locked on is of a lock type. If so, warn, because that is exceedingly rarely what you actually wanted, and I can imagine a lombok user thinking that Synchronized("someLockVar") would instead acquire the lock at top of method, not relinquishing it until a finally block at bottom of method.
When using the explicit form of synchronized, e.g.
@Synchronized("myVar")
, try to detect (it's not a perfect science without resolution, but the vast majority are detectable without resolution) if the field being locked on is of a lock type. If so, warn, because that is exceedingly rarely what you actually wanted, and I can imagine a lombok user thinking thatSynchronized("someLockVar")
would instead acquire the lock at top of method, not relinquishing it until a finally block at bottom of method.Example
This code should emit a warning:
synchronizing on an instance of java.util.concurrent.locks.Lock; that is extremely unlikely to be what you wanted.
See also issue #610
The text was updated successfully, but these errors were encountered: