mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IJPL-159489 performanceTesting: use secure XML builder
GitOrigin-RevId: 9e74dff6273fd2331724869f89536a1121bd507a
This commit is contained in:
committed by
intellij-monorepo-bot
parent
d8932b7abf
commit
6e2adbeea9
+3
-3
@@ -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]"), "")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user