From f0aa03ded90565db1cb3c422d52528afaedcbed4 Mon Sep 17 00:00:00 2001 From: "Olga.Klisho" Date: Tue, 16 Mar 2021 21:25:17 +0300 Subject: [PATCH] [java] SynchronizeOnNonFinalFieldInspection inspection description updated GitOrigin-RevId: 11e3fa59290fd3741239d9d27f4979538d5399ab --- .../SynchronizeOnNonFinalField.html | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/plugins/InspectionGadgets/src/inspectionDescriptions/SynchronizeOnNonFinalField.html b/plugins/InspectionGadgets/src/inspectionDescriptions/SynchronizeOnNonFinalField.html index 2ae175cb3d5a..1dd5d0e1d6b9 100644 --- a/plugins/InspectionGadgets/src/inspectionDescriptions/SynchronizeOnNonFinalField.html +++ b/plugins/InspectionGadgets/src/inspectionDescriptions/SynchronizeOnNonFinalField.html @@ -1,10 +1,16 @@ -Reports synchronized statements where the lock expression +Reports the synchronized statements where the lock expression is a reference to a non-final field. Such statements are unlikely to have useful semantics, as different threads may be locking on different objects even when operating on the same object. -

- +

Example:

+
+  private Object o;
+    public void foo() {
+        synchronized (o) // synchronization on a non-final field
+        { }
+    }
+
\ No newline at end of file