CWE
Home > CWE List > CWE- Individual Dictionary Definition (1.1)  
Search by ID:

CWE-585: Empty Synchronized Block

Individual Definition in a New Window
Empty Synchronized Block
Status: Draft
Weakness ID: 585 (Weakness Variant)
Description
Summary

The software contains an empty synchronized block.

Potential Mitigations

Attempt to determine what the developer was trying to do, and implement the synchronization accordingly, or remove the empty synchronized block.

Demonstrative Examples

synchronized(this) { }
Other Notes

Synchronization in Java can be tricky. An empty synchronized block is often a sign that a programmer is wrestling with synchronization but has not yet achieved the result they intend.

Relationships
NatureTypeIDNameView(s) this relationship pertains toView(s)
ChildOfWeakness ClassWeakness ClassWeakness Class398Indicator of Poor Code Quality
Development Concepts (primary)699
Research Concepts (primary)1000
ChildOfCategoryCategory371State Issues
Development Concepts699
Applicable Platforms
Languages
Java
Time of Introduction
* Implementation
Content History
Modifications
Eric Dalci. Cigital. 2008-07-01. (External)
updated Potential_Mitigations, Time_of_Introduction
CWE Content Team. MITRE. 2008-09-08. (Internal)
updated Relationships, Other_Notes
Page Last Updated: November 24, 2008