Skip to content

Commit 3b253a3

Browse files
Solves "Synchronization on a non-final field 'audioLock'"
as reported by IntelliJ: Analyze --> Inspect Code... This shouldn't change any actual behavior, since there are no write operations on audioLock. So effectivly, it was already final and non-volatile. This change explicitly forbids write operations on audioLock. Tested, of course.
1 parent fd27f0b commit 3b253a3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/goxr3plus/streamplayer/stream/StreamPlayer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public class StreamPlayer implements StreamPlayerInterface, Callable<Void> {
8181
/**
8282
* It is used for synchronization in place of audioInputStream
8383
*/
84-
private volatile Object audioLock = new Object();
84+
private final Object audioLock = new Object();
8585

8686
// -------------------VARIABLES---------------------
8787

0 commit comments

Comments
 (0)