SYNCH.NESTED
When a synchronized method calls other synchronized methods on same object, it does not create synchronization problems but it does have a detrimental effect on performance. This error is reported for non-static methods.
Example 1
Copy
public class MyClass {
public synchronized List getElements() {
return internalGetElements();
}
synchronized List internalGetElements() {
List list = new ArrayList();
// calculate and return list of elements
return list;
}
// ...
}
SYNCH.NESTED is reported for line 14: Synchronized method calls another synchronized method 'internalGetElements' with the same lock held