-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
-
Jenkins 2.181
IntelliJ IDEA 2019.1.2 (Ultimate Edition)
Build #IU-191.7141.44, built on May 7, 2019
JRE: 1.8.0_202-release-1483-b49 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.14.4
Steps:
- Open hudson.model.UpdateSite (.java) in IntelliJ
- Analyze > Inspect Code...
- File ...UpdateSite.java
- OK
Actual results
non-atomic operations on volatile field inspection
Reports any non-atomic operations on volatile fields. Non-atomic operations on volatile fields are operations where the field is read and the value is used to update the field. It is possible for the value of the field to change between the read and the write, possibly invalidating the operation. The non-atomic operation can be avoided by surrounding it with a synchronized block or by making use of one of the classes from the java.util.concurrent.atomic package.
~~~~~~~~~~~~~~~~~~~~~~~~ retryWindow = Math.max(retryWindow,SECONDS.toMillis(15)); ~~~~~~~~~~~~~~~~~~~~~~~~ lastAttempt = now; retryWindow = Math.min(retryWindow*2, HOURS.toMillis(1)); // exponential back off but at most 1 hour } ~~~~~~~~~~~~~~~~~~~~~~~~
- links to