[81755] intermitant JUnit Test failure on 12/22 build
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/TaglibController.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/TaglibController.java
index a546ee3..e099757 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/TaglibController.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/contentmodel/TaglibController.java
@@ -78,8 +78,10 @@
if (buffer instanceof ITextFileBuffer) {
IDocument document = ((ITextFileBuffer) buffer).getDocument();
// ignore non-JSP documents
- if (!fJSPdocuments.contains(document))
- return;
+ synchronized (fJSPdocuments) {
+ if (!fJSPdocuments.contains(document))
+ return;
+ }
Assert.isTrue(document instanceof IStructuredDocument);
DocumentInfo info = new DocumentInfo();
info.document = (IStructuredDocument) document;
@@ -103,8 +105,10 @@
public void bufferDisposed(IFileBuffer buffer) {
if (buffer instanceof ITextFileBuffer) {
IDocument document = ((ITextFileBuffer) buffer).getDocument();
- if (!fJSPdocuments.remove(document))
- return;
+ synchronized (fJSPdocuments) {
+ if (!fJSPdocuments.remove(document))
+ return;
+ }
}
synchronized (fDocumentMap) {
Object[] mapEntrys = fDocumentMap.entrySet().toArray();
@@ -238,7 +242,9 @@
* @see org.eclipse.core.filebuffers.IDocumentSetupParticipant#setup(org.eclipse.jface.text.IDocument)
*/
public void setup(IDocument document) {
- _instance.fJSPdocuments.add(document);
+ synchronized (_instance.fJSPdocuments) {
+ _instance.fJSPdocuments.add(document);
+ }
}
}