CodeQL documentation

Inconsistent synchronization of getter and setter

ID: java/unsynchronized-getter
Kind: problem
Security severity: 
Severity: error
Precision: very-high
Tags:
   - quality
   - reliability
   - concurrency
   - language-features
   - external/cwe/cwe-413
   - external/cwe/cwe-662
Query suites:
   - java-security-and-quality.qls

Click to see the query in the CodeQL repository

If a class has a synchronized set method and a similarly-named get method is not also synchronized, calls to the get method may not return a consistent state for the object.

Recommendation

Synchronize read operations as well as write operations. You should usually synchronize the get method.

References

  • © GitHub, Inc.
  • Terms
  • Privacy
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy