From 6e2adbeea9dcae1db7d86f9c3cc1d608422245ee Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Mon, 9 Feb 2026 17:08:14 +0100 Subject: [PATCH] IJPL-159489 performanceTesting: use secure XML builder GitOrigin-RevId: 9e74dff6273fd2331724869f89536a1121bd507a --- .../remotedriver/xpath/XpathDataModelCreator.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 +}