diff --git a/plugins/performanceTesting/remote-driver/src/com/jetbrains/performancePlugin/remotedriver/xpath/XpathDataModelCreator.kt b/plugins/performanceTesting/remote-driver/src/com/jetbrains/performancePlugin/remotedriver/xpath/XpathDataModelCreator.kt index 17c08a84e93b..cb516e8fa0a8 100644 --- a/plugins/performanceTesting/remote-driver/src/com/jetbrains/performancePlugin/remotedriver/xpath/XpathDataModelCreator.kt +++ b/plugins/performanceTesting/remote-driver/src/com/jetbrains/performancePlugin/remotedriver/xpath/XpathDataModelCreator.kt @@ -2,6 +2,7 @@ package com.jetbrains.performancePlugin.remotedriver.xpath +import com.intellij.util.createDocumentBuilder import com.jetbrains.performancePlugin.remotedriver.dataextractor.TextParser import com.jetbrains.performancePlugin.remotedriver.dataextractor.TextToKeyCache import org.assertj.swing.edt.GuiActionRunner @@ -21,7 +22,6 @@ import java.time.format.DateTimeFormatter import java.util.Locale import java.util.function.Supplier import javax.swing.JComponent -import javax.xml.parsers.DocumentBuilderFactory import kotlin.math.absoluteValue class XpathDataModelCreator(val onlyVisibleComponents: Boolean = true) { @@ -293,7 +293,7 @@ class XpathDataModelCreator(val onlyVisibleComponents: Boolean = true) { fun create(rootComponent: Component?, includeRoot: Boolean = false, targetComponent: Component? = null): Document { - val doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument() + val doc = createDocumentBuilder().newDocument() GuiActionRunner.execute(object : GuiTask() { override fun executeInEDT() { @@ -339,4 +339,4 @@ fun Element.addIcon(iconName: String, size: Int, onClickFunction: String) { private fun String.removeInvalidXmlCharacters(): String { // Replace any characters not allowed in XML with an empty string return replace(Regex("[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f]"), "") -} \ No newline at end of file +}