IJPL-159489 devkit: replace direct DocumentBuilderFactory usage

GitOrigin-RevId: 58c48fcbccfb0489d4a31a01c82aa60d68796f40
This commit is contained in:
Vladimir Krivosheev
2026-02-10 09:21:19 +00:00
committed by intellij-monorepo-bot
parent 6e2adbeea9
commit 6bbf98278e
@@ -3,10 +3,10 @@ package com.intellij.devkit.modules.toolwindow
import com.intellij.openapi.diagnostic.logger
import com.intellij.openapi.project.Project
import com.intellij.util.createDocumentBuilder
import org.w3c.dom.Document
import org.w3c.dom.Element
import java.io.File
import javax.xml.parsers.DocumentBuilderFactory
/**
* Service for parsing XML files like module and plugin.xml and extracting information.
@@ -133,9 +133,7 @@ class XmlParserServiceImpl(private val project: Project) : XmlParserService {
private fun parseXmlFile(file: File): Document? {
try {
val factory = DocumentBuilderFactory.newInstance()
val builder = factory.newDocumentBuilder()
return builder.parse(file)
return createDocumentBuilder().parse(file)
} catch (e: Exception) {
LOG.warn("Error parsing XML file: ${file.absolutePath}", e)
return null