mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IJPL-159489 devkit: replace direct DocumentBuilderFactory usage
GitOrigin-RevId: 58c48fcbccfb0489d4a31a01c82aa60d68796f40
This commit is contained in:
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
|
||||
|
||||
Reference in New Issue
Block a user