Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 73c37d4a authored by William Escande's avatar William Escande
Browse files

Errorprone: SynchronizeOnNonFinalField

Synchronizing on non-final fields is not safe: if the field is ever
updated, different threads may end up locking on different objects.

Test: m Bluetooth
Bug: 344658662
Flag: Exempt, enforce error in the futur
Change-Id: I7c15a137d691cf17701635e8b9392eefaae82d81
parent 0ad71d43
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -356,6 +356,7 @@ android_app {
            "-Xep:ReturnAtTheEndOfVoidFunction:ERROR",
            "-Xep:StringCaseLocaleUsage:ERROR",
            "-Xep:StringCharset:ERROR",
            "-Xep:SynchronizeOnNonFinalField:ERROR",
            "-Xep:ToStringReturnsNull:ERROR",
            "-Xep:UnnecessaryStringBuilder:ERROR",
            "-Xep:UnrecognisedJavadocTag:ERROR",
+1 −0
Original line number Diff line number Diff line
@@ -692,6 +692,7 @@ public class BluetoothOppTransfer implements BluetoothOppBatch.BluetoothOppBatch
    }

    /** Set transfer confirmed status. It should only be called for inbound transfer */
    @SuppressWarnings("SynchronizeOnNonFinalField")
    public void confirmStatusChanged() {
        /* unblock server session */
        final Thread notifyThread =