using getStructuredDocumentRegions() API.
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/ReconcileStepForMarkup.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/ReconcileStepForMarkup.java
index d35d24d..f2b1379 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/ReconcileStepForMarkup.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/validation/ReconcileStepForMarkup.java
@@ -432,30 +432,10 @@
* @param dirtyRegion
*/
private IStructuredDocumentRegion[] getStructuredDocumentRegions(DirtyRegion dirtyRegion) {
- List regions = new ArrayList();
-
- if(getStructuredDocument() == null)
+
+ if(getStructuredDocument() == null || dirtyRegion == null)
return new IStructuredDocumentRegion[0];
-
- IStructuredDocumentRegion sdRegion = getStructuredDocument().getRegionAtCharacterOffset(dirtyRegion.getOffset());
- if (sdRegion != null) {
-
- if (!sdRegion.isDeleted())
- regions.add(sdRegion);
-
- IDOMNode xmlNode = getXMLNode(sdRegion);
-
- while (sdRegion != null
- && !sdRegion.isDeleted()
- && xmlNode != null
- && sdRegion.getEndOffset() <= xmlNode.getEndOffset()) {
- if (!sdRegion.isDeleted())
- regions.add(sdRegion);
- sdRegion = sdRegion.getNext();
- xmlNode = getXMLNode(sdRegion);
- }
- }
- return (IStructuredDocumentRegion[]) regions.toArray(new IStructuredDocumentRegion[regions.size()]);
+ return getStructuredDocument().getStructuredDocumentRegions(dirtyRegion.getOffset(), dirtyRegion.getLength());
}
private IDOMNode getXMLNode(IStructuredDocumentRegion sdRegion) {
@@ -585,9 +565,9 @@
IReconcileResult[] results = EMPTY_RECONCILE_RESULT_SET;
- // TODO: may need to add back some synch(doc) and/or synch(region[i])
- // to be thread safe
+
IStructuredDocumentRegion[] regions = getStructuredDocumentRegions(dirtyRegion);
+
for (int i = 0; i < regions.length; i++) {
// the region may be irrelevant at this point
// if the user has deleted it