Skip to content
This repository has been archived by the owner on Apr 3, 2018. It is now read-only.

Commit

Permalink
Fix possible regression
Browse files Browse the repository at this point in the history
  • Loading branch information
bruno-medeiros committed Feb 8, 2016
1 parent dbaaa4d commit 843a1a4
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -372,12 +372,15 @@ public static <R> R runUnderDocumentLock(IDocument doc, CallableX<R, RuntimeExce
if(doc instanceof ISynchronizable) {
ISynchronizable synchronizable = (ISynchronizable) doc;

synchronized(synchronizable.getLockObject()) {
return runnable.call();
Object lockObject = synchronizable.getLockObject();
if(lockObject != null) {
synchronized(lockObject) {
return runnable.call();
}
}
} else {
return runnable.call();
}

return runnable.call();
}

}

0 comments on commit 843a1a4

Please sign in to comment.