bytedeco/javacv

regarding usage of static volatile in JavaFxPlayVideoAndAudio sample program

Open

#943 opened on Mar 21, 2018

View on GitHub
 (5 comments) (0 reactions) (0 assignees)Java (1,583 forks)batch import
enhancementhelp wanted

Repository metrics

Stars
 (6,985 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

I am using JavaFxPlayVideoAndAudio.java sample code from my application.

I am getting the following error in sonar cube in Jenkins. playThread = new Thread(() -> { (line no 52)

Error: "Make the enclosing method "static" or remove this set."

Reason: "Correctly updating a static field from a non-static method is tricky to get right and could easily lead to bugs if there are multiple class instances and/or multiple threads in play. Ideally, static fields are only updated from synchronized static methods.This rule raises an issue each time a static field is updated from a non-static method."

Could you please guide me in resolving the issue.

Contributor guide