mirror of https://github.com/rusefi/RomRaider.git
Replace internal DOMParser with Document builder
This commit is contained in:
parent
8c8ef6a824
commit
7ca4e5fc8c
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* RomRaider Open-Source Tuning, Logging and Reflashing
|
* RomRaider Open-Source Tuning, Logging and Reflashing
|
||||||
* Copyright (C) 2006-2021 RomRaider.com
|
* Copyright (C) 2006-2022 RomRaider.com
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -28,6 +28,9 @@ import java.io.FileInputStream;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.util.ResourceBundle;
|
import java.util.ResourceBundle;
|
||||||
|
|
||||||
|
import javax.xml.parsers.DocumentBuilder;
|
||||||
|
import javax.xml.parsers.DocumentBuilderFactory;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.w3c.dom.Document;
|
import org.w3c.dom.Document;
|
||||||
import org.xml.sax.InputSource;
|
import org.xml.sax.InputSource;
|
||||||
|
@ -36,7 +39,6 @@ import com.romraider.Settings;
|
||||||
import com.romraider.swing.JProgressPane;
|
import com.romraider.swing.JProgressPane;
|
||||||
import com.romraider.xml.DOMSettingsBuilder;
|
import com.romraider.xml.DOMSettingsBuilder;
|
||||||
import com.romraider.xml.DOMSettingsUnmarshaller;
|
import com.romraider.xml.DOMSettingsUnmarshaller;
|
||||||
import com.sun.org.apache.xerces.internal.parsers.DOMParser;
|
|
||||||
|
|
||||||
public class SettingsManager {
|
public class SettingsManager {
|
||||||
private static final Logger LOGGER =
|
private static final Logger LOGGER =
|
||||||
|
@ -80,9 +82,9 @@ public class SettingsManager {
|
||||||
|
|
||||||
final InputSource src = new InputSource(settingsFileIn);
|
final InputSource src = new InputSource(settingsFileIn);
|
||||||
final DOMSettingsUnmarshaller domUms = new DOMSettingsUnmarshaller();
|
final DOMSettingsUnmarshaller domUms = new DOMSettingsUnmarshaller();
|
||||||
final DOMParser parser = new DOMParser();
|
final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
|
||||||
parser.parse(src);
|
final DocumentBuilder builder = dbf.newDocumentBuilder();
|
||||||
final Document doc = parser.getDocument();
|
final Document doc = builder.parse(src);
|
||||||
loadedSettings = domUms.unmarshallSettings(doc.getDocumentElement());
|
loadedSettings = domUms.unmarshallSettings(doc.getDocumentElement());
|
||||||
} catch (FileNotFoundException e) {
|
} catch (FileNotFoundException e) {
|
||||||
showMessageDialog(null,
|
showMessageDialog(null,
|
||||||
|
|
Loading…
Reference in New Issue