CodeQL 文档

非同步化重写同步化方法

ID: java/non-sync-override
Kind: problem
Security severity: 
Severity: warning
Precision: very-high
Tags:
   - reliability
   - correctness
   - concurrency
   - language-features
   - external/cwe/cwe-820
Query suites:
   - java-security-and-quality.qls

单击以在 CodeQL 存储库中查看查询

如果在子类中重写同步化方法,编译器不要求重写的方法同步化。但是,如果重写的方法不同步化,子类的线程安全性可能会被破坏。

建议

确保重写的方法同步化(如果需要)。

参考

  • ©GitHub, Inc.
  • 条款
  • 隐私