diff options
author | Kai Maetzel | 2004-03-01 09:40:00 +0000 |
---|---|---|
committer | Kai Maetzel | 2004-03-01 09:40:00 +0000 |
commit | 36070afd435b7739a080276a253f8fb281ff2122 (patch) | |
tree | cde697ac83683731a4de58bf9411a8bd838ca35f | |
parent | e1c3b926a808d8aa5d972acdca3942d22fd108ec (diff) | |
download | eclipse.platform.text-36070afd435b7739a080276a253f8fb281ff2122.tar.gz eclipse.platform.text-36070afd435b7739a080276a253f8fb281ff2122.tar.xz eclipse.platform.text-36070afd435b7739a080276a253f8fb281ff2122.zip |
synchronized adding/removing positions
-rw-r--r-- | org.eclipse.jface.text/src/org/eclipse/jface/text/source/AnnotationModel.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/AnnotationModel.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/AnnotationModel.java index bbfe5004ed5..614789426f1 100644 --- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/AnnotationModel.java +++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/AnnotationModel.java @@ -206,8 +206,11 @@ public class AnnotationModel implements IAnnotationModel, IAnnotationModelExtens * @throws BadLocationException if the position is not a valid document position */ protected void addPosition(IDocument document, Position position) throws BadLocationException { - if (document != null) - document.addPosition(position); + if (document != null) { + synchronized (document) { + document.addPosition(position); + } + } } /** @@ -220,8 +223,11 @@ public class AnnotationModel implements IAnnotationModel, IAnnotationModelExtens * @since 3.0 */ protected void removePosition(IDocument document, Position pos) { - if (document != null) - document.removePosition(pos); + if (document != null) { + synchronized (document) { + document.removePosition(pos); + } + } } /* |