mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-24 09:25:31 +02:00
Refactor XML file handling
This commit is contained in:
parent
b9cfdf91d8
commit
c7169b3186
63 changed files with 414 additions and 241 deletions
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %Bundle-Name.0
|
||||
Bundle-SymbolicName: org.eclipse.cdt.autotools.core;singleton:=true
|
||||
Bundle-Version: 2.2.0.qualifier
|
||||
Bundle-Version: 2.2.100.qualifier
|
||||
Bundle-Activator: org.eclipse.cdt.autotools.core.AutotoolsPlugin
|
||||
Bundle-Localization: plugin
|
||||
Require-Bundle: org.eclipse.ui;bundle-version="3.4.0",
|
||||
|
@ -13,7 +13,7 @@ Require-Bundle: org.eclipse.ui;bundle-version="3.4.0",
|
|||
org.eclipse.core.resources;bundle-version="3.4.0",
|
||||
org.eclipse.ui.ide;bundle-version="3.4.0",
|
||||
org.eclipse.cdt.managedbuilder.core;bundle-version="5.0.100",
|
||||
org.eclipse.cdt.core;bundle-version="6.5.0",
|
||||
org.eclipse.cdt.core;bundle-version="8.3.0",
|
||||
org.eclipse.cdt.ui;bundle-version="5.1.0",
|
||||
org.eclipse.cdt.managedbuilder.ui;bundle-version="5.0.100",
|
||||
org.eclipse.cdt.managedbuilder.gnu.ui;bundle-version="5.0.100",
|
||||
|
|
|
@ -27,7 +27,6 @@ import java.util.Map.Entry;
|
|||
import java.util.Random;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
||||
import org.eclipse.cdt.autotools.core.AutotoolsNewProjectNature;
|
||||
|
@ -38,6 +37,7 @@ import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
|||
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
|
||||
import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
|
||||
import org.eclipse.cdt.internal.autotools.core.configure.AutotoolsConfiguration.Option;
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.eclipse.cdt.managedbuilder.core.BuildException;
|
||||
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
||||
import org.eclipse.cdt.managedbuilder.core.IHoldsOptions;
|
||||
|
@ -55,6 +55,7 @@ import org.eclipse.core.resources.ResourcesPlugin;
|
|||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
@ -203,8 +204,7 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
|
|||
IPath fileLocation = project.getLocation().append(CFG_FILE_NAME);
|
||||
File dirFile = fileLocation.toFile();
|
||||
Map<String, IAConfiguration> cfgList = new HashMap<>();
|
||||
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder db = dbf.newDocumentBuilder();
|
||||
DocumentBuilder db = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
if (dirFile.exists()) {
|
||||
Document d = db.parse(dirFile);
|
||||
Element e = d.getDocumentElement();
|
||||
|
@ -269,7 +269,8 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
|
|||
}
|
||||
}
|
||||
} catch (ParserConfigurationException | SAXException | IOException e) {
|
||||
e.printStackTrace();
|
||||
Platform.getLog(AutotoolsConfigurationManager.class)
|
||||
.error("Error while parsing .autotools file in project", e); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
return list;
|
||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %bundleName
|
||||
Bundle-SymbolicName: org.eclipse.cdt.autotools.tests;singleton:=true
|
||||
Bundle-Version: 2.1.0.qualifier
|
||||
Bundle-Version: 2.1.100.qualifier
|
||||
Bundle-Vendor: %provider
|
||||
Bundle-Localization: plugin
|
||||
Require-Bundle: org.eclipse.ui,
|
||||
|
@ -13,7 +13,7 @@ Require-Bundle: org.eclipse.ui,
|
|||
org.junit,
|
||||
org.eclipse.ui.ide,
|
||||
org.eclipse.jface.text,
|
||||
org.eclipse.cdt.core,
|
||||
org.eclipse.cdt.core;bundle-version="8.3.0",
|
||||
org.eclipse.cdt.autotools.ui;bundle-version="1.0.0",
|
||||
org.eclipse.cdt.core.tests
|
||||
Bundle-ActivationPolicy: lazy
|
||||
|
|
|
@ -25,7 +25,6 @@ import java.io.IOException;
|
|||
import java.util.Map;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
||||
import org.eclipse.cdt.autotools.core.AutotoolsOptionConstants;
|
||||
|
@ -33,6 +32,7 @@ import org.eclipse.cdt.autotools.core.IAutotoolsOption;
|
|||
import org.eclipse.cdt.core.model.CoreModel;
|
||||
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
||||
import org.eclipse.cdt.internal.autotools.core.configure.AutotoolsConfigurationManager;
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
||||
import org.eclipse.cdt.managedbuilder.core.ManagedCProjectNature;
|
||||
|
@ -535,8 +535,7 @@ public class UpdateConfigureTest {
|
|||
try {
|
||||
IPath fileLocation = testProject.getLocation().append(".autotools"); //$NON-NLS-1$
|
||||
File dirFile = fileLocation.toFile();
|
||||
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder db = dbf.newDocumentBuilder();
|
||||
DocumentBuilder db = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
assertTrue(dirFile.exists());
|
||||
Document d = db.parse(dirFile);
|
||||
Element e = d.getDocumentElement();
|
||||
|
|
|
@ -2,11 +2,11 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %bundleName
|
||||
Bundle-SymbolicName: org.eclipse.cdt.autotools.ui.tests
|
||||
Bundle-Version: 1.1.0.qualifier
|
||||
Bundle-Version: 1.1.100.qualifier
|
||||
Bundle-Localization: plugin
|
||||
Require-Bundle: org.eclipse.swtbot.go,
|
||||
org.eclipse.core.resources,
|
||||
org.eclipse.cdt.core
|
||||
org.eclipse.cdt.core;bundle-version="8.3.0"
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Fragment-Host: org.eclipse.cdt.autotools.ui
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-17
|
||||
|
|
|
@ -24,8 +24,8 @@ import java.util.regex.Matcher;
|
|||
import java.util.regex.Pattern;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.IWorkspace;
|
||||
import org.eclipse.core.resources.IWorkspaceRoot;
|
||||
|
@ -108,8 +108,7 @@ public class SetConfigurationParameterTest extends AbstractTest {
|
|||
File f = new File(path.toOSString());
|
||||
assertTrue(f.exists());
|
||||
|
||||
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder db = dbf.newDocumentBuilder();
|
||||
DocumentBuilder db = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
Document d = db.parse(f);
|
||||
Element e = d.getDocumentElement();
|
||||
// Get the stored configuration data
|
||||
|
@ -320,8 +319,7 @@ public class SetConfigurationParameterTest extends AbstractTest {
|
|||
path = project.getLocation().append(".autotools");
|
||||
f = new File(path.toOSString());
|
||||
assertTrue(f.exists());
|
||||
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder db = dbf.newDocumentBuilder();
|
||||
DocumentBuilder db = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
Document d = db.parse(f);
|
||||
Element e = d.getDocumentElement();
|
||||
// Get the stored configuration data
|
||||
|
|
|
@ -2,14 +2,14 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %Bundle-Name.0
|
||||
Bundle-SymbolicName: org.eclipse.cdt.autotools.ui;singleton:=true
|
||||
Bundle-Version: 2.2.100.qualifier
|
||||
Bundle-Version: 2.2.200.qualifier
|
||||
Bundle-Activator: org.eclipse.cdt.autotools.ui.AutotoolsUIPlugin
|
||||
Bundle-Localization: plugin
|
||||
Bundle-Vendor: %provider
|
||||
Require-Bundle: org.eclipse.ui,
|
||||
org.eclipse.core.runtime,
|
||||
org.eclipse.cdt.autotools.core;bundle-version="1.0.0",
|
||||
org.eclipse.cdt.core;bundle-version="5.1.0",
|
||||
org.eclipse.cdt.core;bundle-version="8.3.0",
|
||||
org.eclipse.core.resources;bundle-version="3.5.0",
|
||||
org.eclipse.cdt.managedbuilder.core;bundle-version="6.0.0",
|
||||
org.eclipse.jface.text;bundle-version="3.5.0",
|
||||
|
|
|
@ -42,6 +42,7 @@ import org.eclipse.cdt.internal.autotools.ui.CWordFinder;
|
|||
import org.eclipse.cdt.internal.autotools.ui.HTMLPrinter;
|
||||
import org.eclipse.cdt.internal.autotools.ui.HTMLTextPresenter;
|
||||
import org.eclipse.cdt.internal.autotools.ui.preferences.AutotoolsEditorPreferenceConstants;
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.eclipse.core.filesystem.URIUtil;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
|
@ -168,12 +169,14 @@ public class AutoconfTextHover implements ITextHover, ITextHoverExtension {
|
|||
docStream = new FileInputStream(p.toFile());
|
||||
}
|
||||
}
|
||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilderFactory factory = XmlProcessorFactoryCdt
|
||||
.createDocumentBuilderFactoryIgnoringDOCTYPE();
|
||||
factory.setValidating(false);
|
||||
try {
|
||||
DocumentBuilder builder = factory.newDocumentBuilder();
|
||||
doc = builder.parse(docStream);
|
||||
} catch (SAXException | ParserConfigurationException | IOException saxEx) {
|
||||
AutotoolsPlugin.log(saxEx);
|
||||
doc = null;
|
||||
} finally {
|
||||
if (docStream != null)
|
||||
|
@ -218,7 +221,8 @@ public class AutoconfTextHover implements ITextHover, ITextHoverExtension {
|
|||
docStream = new FileInputStream(p.toFile());
|
||||
}
|
||||
}
|
||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilderFactory factory = XmlProcessorFactoryCdt
|
||||
.createDocumentBuilderFactoryIgnoringDOCTYPE();
|
||||
factory.setValidating(false);
|
||||
try {
|
||||
DocumentBuilder builder = factory.newDocumentBuilder();
|
||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %pluginName
|
||||
Bundle-SymbolicName: org.eclipse.cdt.make.core; singleton:=true
|
||||
Bundle-Version: 7.6.200.qualifier
|
||||
Bundle-Version: 7.6.300.qualifier
|
||||
Bundle-Activator: org.eclipse.cdt.make.core.MakeCorePlugin
|
||||
Bundle-Vendor: %providerName
|
||||
Bundle-Localization: plugin
|
||||
|
@ -19,7 +19,7 @@ Export-Package: org.eclipse.cdt.make.core,
|
|||
org.eclipse.cdt.make.internal.core.scannerconfig.jobs;x-internal:=true,
|
||||
org.eclipse.cdt.make.internal.core.scannerconfig.util;x-internal:=true,
|
||||
org.eclipse.cdt.make.internal.core.scannerconfig2;x-internal:=true
|
||||
Require-Bundle: org.eclipse.cdt.core;bundle-version="[8.0.0,9.0.0)",
|
||||
Require-Bundle: org.eclipse.cdt.core;bundle-version="[8.3.0,9.0.0)",
|
||||
org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)",
|
||||
org.eclipse.core.variables;bundle-version="[3.1.100,4.0.0)",
|
||||
org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
|
||||
|
|
|
@ -24,12 +24,11 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.ICDescriptor;
|
||||
import org.eclipse.cdt.core.settings.model.ICStorageElement;
|
||||
import org.eclipse.cdt.core.settings.model.XmlStorageUtil;
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.eclipse.cdt.make.core.IMakeCommonBuildInfo;
|
||||
import org.eclipse.cdt.make.core.IMakeTarget;
|
||||
import org.eclipse.cdt.make.core.MakeCorePlugin;
|
||||
|
@ -237,7 +236,7 @@ public class ProjectTargets {
|
|||
*/
|
||||
protected ICStorageElement translateInputStreamToDocument(InputStream input) {
|
||||
try {
|
||||
Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(input);
|
||||
Document document = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE().parse(input);
|
||||
return XmlStorageUtil.createCStorageTree(document);
|
||||
} catch (Exception e) {
|
||||
MakeCorePlugin.log(e);
|
||||
|
|
|
@ -25,15 +25,14 @@ import java.util.HashMap;
|
|||
import java.util.Map;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.transform.OutputKeys;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.eclipse.cdt.make.core.MakeCorePlugin;
|
||||
import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredScannerInfoSerializable;
|
||||
import org.eclipse.cdt.make.core.scannerconfig.InfoContext;
|
||||
|
@ -159,7 +158,7 @@ public final class DiscoveredScannerInfoStore {
|
|||
Document document = ref != null ? ref.get() : null;
|
||||
if (document == null) {
|
||||
try {
|
||||
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
DocumentBuilder builder = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
IPath path = getDiscoveredScannerConfigStore(project);
|
||||
if (path.toFile().exists()) {
|
||||
// read form file
|
||||
|
@ -292,7 +291,8 @@ public final class DiscoveredScannerInfoStore {
|
|||
|
||||
// Transform the document to something we can save in a file
|
||||
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||
Transformer transformer = TransformerFactory.newInstance().newTransformer();
|
||||
Transformer transformer = XmlProcessorFactoryCdt.createTransformerFactoryWithErrorOnDOCTYPE()
|
||||
.newTransformer();
|
||||
transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
|
||||
transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); //$NON-NLS-1$
|
||||
transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
|
||||
|
|
|
@ -33,7 +33,7 @@ Export-Package: org.eclipse.cdt.build.core.scannerconfig,
|
|||
org.eclipse.cdt.managedbuilder.templateengine,
|
||||
org.eclipse.cdt.managedbuilder.templateengine.processes,
|
||||
org.eclipse.cdt.newmake.core
|
||||
Require-Bundle: org.eclipse.cdt.core;bundle-version="[8.0.0,9.0.0)",
|
||||
Require-Bundle: org.eclipse.cdt.core;bundle-version="[8.3.0,9.0.0)",
|
||||
org.eclipse.core.resources;bundle-version="[3.14.0,4.0.0)",
|
||||
org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
|
||||
org.eclipse.ui;bundle-version="[3.2.0,4.0.0)",
|
||||
|
|
|
@ -38,14 +38,12 @@ import java.util.SortedMap;
|
|||
import java.util.TreeMap;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.FactoryConfigurationError;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.transform.OutputKeys;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerConfigurationException;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.TransformerFactoryConfigurationError;
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
|
@ -67,6 +65,7 @@ import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager;
|
|||
import org.eclipse.cdt.core.settings.model.ICSettingEntry;
|
||||
import org.eclipse.cdt.core.settings.model.XmlStorageUtil;
|
||||
import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.eclipse.cdt.managedbuilder.buildproperties.IBuildProperty;
|
||||
import org.eclipse.cdt.managedbuilder.buildproperties.IBuildPropertyManager;
|
||||
import org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableProvider;
|
||||
|
@ -1089,7 +1088,7 @@ public class ManagedBuildManager extends AbstractCExtension {
|
|||
// Create document
|
||||
Exception err = null;
|
||||
try {
|
||||
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
DocumentBuilder builder = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
Document doc = builder.newDocument();
|
||||
|
||||
// Get the build information for the project
|
||||
|
@ -1111,7 +1110,8 @@ public class ManagedBuildManager extends AbstractCExtension {
|
|||
|
||||
// Transform the document to something we can save in a file
|
||||
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||
Transformer transformer = TransformerFactory.newInstance().newTransformer();
|
||||
Transformer transformer = XmlProcessorFactoryCdt.createTransformerFactoryWithErrorOnDOCTYPE()
|
||||
.newTransformer();
|
||||
transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
|
||||
transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); //$NON-NLS-1$
|
||||
transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
|
||||
|
@ -1261,7 +1261,7 @@ public class ManagedBuildManager extends AbstractCExtension {
|
|||
// Create document
|
||||
Exception err = null;
|
||||
try {
|
||||
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
DocumentBuilder builder = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
Document doc = builder.newDocument();
|
||||
|
||||
// Get the build information for the project
|
||||
|
@ -1284,7 +1284,7 @@ public class ManagedBuildManager extends AbstractCExtension {
|
|||
|
||||
// Transform the document to something we can save in a file
|
||||
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||
Transformer transformer = TransformerFactory.newInstance().newTransformer();
|
||||
Transformer transformer = XmlProcessorFactoryCdt.createTransformerFactoryWithErrorOnDOCTYPE().newTransformer();
|
||||
transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
|
||||
transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); //$NON-NLS-1$
|
||||
transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
|
||||
|
@ -1836,7 +1836,7 @@ public class ManagedBuildManager extends AbstractCExtension {
|
|||
|
||||
// So there is a project file, load the information there
|
||||
try (InputStream stream = new FileInputStream(cdtbuild)) {
|
||||
DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
DocumentBuilder parser = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
Document document = parser.parse(stream);
|
||||
String fileVersion = null;
|
||||
|
||||
|
@ -2516,7 +2516,7 @@ public class ManagedBuildManager extends AbstractCExtension {
|
|||
// if (file.exists()) {
|
||||
// try {
|
||||
// InputStream stream = file.getContents();
|
||||
// DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
// DocumentBuilder parser = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
// Document document = parser.parse(stream);
|
||||
// NodeList nodes = document.getElementsByTagName(ROOT_NODE_NAME);
|
||||
// return (nodes.getLength() > 0);
|
||||
|
|
|
@ -23,8 +23,8 @@ import java.util.NoSuchElementException;
|
|||
import java.util.Vector;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.eclipse.cdt.managedbuilder.core.BuildException;
|
||||
import org.eclipse.cdt.managedbuilder.core.IBuildObject;
|
||||
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
||||
|
@ -709,7 +709,7 @@ class UpdateManagedProject12 {
|
|||
try {
|
||||
// Load the old build file
|
||||
InputStream stream = new FileInputStream(settingsFile);
|
||||
DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
DocumentBuilder parser = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
Document document = parser.parse(stream);
|
||||
|
||||
// Clone the target based on the proper target definition
|
||||
|
|
|
@ -19,8 +19,8 @@ import java.io.InputStream;
|
|||
import java.util.Vector;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.eclipse.cdt.managedbuilder.core.BuildException;
|
||||
import org.eclipse.cdt.managedbuilder.core.IBuilder;
|
||||
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
||||
|
@ -78,7 +78,7 @@ class UpdateManagedProject20 {
|
|||
try {
|
||||
// Load the old build file
|
||||
InputStream stream = new FileInputStream(settingsFile);
|
||||
DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
DocumentBuilder parser = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
Document document = parser.parse(stream);
|
||||
|
||||
// Clone the target based on the proper target definition
|
||||
|
|
|
@ -19,14 +19,13 @@ import java.lang.reflect.Method;
|
|||
import java.lang.reflect.Modifier;
|
||||
import java.util.HashMap;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
|
@ -53,7 +52,8 @@ public class XMLDumper {
|
|||
Document document = dumper.getDocument();
|
||||
StringWriter writer = new StringWriter();
|
||||
|
||||
Transformer transformer = TransformerFactory.newInstance().newTransformer();
|
||||
Transformer transformer = XmlProcessorFactoryCdt.createTransformerFactoryWithErrorOnDOCTYPE()
|
||||
.newTransformer();
|
||||
transformer.transform(new DOMSource(document), new StreamResult(writer));
|
||||
|
||||
System.out.println("STRXML = " + writer.toString()); //Spit out DOM as a String //$NON-NLS-1$
|
||||
|
@ -74,7 +74,7 @@ public class XMLDumper {
|
|||
}
|
||||
|
||||
public XMLDumper(Object obj) throws ParserConfigurationException {
|
||||
document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
|
||||
document = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE().newDocument();
|
||||
document.appendChild(createObject(obj));
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,16 @@ Export-Package: org.eclipse.cdt.core,
|
|||
org.eclipse.cdt.make.ui,
|
||||
org.eclipse.cdt.managedbuilder.core,
|
||||
org.eclipse.cdt.managedbuilder.ui,
|
||||
org.eclipse.cdt.ui",
|
||||
org.eclipse.cdt.ui,
|
||||
org.eclipse.cdt.autotools.core,
|
||||
org.eclipse.cdt.autotools.tests,
|
||||
org.eclipse.cdt.autotools.ui,
|
||||
org.eclipse.cdt.autotools.ui.tests,
|
||||
org.eclipse.cdt.core.tests,
|
||||
org.eclipse.cdt.debug.ui,
|
||||
org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui,
|
||||
org.eclipse.cdt.testsrunner.boost,
|
||||
org.eclipse.cdt.testsrunner.qttest",
|
||||
org.eclipse.cdt.internal.core.browser;x-friends:="org.eclipse.cdt.ui",
|
||||
org.eclipse.cdt.internal.core.cdtvariables;x-internal:=true,
|
||||
org.eclipse.cdt.internal.core.dom;x-internal:=true,
|
||||
|
|
|
@ -23,12 +23,10 @@ import java.util.Map;
|
|||
import java.util.Map.Entry;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerConfigurationException;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.TransformerFactoryConfigurationError;
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
|
@ -41,6 +39,7 @@ import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
|||
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
|
||||
import org.eclipse.cdt.core.settings.model.ICStorageElement;
|
||||
import org.eclipse.cdt.internal.core.Util;
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.preferences.DefaultScope;
|
||||
|
@ -194,7 +193,7 @@ public class LanguageMappingStore {
|
|||
public void storeMappings(WorkspaceLanguageConfiguration config) throws CoreException {
|
||||
try {
|
||||
// Encode mappings as XML and serialize as a String.
|
||||
Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
|
||||
Document doc = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE().newDocument();
|
||||
Element rootElement = doc.createElement(WORKSPACE_MAPPINGS);
|
||||
doc.appendChild(rootElement);
|
||||
addContentTypeMappings(config.getWorkspaceMappings(), rootElement);
|
||||
|
@ -233,7 +232,7 @@ public class LanguageMappingStore {
|
|||
// The mappings are encoded as XML in a String so we need to parse it.
|
||||
InputSource input = new InputSource(new StringReader(encodedMappings));
|
||||
try {
|
||||
Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(input);
|
||||
Document document = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE().parse(input);
|
||||
config.setWorkspaceMappings(decodeContentTypeMappings(document.getDocumentElement()));
|
||||
return config;
|
||||
} catch (SAXException e) {
|
||||
|
@ -247,7 +246,7 @@ public class LanguageMappingStore {
|
|||
|
||||
private Transformer createSerializer() throws CoreException {
|
||||
try {
|
||||
return TransformerFactory.newInstance().newTransformer();
|
||||
return XmlProcessorFactoryCdt.createTransformerFactoryWithErrorOnDOCTYPE().newTransformer();
|
||||
} catch (TransformerConfigurationException e) {
|
||||
throw new CoreException(Util.createStatus(e));
|
||||
} catch (TransformerFactoryConfigurationError e) {
|
||||
|
|
|
@ -45,14 +45,12 @@ import java.util.Set;
|
|||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.FactoryConfigurationError;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.transform.OutputKeys;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerConfigurationException;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
|
||||
|
@ -98,6 +96,7 @@ import org.eclipse.cdt.core.settings.model.util.ListComparator;
|
|||
import org.eclipse.cdt.core.settings.model.util.PathSettingsContainer;
|
||||
import org.eclipse.cdt.core.settings.model.util.PatternNameMap;
|
||||
import org.eclipse.cdt.internal.core.CConfigBasedDescriptorManager;
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.eclipse.cdt.internal.core.model.CElementDelta;
|
||||
import org.eclipse.cdt.internal.core.settings.model.CExternalSettinsDeltaCalculator.ExtSettingsDelta;
|
||||
import org.eclipse.cdt.internal.core.settings.model.xml.InternalXmlStorageElement;
|
||||
|
@ -918,7 +917,8 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager {
|
|||
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||
FileOutputStream fileStream = null;
|
||||
try {
|
||||
Transformer transformer = TransformerFactory.newInstance().newTransformer();
|
||||
Transformer transformer = XmlProcessorFactoryCdt.createTransformerFactoryWithErrorOnDOCTYPE()
|
||||
.newTransformer();
|
||||
transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
|
||||
transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); //$NON-NLS-1$
|
||||
transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
|
||||
|
@ -1234,7 +1234,7 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager {
|
|||
public ICStorageElement createPreferenceStorage(String key, boolean createEmptyIfNotFound, boolean readOnly)
|
||||
throws CoreException {
|
||||
try {
|
||||
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
DocumentBuilder builder = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
Document doc = null;
|
||||
Element element = null;
|
||||
InputStream stream = null;
|
||||
|
|
|
@ -27,13 +27,11 @@ import java.util.Map;
|
|||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.transform.OutputKeys;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerConfigurationException;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.TransformerFactoryConfigurationError;
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
|
@ -41,6 +39,7 @@ import javax.xml.transform.stream.StreamResult;
|
|||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
|
||||
import org.eclipse.cdt.internal.core.CConfigBasedDescriptorManager;
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.eclipse.cdt.internal.core.XmlUtil;
|
||||
import org.eclipse.cdt.internal.core.settings.model.ICProjectDescriptionStorageType.CProjectDescriptionStorageTypeProxy;
|
||||
import org.eclipse.cdt.internal.core.settings.model.xml.XmlProjectDescriptionStorage;
|
||||
|
@ -67,6 +66,7 @@ import org.w3c.dom.Element;
|
|||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
import org.w3c.dom.ProcessingInstruction;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
/**
|
||||
* Class that marshals creation of AbstractCProjectDescriptionStorages
|
||||
|
@ -163,7 +163,7 @@ public class CProjectDescriptionStorageManager {
|
|||
throws CoreException {
|
||||
Document doc;
|
||||
try {
|
||||
doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
|
||||
doc = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE().newDocument();
|
||||
// Set the version
|
||||
ProcessingInstruction instruction = doc.createProcessingInstruction(
|
||||
ICProjectDescriptionStorageType.STORAGE_VERSION_NAME, type.version.toString());
|
||||
|
@ -175,7 +175,8 @@ public class CProjectDescriptionStorageManager {
|
|||
XmlUtil.prettyFormat(doc);
|
||||
|
||||
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||
Transformer transformer = TransformerFactory.newInstance().newTransformer();
|
||||
Transformer transformer = XmlProcessorFactoryCdt.createTransformerFactoryWithErrorOnDOCTYPE()
|
||||
.newTransformer();
|
||||
transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
|
||||
transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); //$NON-NLS-1$
|
||||
// Indentation is done with XmlUtil.prettyFormat(doc)
|
||||
|
@ -222,7 +223,7 @@ public class CProjectDescriptionStorageManager {
|
|||
|
||||
InputStream stream = null;
|
||||
try {
|
||||
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
DocumentBuilder builder = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
stream = getInputStreamForIFile(project, ICProjectDescriptionStorageType.STORAGE_FILE_NAME);
|
||||
if (stream != null) {
|
||||
Document doc = builder.parse(stream);
|
||||
|
@ -352,7 +353,7 @@ public class CProjectDescriptionStorageManager {
|
|||
CProjectDescriptionStorageTypeProxy type = initStorageType(configEl);
|
||||
if (type != null) {
|
||||
if (!m.containsKey(type.id))
|
||||
m.put(type.id, new LinkedList<CProjectDescriptionStorageTypeProxy>());
|
||||
m.put(type.id, new LinkedList<>());
|
||||
m.get(type.id).add(type);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,14 +26,12 @@ import java.lang.ref.SoftReference;
|
|||
import java.net.URI;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.FactoryConfigurationError;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.transform.OutputKeys;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerConfigurationException;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
|
||||
|
@ -44,6 +42,7 @@ import org.eclipse.cdt.core.settings.model.ICSettingsStorage;
|
|||
import org.eclipse.cdt.core.settings.model.ICStorageElement;
|
||||
import org.eclipse.cdt.core.settings.model.extension.ICProjectConverter;
|
||||
import org.eclipse.cdt.core.settings.model.util.CDataUtil;
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.eclipse.cdt.internal.core.XmlUtil;
|
||||
import org.eclipse.cdt.internal.core.envvar.ContributedEnvironment;
|
||||
import org.eclipse.cdt.internal.core.language.settings.providers.LanguageSettingsProvidersSerializer;
|
||||
|
@ -543,7 +542,8 @@ public class XmlProjectDescriptionStorage extends AbstractCProjectDescriptionSto
|
|||
|
||||
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||
try {
|
||||
Transformer transformer = TransformerFactory.newInstance().newTransformer();
|
||||
Transformer transformer = XmlProcessorFactoryCdt.createTransformerFactoryWithErrorOnDOCTYPE()
|
||||
.newTransformer();
|
||||
transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
|
||||
transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); //$NON-NLS-1$
|
||||
// Indentation is done with XmlUtil.prettyFormat(doc)
|
||||
|
@ -632,7 +632,7 @@ public class XmlProjectDescriptionStorage extends AbstractCProjectDescriptionSto
|
|||
private ICStorageElement readOldCDTProjectFile(IProject project) throws CoreException {
|
||||
ICStorageElement storage = null;
|
||||
try {
|
||||
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
DocumentBuilder builder = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
Document doc = null;
|
||||
InputStream stream = getSharedProperty(project, OLD_CDTPROJECT_FILE_NAME);
|
||||
if (stream != null) {
|
||||
|
@ -669,7 +669,7 @@ public class XmlProjectDescriptionStorage extends AbstractCProjectDescriptionSto
|
|||
protected InternalXmlStorageElement createStorage(IContainer container, String fileName, boolean reCreate,
|
||||
boolean createEmptyIfNotFound, boolean readOnly) throws CoreException {
|
||||
try {
|
||||
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
DocumentBuilder builder = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
Document doc = null;
|
||||
Element element = null;
|
||||
InputStream stream = null;
|
||||
|
@ -851,7 +851,7 @@ public class XmlProjectDescriptionStorage extends AbstractCProjectDescriptionSto
|
|||
*/
|
||||
public Element createXmlElementCopy(InternalXmlStorageElement el) throws CoreException {
|
||||
try {
|
||||
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
DocumentBuilder builder = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
Document doc = builder.newDocument();
|
||||
Element newXmlEl = null;
|
||||
synchronized (doc) {
|
||||
|
|
|
@ -22,17 +22,16 @@ import java.util.List;
|
|||
import java.util.Set;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.FactoryConfigurationError;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.transform.OutputKeys;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
|
||||
import org.eclipse.cdt.core.settings.model.ICSettingsStorage;
|
||||
import org.eclipse.cdt.core.settings.model.ICStorageElement;
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.eclipse.cdt.internal.core.settings.model.ExceptionFactory;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.w3c.dom.Document;
|
||||
|
@ -462,7 +461,7 @@ public class XmlStorageElement implements ICStorageElement {
|
|||
try {
|
||||
synchronized (fLock) {
|
||||
Element newXmlEl = null;
|
||||
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
DocumentBuilder builder = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
Document doc = builder.newDocument();
|
||||
synchronized (doc) {
|
||||
if (fElement.getParentNode().getNodeType() == Node.DOCUMENT_NODE) {
|
||||
|
@ -513,7 +512,8 @@ public class XmlStorageElement implements ICStorageElement {
|
|||
synchronized (fLock) {
|
||||
try {
|
||||
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||
Transformer transformer = TransformerFactory.newInstance().newTransformer();
|
||||
Transformer transformer = XmlProcessorFactoryCdt.createTransformerFactoryWithErrorOnDOCTYPE()
|
||||
.newTransformer();
|
||||
// Indentation is done with XmlUtil.prettyFormat(doc).
|
||||
// For debugging, the prettyFormat may not have been run yet,
|
||||
// so turning this to "yes" may be helpful on occasion.
|
||||
|
|
|
@ -25,13 +25,11 @@ import java.util.Objects;
|
|||
import java.util.Set;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.transform.OutputKeys;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerConfigurationException;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
|
||||
|
@ -39,6 +37,7 @@ import org.eclipse.cdt.core.CCorePlugin;
|
|||
import org.eclipse.cdt.core.cdtvariables.CdtVariableException;
|
||||
import org.eclipse.cdt.core.cdtvariables.ICdtVariable;
|
||||
import org.eclipse.cdt.core.settings.model.ICStorageElement;
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.eclipse.cdt.internal.core.settings.model.CConfigurationSpecSettings;
|
||||
import org.eclipse.cdt.internal.core.settings.model.ExceptionFactory;
|
||||
import org.eclipse.cdt.internal.core.settings.model.IInternalCCfgInfo;
|
||||
|
@ -94,7 +93,7 @@ public class UserDefinedVariableSupplier extends CoreMacroSupplierBase {
|
|||
}
|
||||
|
||||
private UserDefinedVariableSupplier() {
|
||||
fListeners = Collections.synchronizedSet(new HashSet<ICdtVariableChangeListener>());
|
||||
fListeners = Collections.synchronizedSet(new HashSet<>());
|
||||
}
|
||||
|
||||
public static UserDefinedVariableSupplier getInstance() {
|
||||
|
@ -532,7 +531,7 @@ public class UserDefinedVariableSupplier extends CoreMacroSupplierBase {
|
|||
|
||||
private StorableCdtVariables loadMacrosFromStream(InputStream stream, boolean readOnly) {
|
||||
try {
|
||||
DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
DocumentBuilder parser = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
InputSource inputSource = new InputSource(stream);
|
||||
Document document = parser.parse(inputSource);
|
||||
Element rootElement = document.getDocumentElement();
|
||||
|
@ -554,8 +553,7 @@ public class UserDefinedVariableSupplier extends CoreMacroSupplierBase {
|
|||
|
||||
private ByteArrayOutputStream storeMacrosToStream(StorableCdtVariables macros) throws CoreException {
|
||||
try {
|
||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder builder = factory.newDocumentBuilder();
|
||||
DocumentBuilder builder = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
Document document = builder.newDocument();
|
||||
|
||||
Element rootElement = document.createElement(StorableCdtVariables.MACROS_ELEMENT_NAME);
|
||||
|
@ -563,7 +561,8 @@ public class UserDefinedVariableSupplier extends CoreMacroSupplierBase {
|
|||
ICStorageElement storageElement = new XmlStorageElement(rootElement);
|
||||
macros.serialize(storageElement);
|
||||
|
||||
Transformer transformer = TransformerFactory.newInstance().newTransformer();
|
||||
Transformer transformer = XmlProcessorFactoryCdt.createTransformerFactoryWithErrorOnDOCTYPE()
|
||||
.newTransformer();
|
||||
transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
|
||||
transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); //$NON-NLS-1$
|
||||
transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
|
||||
|
|
|
@ -20,7 +20,6 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.transform.Result;
|
||||
import javax.xml.transform.TransformerConfigurationException;
|
||||
|
@ -29,6 +28,7 @@ import javax.xml.transform.TransformerFactory;
|
|||
import javax.xml.transform.dom.DOMSource;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.Node;
|
||||
|
@ -126,7 +126,7 @@ public class SharedDefaults extends HashMap<String, String> {
|
|||
if (length == 0) {
|
||||
parsedXML = createDefaultXMLFormat(parsedXML);
|
||||
}
|
||||
document = DocumentBuilderFactory.newInstance().newDocumentBuilder()
|
||||
document = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE()
|
||||
.parse(parsedXML.toURI().toURL().openStream());
|
||||
} catch (Exception exp) {
|
||||
TemplateEngineUtil.log(exp);
|
||||
|
@ -198,7 +198,7 @@ public class SharedDefaults extends HashMap<String, String> {
|
|||
*/
|
||||
public void updateToBackEndStorage(String updateName, String updateValue) {
|
||||
try {
|
||||
document = DocumentBuilderFactory.newInstance().newDocumentBuilder()
|
||||
document = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE()
|
||||
.parse(parsedXML.toURI().toURL().openStream());
|
||||
} catch (Exception exp) {
|
||||
TemplateEngineUtil.log(exp);
|
||||
|
@ -227,7 +227,7 @@ public class SharedDefaults extends HashMap<String, String> {
|
|||
*/
|
||||
public void deleteBackEndStorage(String[] deleteName) {
|
||||
try {
|
||||
document = DocumentBuilderFactory.newInstance().newDocumentBuilder()
|
||||
document = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE()
|
||||
.parse(parsedXML.toURI().toURL().openStream());
|
||||
} catch (Exception exp) {
|
||||
TemplateEngineUtil.log(exp);
|
||||
|
@ -261,7 +261,7 @@ public class SharedDefaults extends HashMap<String, String> {
|
|||
private File createDefaultXMLFormat(File xmlFile) {
|
||||
Document d;
|
||||
try {
|
||||
d = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
|
||||
d = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE().newDocument();
|
||||
} catch (ParserConfigurationException e) {
|
||||
TemplateEngineUtil.log(e);
|
||||
return xmlFile;
|
||||
|
@ -272,7 +272,7 @@ public class SharedDefaults extends HashMap<String, String> {
|
|||
element.setAttribute(TemplateEngineHelper.VALUE, ""); //$NON-NLS-1$
|
||||
|
||||
DOMSource domSource = new DOMSource(d);
|
||||
TransformerFactory transFactory = TransformerFactory.newInstance();
|
||||
TransformerFactory transFactory = XmlProcessorFactoryCdt.createTransformerFactoryWithErrorOnDOCTYPE();
|
||||
|
||||
try {
|
||||
FileOutputStream fos = null;
|
||||
|
@ -303,7 +303,7 @@ public class SharedDefaults extends HashMap<String, String> {
|
|||
private void generateSharedXML(File xmlFile) {
|
||||
Document d;
|
||||
try {
|
||||
d = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
|
||||
d = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE().newDocument();
|
||||
} catch (ParserConfigurationException e) {
|
||||
TemplateEngineUtil.log(e);
|
||||
return;
|
||||
|
@ -317,7 +317,7 @@ public class SharedDefaults extends HashMap<String, String> {
|
|||
}
|
||||
|
||||
DOMSource domSource = new DOMSource(d);
|
||||
TransformerFactory transFactory = TransformerFactory.newInstance();
|
||||
TransformerFactory transFactory = XmlProcessorFactoryCdt.createTransformerFactoryWithErrorOnDOCTYPE();
|
||||
Result fileResult = new StreamResult(xmlFile);
|
||||
try {
|
||||
transFactory.newTransformer().transform(domSource, fileResult);
|
||||
|
|
|
@ -20,9 +20,9 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.eclipse.osgi.util.NLS;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
@ -54,7 +54,8 @@ public class TemplateDescriptor {
|
|||
public TemplateDescriptor(URL descriptorURL, String pluginId) throws TemplateInitializationException {
|
||||
String msg = NLS.bind(Messages.TemplateCore_init_failed, descriptorURL.toString());
|
||||
try {
|
||||
this.document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(descriptorURL.openStream());
|
||||
this.document = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE()
|
||||
.parse(descriptorURL.openStream());
|
||||
} catch (ParserConfigurationException pce) {
|
||||
throw new TemplateInitializationException(msg, pce);
|
||||
} catch (IOException ioe) {
|
||||
|
|
|
@ -0,0 +1,189 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2023 Joerg Kubitz and others.
|
||||
*
|
||||
* This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License 2.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0/
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.core;
|
||||
|
||||
import javax.xml.XMLConstants;
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.parsers.SAXParser;
|
||||
import javax.xml.parsers.SAXParserFactory;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.SAXNotRecognizedException;
|
||||
import org.xml.sax.SAXNotSupportedException;
|
||||
|
||||
/**
|
||||
* XML processing which prohibits external entities.
|
||||
*
|
||||
* Copied from https://github.com/eclipse-jdt/eclipse.jdt.debug/blob/1d59af8a6a37f9cf8143d73d94e4c1c3555363d6/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/XmlProcessorFactoryJdtDebug.java
|
||||
*
|
||||
* @see <a href="https://rules.sonarsource.com/java/RSPEC-2755/">RSPEC-2755</a>
|
||||
*/
|
||||
public class XmlProcessorFactoryCdt {
|
||||
private XmlProcessorFactoryCdt() {
|
||||
// static Utility only
|
||||
}
|
||||
|
||||
private static final DocumentBuilderFactory DOCUMENT_BUILDER_FACTORY_ERROR_ON_DOCTYPE = createDocumentBuilderFactoryWithErrorOnDOCTYPE();
|
||||
private static final DocumentBuilderFactory DOCUMENT_BUILDER_FACTORY_IGNORING_DOCTYPE = createDocumentBuilderFactoryIgnoringDOCTYPE();
|
||||
private static final SAXParserFactory SAX_FACTORY_ERROR_ON_DOCTYPE = createSAXFactoryWithErrorOnDOCTYPE(false);
|
||||
private static final SAXParserFactory SAX_FACTORY_ERROR_ON_DOCTYPE_NS = createSAXFactoryWithErrorOnDOCTYPE(true);
|
||||
private static final SAXParserFactory SAX_FACTORY_IGNORING_DOCTYPE = createSAXFactoryIgnoringDOCTYPE();
|
||||
|
||||
/**
|
||||
* Creates TransformerFactory which throws TransformerException when detecting external entities.
|
||||
*
|
||||
* @return javax.xml.transform.TransformerFactory
|
||||
*/
|
||||
public static TransformerFactory createTransformerFactoryWithErrorOnDOCTYPE() {
|
||||
TransformerFactory factory = TransformerFactory.newInstance();
|
||||
// prohibit the use of all protocols by external entities:
|
||||
factory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, ""); //$NON-NLS-1$
|
||||
factory.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, ""); //$NON-NLS-1$
|
||||
return factory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates DocumentBuilderFactory which throws SAXParseException when detecting external entities. It's magnitudes faster to call
|
||||
* {@link #createDocumentBuilderWithErrorOnDOCTYPE()}.
|
||||
*
|
||||
* @return javax.xml.parsers.DocumentBuilderFactory
|
||||
*/
|
||||
public static synchronized DocumentBuilderFactory createDocumentBuilderFactoryWithErrorOnDOCTYPE() {
|
||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
// completely disable DOCTYPE declaration:
|
||||
try {
|
||||
factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); //$NON-NLS-1$
|
||||
} catch (ParserConfigurationException e) {
|
||||
throw new RuntimeException(e.getMessage(), e);
|
||||
}
|
||||
return factory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates DocumentBuilderFactory which ignores external entities. It's magnitudes faster to call {@link #createDocumentBuilderIgnoringDOCTYPE()}.
|
||||
*
|
||||
* @return javax.xml.parsers.DocumentBuilderFactory
|
||||
*/
|
||||
public static synchronized DocumentBuilderFactory createDocumentBuilderFactoryIgnoringDOCTYPE() {
|
||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
try {
|
||||
// completely disable external entities declarations:
|
||||
factory.setFeature("http://xml.org/sax/features/external-general-entities", false); //$NON-NLS-1$
|
||||
factory.setFeature("http://xml.org/sax/features/external-parameter-entities", false); //$NON-NLS-1$
|
||||
} catch (ParserConfigurationException e) {
|
||||
throw new RuntimeException(e.getMessage(), e);
|
||||
}
|
||||
return factory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates DocumentBuilder which throws SAXParseException when detecting external entities. The builder is not thread safe.
|
||||
*
|
||||
* @return javax.xml.parsers.DocumentBuilder
|
||||
* @throws ParserConfigurationException
|
||||
*/
|
||||
public static DocumentBuilder createDocumentBuilderWithErrorOnDOCTYPE() throws ParserConfigurationException {
|
||||
return DOCUMENT_BUILDER_FACTORY_ERROR_ON_DOCTYPE.newDocumentBuilder();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates DocumentBuilder which ignores external entities. The builder is not thread safe.
|
||||
*
|
||||
* @return javax.xml.parsers.DocumentBuilder
|
||||
* @throws ParserConfigurationException
|
||||
*/
|
||||
public static DocumentBuilder createDocumentBuilderIgnoringDOCTYPE() throws ParserConfigurationException {
|
||||
return DOCUMENT_BUILDER_FACTORY_IGNORING_DOCTYPE.newDocumentBuilder();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates DocumentBuilderFactory which throws SAXParseException when detecting external entities.
|
||||
*
|
||||
* @return javax.xml.parsers.DocumentBuilderFactory
|
||||
*/
|
||||
public static SAXParserFactory createSAXFactoryWithErrorOnDOCTYPE() {
|
||||
SAXParserFactory f = SAXParserFactory.newInstance();
|
||||
try {
|
||||
// force org.xml.sax.SAXParseException for any DOCTYPE:
|
||||
f.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); //$NON-NLS-1$
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return f;
|
||||
}
|
||||
|
||||
private static synchronized SAXParserFactory createSAXFactoryWithErrorOnDOCTYPE(boolean awareness) {
|
||||
SAXParserFactory f = SAXParserFactory.newInstance();
|
||||
f.setNamespaceAware(awareness);
|
||||
try {
|
||||
// force org.xml.sax.SAXParseException for any DOCTYPE:
|
||||
f.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); //$NON-NLS-1$
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return f;
|
||||
}
|
||||
|
||||
private static synchronized SAXParserFactory createSAXFactoryIgnoringDOCTYPE() {
|
||||
SAXParserFactory f = SAXParserFactory.newInstance();
|
||||
try {
|
||||
// ignore DOCTYPE:
|
||||
f.setFeature("http://xml.org/sax/features/external-general-entities", false); //$NON-NLS-1$
|
||||
f.setFeature("http://xml.org/sax/features/external-parameter-entities", false); //$NON-NLS-1$
|
||||
f.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); //$NON-NLS-1$
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return f;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates SAXParser which throws SAXParseException when detecting external entities.
|
||||
*
|
||||
* @return javax.xml.parsers.SAXParser
|
||||
*/
|
||||
|
||||
public static SAXParser createSAXParserWithErrorOnDOCTYPE() throws ParserConfigurationException, SAXException {
|
||||
return createSAXParserWithErrorOnDOCTYPE(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates SAXParser which throws SAXParseException when detecting external entities.
|
||||
*
|
||||
* @param namespaceAware
|
||||
* parameter for SAXParserFactory
|
||||
*
|
||||
* @return javax.xml.parsers.SAXParser
|
||||
*/
|
||||
public static SAXParser createSAXParserWithErrorOnDOCTYPE(boolean namespaceAware)
|
||||
throws ParserConfigurationException, SAXException {
|
||||
if (namespaceAware) {
|
||||
return SAX_FACTORY_ERROR_ON_DOCTYPE_NS.newSAXParser();
|
||||
}
|
||||
return SAX_FACTORY_ERROR_ON_DOCTYPE.newSAXParser();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates SAXParser which does not throw Exception when detecting external entities but ignores them.
|
||||
*
|
||||
* @return javax.xml.parsers.SAXParser
|
||||
*/
|
||||
public static SAXParser createSAXParserIgnoringDOCTYPE()
|
||||
throws ParserConfigurationException, SAXNotRecognizedException, SAXNotSupportedException, SAXException {
|
||||
SAXParser parser = SAX_FACTORY_IGNORING_DOCTYPE.newSAXParser();
|
||||
parser.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, ""); //$NON-NLS-1$
|
||||
parser.setProperty(XMLConstants.ACCESS_EXTERNAL_SCHEMA, ""); //$NON-NLS-1$
|
||||
return parser;
|
||||
}
|
||||
}
|
|
@ -25,12 +25,10 @@ import java.net.URI;
|
|||
import java.util.Arrays;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.transform.OutputKeys;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
|
||||
|
@ -63,7 +61,7 @@ public class XmlUtil {
|
|||
* @throws ParserConfigurationException in case of a problem retrieving {@link DocumentBuilder}.
|
||||
*/
|
||||
public static Document newDocument() throws ParserConfigurationException {
|
||||
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
DocumentBuilder builder = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
return builder.newDocument();
|
||||
}
|
||||
|
||||
|
@ -227,7 +225,7 @@ public class XmlUtil {
|
|||
*/
|
||||
private static Document loadXml(InputStream xmlStream) throws CoreException {
|
||||
try {
|
||||
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
DocumentBuilder builder = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
return builder.parse(xmlStream);
|
||||
} catch (Exception e) {
|
||||
throw new CoreException(CCorePlugin.createStatus(Messages.XmlUtil_InternalErrorLoading, e));
|
||||
|
@ -370,7 +368,8 @@ public class XmlUtil {
|
|||
private static byte[] toByteArray(Document doc) throws CoreException {
|
||||
try {
|
||||
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||
Transformer transformer = TransformerFactory.newInstance().newTransformer();
|
||||
Transformer transformer = XmlProcessorFactoryCdt.createTransformerFactoryWithErrorOnDOCTYPE()
|
||||
.newTransformer();
|
||||
transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
|
||||
transformer.setOutputProperty(OutputKeys.ENCODING, ENCODING_UTF_8);
|
||||
// Indentation is done with XmlUtil.prettyFormat(doc).
|
||||
|
|
|
@ -20,18 +20,17 @@ import java.io.IOException;
|
|||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.transform.OutputKeys;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerConfigurationException;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.cdt.core.settings.model.ICStorageElement;
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.eclipse.cdt.internal.core.settings.model.xml.XmlStorageElement;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
|
@ -148,7 +147,7 @@ public abstract class StorableEnvironmentLoader {
|
|||
if (env == null)
|
||||
return null;
|
||||
try {
|
||||
DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
DocumentBuilder parser = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
InputSource inputSource = new InputSource(new ByteArrayInputStream(env.getBytes()));
|
||||
Document document = parser.parse(inputSource);
|
||||
Element el = document.getDocumentElement();
|
||||
|
@ -170,8 +169,7 @@ public abstract class StorableEnvironmentLoader {
|
|||
|
||||
private ByteArrayOutputStream storeEnvironmentToStream(StorableEnvironment env) throws CoreException {
|
||||
try {
|
||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder builder = factory.newDocumentBuilder();
|
||||
DocumentBuilder builder = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
Document document = builder.newDocument();
|
||||
|
||||
Element el = document.createElement(StorableEnvironment.ENVIRONMENT_ELEMENT_NAME);
|
||||
|
@ -179,7 +177,8 @@ public abstract class StorableEnvironmentLoader {
|
|||
XmlStorageElement rootElement = new XmlStorageElement(el);
|
||||
env.serialize(rootElement);
|
||||
|
||||
Transformer transformer = TransformerFactory.newInstance().newTransformer();
|
||||
Transformer transformer = XmlProcessorFactoryCdt.createTransformerFactoryWithErrorOnDOCTYPE()
|
||||
.newTransformer();
|
||||
transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
|
||||
transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); //$NON-NLS-1$
|
||||
transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
|
||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %pluginName
|
||||
Bundle-SymbolicName: org.eclipse.cdt.ui.tests; singleton:=true
|
||||
Bundle-Version: 5.5.300.qualifier
|
||||
Bundle-Version: 5.5.400.qualifier
|
||||
Bundle-Activator: org.eclipse.cdt.ui.testplugin.CTestPlugin
|
||||
Bundle-Localization: plugin
|
||||
Export-Package: org.eclipse.cdt.ui.testplugin,
|
||||
|
@ -26,7 +26,7 @@ Require-Bundle: org.eclipse.jface.text,
|
|||
org.eclipse.ui.views,
|
||||
org.eclipse.ui.workbench.texteditor,
|
||||
org.junit,
|
||||
org.eclipse.cdt.core,
|
||||
org.eclipse.cdt.core;bundle-version="8.3.0",
|
||||
org.eclipse.cdt.core.tests,
|
||||
org.eclipse.help,
|
||||
org.eclipse.core.runtime,
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<version>5.5.300-SNAPSHOT</version>
|
||||
<version>5.5.400-SNAPSHOT</version>
|
||||
<artifactId>org.eclipse.cdt.ui.tests</artifactId>
|
||||
<packaging>eclipse-test-plugin</packaging>
|
||||
|
||||
|
|
|
@ -16,12 +16,11 @@ package org.eclipse.cdt.ui.tests.templateengine;
|
|||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
|
||||
import org.eclipse.cdt.core.templateengine.SharedDefaults;
|
||||
import org.eclipse.cdt.core.templateengine.TemplateEngine;
|
||||
import org.eclipse.cdt.core.templateengine.TemplateEngineHelper;
|
||||
import org.eclipse.cdt.core.testplugin.util.BaseTestCase;
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
|
@ -59,7 +58,7 @@ public class TestSharedDefaults extends BaseTestCase {
|
|||
private String getValueFromBackEndStorate(String key) throws Exception {
|
||||
File parsedXML = TemplateEngineHelper.getSharedDefaultLocation("shareddefaults.xml");
|
||||
|
||||
Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder()
|
||||
Document document = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE()
|
||||
.parse(parsedXML.toURI().toURL().openStream());
|
||||
|
||||
List<Element> sharedElementList = TemplateEngine.getChildrenOfElement(document.getDocumentElement());
|
||||
|
|
|
@ -104,7 +104,7 @@ Export-Package: org.eclipse.cdt.internal.corext;x-internal:=true,
|
|||
org.eclipse.cdt.ui.wizards.conversion,
|
||||
org.eclipse.cdt.utils.ui.controls
|
||||
Import-Package: org.apache.commons.io;version="[2.8.0,3.0.0)"
|
||||
Require-Bundle: org.eclipse.cdt.core;bundle-version="[8.0.0,9.0.0)",
|
||||
Require-Bundle: org.eclipse.cdt.core;bundle-version="[8.3.0,9.0.0)",
|
||||
org.eclipse.compare;bundle-version="[3.8.500,4.0.0)",
|
||||
org.eclipse.core.expressions;bundle-version="[3.8.200,4.0.0)",
|
||||
org.eclipse.core.filesystem;bundle-version="[1.9.500,2.0.0)",
|
||||
|
|
|
@ -19,17 +19,16 @@ import java.io.FileWriter;
|
|||
import java.io.IOException;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.transform.OutputKeys;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerConfigurationException;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
|
||||
import org.eclipse.cdt.core.model.ITranslationUnit;
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.eclipse.cdt.internal.ui.text.CHelpBookDescriptor;
|
||||
import org.eclipse.cdt.internal.ui.text.CHelpSettings;
|
||||
import org.eclipse.cdt.ui.CUIPlugin;
|
||||
|
@ -104,7 +103,7 @@ public class CHelpProviderManager {
|
|||
|
||||
if (file.isFile()) {
|
||||
try {
|
||||
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
DocumentBuilder builder = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
Document doc = builder.parse(file);
|
||||
NodeList nodes = doc.getElementsByTagName(ELEMENT_ROOT);
|
||||
|
||||
|
@ -187,7 +186,7 @@ public class CHelpProviderManager {
|
|||
File file = getSettingsFile();
|
||||
|
||||
try {
|
||||
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
DocumentBuilder builder = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
Document doc;
|
||||
Element rootElement = null;
|
||||
|
||||
|
@ -210,7 +209,8 @@ public class CHelpProviderManager {
|
|||
|
||||
FileWriter writer = new FileWriter(file);
|
||||
|
||||
Transformer transformer = TransformerFactory.newInstance().newTransformer();
|
||||
Transformer transformer = XmlProcessorFactoryCdt.createTransformerFactoryWithErrorOnDOCTYPE()
|
||||
.newTransformer();
|
||||
transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
|
||||
transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); //$NON-NLS-1$
|
||||
transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
|
||||
|
|
|
@ -23,9 +23,9 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.eclipse.cdt.ui.CUIPlugin;
|
||||
import org.eclipse.cdt.ui.ICHelpBook;
|
||||
import org.eclipse.cdt.ui.ICHelpProvider;
|
||||
import org.eclipse.cdt.ui.ICHelpResourceDescriptor;
|
||||
|
@ -42,7 +42,6 @@ import org.w3c.dom.Element;
|
|||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
import org.xml.sax.InputSource;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
public class CHelpProvider implements ICHelpProvider {
|
||||
|
||||
|
@ -175,7 +174,7 @@ public class CHelpProvider implements ICHelpProvider {
|
|||
InputStream stream = new FileInputStream(fname);
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
|
||||
InputSource src = new InputSource(reader);
|
||||
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
DocumentBuilder builder = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
doc = builder.parse(src);
|
||||
Element e = doc.getDocumentElement();
|
||||
if (NODE_HEAD.equals(e.getNodeName())) {
|
||||
|
@ -189,9 +188,8 @@ public class CHelpProvider implements ICHelpProvider {
|
|||
}
|
||||
}
|
||||
}
|
||||
} catch (ParserConfigurationException e) {
|
||||
} catch (SAXException e) {
|
||||
} catch (IOException e) {
|
||||
} catch (Exception e) {
|
||||
CUIPlugin.log("Failed to load helpbook in " + pluginId, e); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,17 +32,15 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.parsers.SAXParser;
|
||||
import javax.xml.parsers.SAXParserFactory;
|
||||
import javax.xml.transform.OutputKeys;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.eclipse.cdt.internal.ui.CUIException;
|
||||
import org.eclipse.cdt.internal.ui.CUIStatus;
|
||||
import org.eclipse.cdt.internal.ui.preferences.formatter.ProfileManager.CustomProfile;
|
||||
|
@ -235,8 +233,7 @@ public class ProfileStore {
|
|||
protected static List<Profile> readProfilesFromStream(InputSource inputSource) throws CoreException {
|
||||
final ProfileDefaultHandler handler = new ProfileDefaultHandler();
|
||||
try {
|
||||
final SAXParserFactory factory = SAXParserFactory.newInstance();
|
||||
final SAXParser parser = factory.newSAXParser();
|
||||
final SAXParser parser = XmlProcessorFactoryCdt.createSAXParserWithErrorOnDOCTYPE();
|
||||
parser.parse(inputSource, handler);
|
||||
} catch (SAXException e) {
|
||||
throw createException(e, FormatterMessages.CodingStyleConfigurationBlock_error_reading_xml_message);
|
||||
|
@ -282,8 +279,7 @@ public class ProfileStore {
|
|||
private static void writeProfilesToStream(Collection<Profile> profiles, OutputStream stream, String encoding,
|
||||
IProfileVersioner profileVersioner) throws CoreException {
|
||||
try {
|
||||
final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
final DocumentBuilder builder = factory.newDocumentBuilder();
|
||||
final DocumentBuilder builder = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
final Document document = builder.newDocument();
|
||||
|
||||
final Element rootElement = document.createElement(XML_NODE_ROOT);
|
||||
|
@ -299,7 +295,8 @@ public class ProfileStore {
|
|||
}
|
||||
}
|
||||
|
||||
Transformer transformer = TransformerFactory.newInstance().newTransformer();
|
||||
Transformer transformer = XmlProcessorFactoryCdt.createTransformerFactoryWithErrorOnDOCTYPE()
|
||||
.newTransformer();
|
||||
transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
|
||||
transformer.setOutputProperty(OutputKeys.ENCODING, encoding);
|
||||
transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
|
||||
|
|
|
@ -21,7 +21,6 @@ import java.util.List;
|
|||
import javax.xml.transform.OutputKeys;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerConfigurationException;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.sax.SAXTransformerFactory;
|
||||
import javax.xml.transform.sax.TransformerHandler;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
|
@ -29,6 +28,7 @@ import javax.xml.transform.stream.StreamResult;
|
|||
import org.eclipse.cdt.core.resources.ResourcesUtil;
|
||||
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
||||
import org.eclipse.cdt.core.settings.model.ICFolderDescription;
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.eclipse.cdt.ui.CUIPlugin;
|
||||
import org.eclipse.core.filesystem.URIUtil;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
|
@ -93,7 +93,8 @@ public class ProjectSettingsExportStrategy implements IProjectSettingsWizardPage
|
|||
*/
|
||||
@Override
|
||||
public boolean finish(IProjectSettingsWizardPage page) {
|
||||
SAXTransformerFactory factory = (SAXTransformerFactory) TransformerFactory.newInstance();
|
||||
SAXTransformerFactory factory = (SAXTransformerFactory) XmlProcessorFactoryCdt
|
||||
.createTransformerFactoryWithErrorOnDOCTYPE();
|
||||
TransformerHandler handler = null;
|
||||
try {
|
||||
handler = factory.newTransformerHandler();
|
||||
|
|
|
@ -29,6 +29,7 @@ import org.eclipse.cdt.core.model.CoreModel;
|
|||
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
||||
import org.eclipse.cdt.core.settings.model.ICFolderDescription;
|
||||
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.eclipse.cdt.ui.CUIPlugin;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
|
@ -230,7 +231,7 @@ public class ProjectSettingsImportStrategy implements IProjectSettingsWizardPage
|
|||
* will do its own validation programatically.
|
||||
*/
|
||||
private static Document parse(InputStream in) throws SettingsImportExportException {
|
||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilderFactory factory = XmlProcessorFactoryCdt.createDocumentBuilderFactoryWithErrorOnDOCTYPE();
|
||||
factory.setValidating(false);
|
||||
factory.setNamespaceAware(false);
|
||||
factory.setIgnoringComments(true);
|
||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %pluginName
|
||||
Bundle-SymbolicName: org.eclipse.cdt.debug.core; singleton:=true
|
||||
Bundle-Version: 8.8.100.qualifier
|
||||
Bundle-Version: 8.8.200.qualifier
|
||||
Bundle-Activator: org.eclipse.cdt.debug.core.CDebugCorePlugin
|
||||
Bundle-Vendor: %providerName
|
||||
Bundle-Localization: plugin
|
||||
|
@ -38,7 +38,7 @@ Export-Package: org.eclipse.cdt.debug.core,
|
|||
org.eclipse.cdt.dsf.ui,
|
||||
org.eclipse.cdt.tests.dsf.gdb",
|
||||
org.eclipse.cdt.debug.internal.core.srcfinder;x-internal:=true
|
||||
Require-Bundle: org.eclipse.cdt.core;bundle-version="[8.0.0,9.0.0)",
|
||||
Require-Bundle: org.eclipse.cdt.core;bundle-version="[8.3.0,9.0.0)",
|
||||
org.eclipse.core.filesystem;bundle-version="1.2.0",
|
||||
org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)",
|
||||
org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
|
||||
|
|
|
@ -46,6 +46,7 @@ import org.eclipse.cdt.debug.core.model.ICFunctionBreakpoint;
|
|||
import org.eclipse.cdt.debug.core.model.ICLineBreakpoint;
|
||||
import org.eclipse.cdt.debug.core.model.ICWatchpoint;
|
||||
import org.eclipse.cdt.debug.core.model.ICWatchpoint2;
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IMarker;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
|
@ -227,7 +228,7 @@ public class CDebugUtils {
|
|||
*/
|
||||
public static String serializeDocument(Document doc, boolean indent) throws IOException, TransformerException {
|
||||
ByteArrayOutputStream s = new ByteArrayOutputStream();
|
||||
TransformerFactory factory = TransformerFactory.newInstance();
|
||||
TransformerFactory factory = XmlProcessorFactoryCdt.createTransformerFactoryWithErrorOnDOCTYPE();
|
||||
Transformer transformer = factory.newTransformer();
|
||||
transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
|
||||
transformer.setOutputProperty(OutputKeys.INDENT, indent ? "yes" : "no"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
|
|
@ -18,7 +18,6 @@ import java.io.StringReader;
|
|||
import java.util.ArrayList;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.transform.OutputKeys;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
|
@ -26,6 +25,7 @@ import javax.xml.transform.dom.DOMSource;
|
|||
import javax.xml.transform.stream.StreamResult;
|
||||
|
||||
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.eclipse.core.resources.IMarker;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IAdaptable;
|
||||
|
@ -192,7 +192,7 @@ public class BreakpointActionManager {
|
|||
Element root = null;
|
||||
DocumentBuilder parser;
|
||||
try {
|
||||
parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
parser = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
parser.setErrorHandler(new DefaultHandler());
|
||||
root = parser.parse(new InputSource(new StringReader(actionData))).getDocumentElement();
|
||||
|
||||
|
@ -246,10 +246,8 @@ public class BreakpointActionManager {
|
|||
public void saveActionData() {
|
||||
String actionData = ""; //$NON-NLS-1$
|
||||
|
||||
DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder docBuilder = null;
|
||||
try {
|
||||
docBuilder = dfactory.newDocumentBuilder();
|
||||
DocumentBuilder docBuilder = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
Document doc = docBuilder.newDocument();
|
||||
|
||||
Element rootElement = doc.createElement("breakpointActionData"); //$NON-NLS-1$
|
||||
|
@ -265,7 +263,7 @@ public class BreakpointActionManager {
|
|||
|
||||
ByteArrayOutputStream s = new ByteArrayOutputStream();
|
||||
|
||||
TransformerFactory factory = TransformerFactory.newInstance();
|
||||
TransformerFactory factory = XmlProcessorFactoryCdt.createTransformerFactoryWithErrorOnDOCTYPE();
|
||||
Transformer transformer = factory.newTransformer();
|
||||
transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
|
||||
transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
|
||||
|
|
|
@ -23,7 +23,6 @@ import java.util.LinkedList;
|
|||
import java.util.List;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.transform.TransformerException;
|
||||
|
||||
|
@ -32,6 +31,7 @@ import org.eclipse.cdt.debug.core.CDebugCorePlugin;
|
|||
import org.eclipse.cdt.debug.core.CDebugUtils;
|
||||
import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation;
|
||||
import org.eclipse.cdt.debug.core.sourcelookup.IDirectorySourceLocation;
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.eclipse.cdt.internal.core.resources.ResourceLookup;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IStorage;
|
||||
|
@ -279,7 +279,7 @@ public class CDirectorySourceLocation implements IDirectorySourceLocation {
|
|||
Document document = null;
|
||||
Throwable ex = null;
|
||||
try {
|
||||
document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
|
||||
document = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE().newDocument();
|
||||
Element node = document.createElement(ELEMENT_NAME);
|
||||
document.appendChild(node);
|
||||
node.setAttribute(ATTR_DIRECTORY, getDirectory().toOSString());
|
||||
|
@ -307,7 +307,7 @@ public class CDirectorySourceLocation implements IDirectorySourceLocation {
|
|||
Exception ex = null;
|
||||
try {
|
||||
Element root = null;
|
||||
DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
DocumentBuilder parser = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
StringReader reader = new StringReader(memento);
|
||||
InputSource source = new InputSource(reader);
|
||||
root = parser.parse(source).getDocumentElement();
|
||||
|
|
|
@ -21,7 +21,6 @@ import java.util.HashSet;
|
|||
import java.util.LinkedList;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.transform.TransformerException;
|
||||
|
||||
|
@ -29,6 +28,7 @@ import org.eclipse.cdt.debug.core.CDebugCorePlugin;
|
|||
import org.eclipse.cdt.debug.core.CDebugUtils;
|
||||
import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation;
|
||||
import org.eclipse.cdt.debug.core.sourcelookup.IProjectSourceLocation;
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.eclipse.cdt.internal.core.resources.ResourceLookup;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
|
@ -208,7 +208,7 @@ public class CProjectSourceLocation implements IProjectSourceLocation {
|
|||
Document document = null;
|
||||
Throwable ex = null;
|
||||
try {
|
||||
document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
|
||||
document = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE().newDocument();
|
||||
Element node = document.createElement(ELEMENT_NAME);
|
||||
document.appendChild(node);
|
||||
node.setAttribute(ATTR_PROJECT, getProject().getName());
|
||||
|
@ -234,7 +234,7 @@ public class CProjectSourceLocation implements IProjectSourceLocation {
|
|||
Exception ex = null;
|
||||
try {
|
||||
Element root = null;
|
||||
DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
DocumentBuilder parser = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
StringReader reader = new StringReader(memento);
|
||||
InputSource source = new InputSource(reader);
|
||||
root = parser.parse(source).getDocumentElement();
|
||||
|
|
|
@ -24,7 +24,6 @@ import java.util.LinkedList;
|
|||
import java.util.List;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.transform.TransformerException;
|
||||
|
||||
|
@ -35,6 +34,7 @@ import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation;
|
|||
import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator;
|
||||
import org.eclipse.cdt.debug.core.sourcelookup.IProjectSourceLocation;
|
||||
import org.eclipse.cdt.debug.core.sourcelookup.SourceLookupFactory;
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
|
@ -239,7 +239,7 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato
|
|||
Document document = null;
|
||||
Throwable ex = null;
|
||||
try {
|
||||
document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
|
||||
document = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE().newDocument();
|
||||
Element node = document.createElement(SOURCE_LOCATOR_NAME);
|
||||
document.appendChild(node);
|
||||
ICSourceLocation[] locations = getSourceLocations();
|
||||
|
@ -269,7 +269,7 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato
|
|||
Exception ex = null;
|
||||
try {
|
||||
Element root = null;
|
||||
DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
DocumentBuilder parser = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
StringReader reader = new StringReader(memento);
|
||||
InputSource source = new InputSource(reader);
|
||||
root = parser.parse(source).getDocumentElement();
|
||||
|
|
|
@ -25,7 +25,6 @@ import java.util.List;
|
|||
import java.util.Set;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.transform.TransformerException;
|
||||
|
||||
|
@ -41,6 +40,7 @@ import org.eclipse.cdt.debug.core.sourcelookup.IDirectorySourceLocation;
|
|||
import org.eclipse.cdt.debug.core.sourcelookup.IMappingSourceContainer;
|
||||
import org.eclipse.cdt.debug.core.sourcelookup.IProjectSourceLocation;
|
||||
import org.eclipse.cdt.debug.core.sourcelookup.MappingSourceContainer;
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.eclipse.cdt.internal.core.resources.ResourceLookup;
|
||||
import org.eclipse.core.filesystem.URIUtil;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
|
@ -73,7 +73,7 @@ public class SourceUtils {
|
|||
Document document = null;
|
||||
Throwable ex = null;
|
||||
try {
|
||||
document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
|
||||
document = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE().newDocument();
|
||||
Element element = document.createElement(NAME_COMMON_SOURCE_LOCATIONS);
|
||||
document.appendChild(element);
|
||||
saveSourceLocations(document, element, locations);
|
||||
|
@ -108,7 +108,7 @@ public class SourceUtils {
|
|||
ICSourceLocation[] result = new ICSourceLocation[0];
|
||||
if (!isEmpty(memento)) {
|
||||
try {
|
||||
DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
DocumentBuilder parser = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
StringReader reader = new StringReader(memento);
|
||||
InputSource source = new InputSource(reader);
|
||||
Element root = parser.parse(source).getDocumentElement();
|
||||
|
|
|
@ -51,7 +51,7 @@ Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.16.0,4.0.0)",
|
|||
org.eclipse.debug.core;bundle-version="[3.7.0,4.0.0)",
|
||||
org.eclipse.cdt.debug.core;bundle-version="[7.0.0,9.0.0)",
|
||||
org.eclipse.cdt.ui;bundle-version="[8.0.0,9.0.0)",
|
||||
org.eclipse.cdt.core;bundle-version="[8.0.0,9.0.0)",
|
||||
org.eclipse.cdt.core;bundle-version="[8.3.0,9.0.0)",
|
||||
org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
|
||||
org.eclipse.ui.console;bundle-version="[3.1.100,4.0.0)",
|
||||
org.eclipse.ui.views;bundle-version="[3.2.0,4.0.0)",
|
||||
|
|
|
@ -18,7 +18,6 @@ import java.io.StringReader;
|
|||
import java.text.MessageFormat;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.transform.OutputKeys;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
|
@ -28,6 +27,7 @@ import javax.xml.transform.stream.StreamResult;
|
|||
import org.eclipse.cdt.debug.core.CDIDebugModel;
|
||||
import org.eclipse.cdt.debug.core.breakpointactions.AbstractBreakpointAction;
|
||||
import org.eclipse.cdt.debug.internal.core.ICDebugInternalConstants;
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IAdaptable;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
|
@ -132,10 +132,8 @@ public class ExternalToolAction extends AbstractBreakpointAction {
|
|||
public String getMemento() {
|
||||
String executeData = ""; //$NON-NLS-1$
|
||||
if (externalToolName != null) {
|
||||
DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder docBuilder = null;
|
||||
try {
|
||||
docBuilder = dfactory.newDocumentBuilder();
|
||||
DocumentBuilder docBuilder = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
Document doc = docBuilder.newDocument();
|
||||
|
||||
Element rootElement = doc.createElement("launchConfigName"); //$NON-NLS-1$
|
||||
|
@ -145,7 +143,7 @@ public class ExternalToolAction extends AbstractBreakpointAction {
|
|||
|
||||
ByteArrayOutputStream s = new ByteArrayOutputStream();
|
||||
|
||||
TransformerFactory factory = TransformerFactory.newInstance();
|
||||
TransformerFactory factory = XmlProcessorFactoryCdt.createTransformerFactoryWithErrorOnDOCTYPE();
|
||||
Transformer transformer = factory.newTransformer();
|
||||
transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
|
||||
transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
|
||||
|
@ -179,7 +177,7 @@ public class ExternalToolAction extends AbstractBreakpointAction {
|
|||
Element root = null;
|
||||
DocumentBuilder parser;
|
||||
try {
|
||||
parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
parser = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
parser.setErrorHandler(new DefaultHandler());
|
||||
root = parser.parse(new InputSource(new StringReader(data))).getDocumentElement();
|
||||
String value = root.getAttribute("configName"); //$NON-NLS-1$
|
||||
|
|
|
@ -18,7 +18,6 @@ import java.io.StringReader;
|
|||
import java.text.MessageFormat;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.transform.OutputKeys;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
|
@ -29,6 +28,7 @@ import org.eclipse.cdt.debug.core.CDIDebugModel;
|
|||
import org.eclipse.cdt.debug.core.breakpointactions.AbstractBreakpointAction;
|
||||
import org.eclipse.cdt.debug.core.breakpointactions.ILogActionEnabler;
|
||||
import org.eclipse.cdt.debug.internal.core.ICDebugInternalConstants;
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.eclipse.core.runtime.IAdaptable;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
|
@ -117,10 +117,8 @@ public class LogAction extends AbstractBreakpointAction {
|
|||
public String getMemento() {
|
||||
String logData = ""; //$NON-NLS-1$
|
||||
|
||||
DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder docBuilder = null;
|
||||
try {
|
||||
docBuilder = dfactory.newDocumentBuilder();
|
||||
DocumentBuilder docBuilder = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
Document doc = docBuilder.newDocument();
|
||||
|
||||
Element rootElement = doc.createElement("logData"); //$NON-NLS-1$
|
||||
|
@ -131,7 +129,7 @@ public class LogAction extends AbstractBreakpointAction {
|
|||
|
||||
ByteArrayOutputStream s = new ByteArrayOutputStream();
|
||||
|
||||
TransformerFactory factory = TransformerFactory.newInstance();
|
||||
TransformerFactory factory = XmlProcessorFactoryCdt.createTransformerFactoryWithErrorOnDOCTYPE();
|
||||
Transformer transformer = factory.newTransformer();
|
||||
transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
|
||||
transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
|
||||
|
@ -174,7 +172,7 @@ public class LogAction extends AbstractBreakpointAction {
|
|||
Element root = null;
|
||||
DocumentBuilder parser;
|
||||
try {
|
||||
parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
parser = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
parser.setErrorHandler(new DefaultHandler());
|
||||
root = parser.parse(new InputSource(new StringReader(data))).getDocumentElement();
|
||||
String value = root.getAttribute("message"); //$NON-NLS-1$
|
||||
|
|
|
@ -18,7 +18,6 @@ import java.io.StringReader;
|
|||
import java.text.MessageFormat;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.transform.OutputKeys;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
|
@ -31,6 +30,7 @@ import org.eclipse.cdt.debug.core.breakpointactions.IResumeActionEnabler;
|
|||
import org.eclipse.cdt.debug.internal.core.ICDebugInternalConstants;
|
||||
import org.eclipse.cdt.debug.internal.ui.IInternalCDebugUIConstants;
|
||||
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.eclipse.core.runtime.IAdaptable;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
|
@ -113,10 +113,8 @@ public class ResumeAction extends AbstractBreakpointAction {
|
|||
public String getMemento() {
|
||||
String resumeData = ""; //$NON-NLS-1$
|
||||
|
||||
DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder docBuilder = null;
|
||||
try {
|
||||
docBuilder = dfactory.newDocumentBuilder();
|
||||
DocumentBuilder docBuilder = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
Document doc = docBuilder.newDocument();
|
||||
|
||||
Element rootElement = doc.createElement("resumeData"); //$NON-NLS-1$
|
||||
|
@ -126,7 +124,7 @@ public class ResumeAction extends AbstractBreakpointAction {
|
|||
|
||||
ByteArrayOutputStream s = new ByteArrayOutputStream();
|
||||
|
||||
TransformerFactory factory = TransformerFactory.newInstance();
|
||||
TransformerFactory factory = XmlProcessorFactoryCdt.createTransformerFactoryWithErrorOnDOCTYPE();
|
||||
Transformer transformer = factory.newTransformer();
|
||||
transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
|
||||
transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
|
||||
|
@ -161,7 +159,7 @@ public class ResumeAction extends AbstractBreakpointAction {
|
|||
Element root = null;
|
||||
DocumentBuilder parser;
|
||||
try {
|
||||
parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
parser = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
parser.setErrorHandler(new DefaultHandler());
|
||||
root = parser.parse(new InputSource(new StringReader(data))).getDocumentElement();
|
||||
String value = root.getAttribute("pauseTime"); //$NON-NLS-1$
|
||||
|
|
|
@ -17,7 +17,6 @@ import java.io.ByteArrayOutputStream;
|
|||
import java.io.StringReader;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.transform.OutputKeys;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
|
@ -30,6 +29,7 @@ import org.eclipse.cdt.debug.core.breakpointactions.IReverseDebugEnabler;
|
|||
import org.eclipse.cdt.debug.internal.core.ICDebugInternalConstants;
|
||||
import org.eclipse.cdt.debug.internal.ui.IInternalCDebugUIConstants;
|
||||
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.eclipse.core.runtime.IAdaptable;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
|
@ -123,10 +123,8 @@ public class ReverseDebugAction extends AbstractBreakpointAction {
|
|||
public String getMemento() {
|
||||
String reverseDebugData = ""; //$NON-NLS-1$
|
||||
|
||||
DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder docBuilder = null;
|
||||
try {
|
||||
docBuilder = dfactory.newDocumentBuilder();
|
||||
DocumentBuilder docBuilder = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
Document doc = docBuilder.newDocument();
|
||||
|
||||
Element rootElement = doc.createElement("reverseDebugData"); //$NON-NLS-1$
|
||||
|
@ -136,7 +134,7 @@ public class ReverseDebugAction extends AbstractBreakpointAction {
|
|||
|
||||
ByteArrayOutputStream s = new ByteArrayOutputStream();
|
||||
|
||||
TransformerFactory factory = TransformerFactory.newInstance();
|
||||
TransformerFactory factory = XmlProcessorFactoryCdt.createTransformerFactoryWithErrorOnDOCTYPE();
|
||||
Transformer transformer = factory.newTransformer();
|
||||
transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
|
||||
transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
|
||||
|
@ -159,7 +157,7 @@ public class ReverseDebugAction extends AbstractBreakpointAction {
|
|||
Element root = null;
|
||||
DocumentBuilder parser;
|
||||
try {
|
||||
parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
parser = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
parser.setErrorHandler(new DefaultHandler());
|
||||
root = parser.parse(new InputSource(new StringReader(data))).getDocumentElement();
|
||||
String value = root.getAttribute("operation"); //$NON-NLS-1$
|
||||
|
|
|
@ -27,7 +27,6 @@ import javax.sound.sampled.LineUnavailableException;
|
|||
import javax.sound.sampled.SourceDataLine;
|
||||
import javax.sound.sampled.UnsupportedAudioFileException;
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.transform.OutputKeys;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
|
@ -37,6 +36,7 @@ import javax.xml.transform.stream.StreamResult;
|
|||
import org.eclipse.cdt.debug.core.CDIDebugModel;
|
||||
import org.eclipse.cdt.debug.core.breakpointactions.AbstractBreakpointAction;
|
||||
import org.eclipse.cdt.debug.internal.core.ICDebugInternalConstants;
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.eclipse.core.runtime.IAdaptable;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
|
@ -137,10 +137,8 @@ public class SoundAction extends AbstractBreakpointAction {
|
|||
public String getMemento() {
|
||||
String soundData = ""; //$NON-NLS-1$
|
||||
if (soundFile != null) {
|
||||
DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder docBuilder = null;
|
||||
try {
|
||||
docBuilder = dfactory.newDocumentBuilder();
|
||||
DocumentBuilder docBuilder = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
Document doc = docBuilder.newDocument();
|
||||
|
||||
Element rootElement = doc.createElement("soundData"); //$NON-NLS-1$
|
||||
|
@ -150,7 +148,7 @@ public class SoundAction extends AbstractBreakpointAction {
|
|||
|
||||
ByteArrayOutputStream s = new ByteArrayOutputStream();
|
||||
|
||||
TransformerFactory factory = TransformerFactory.newInstance();
|
||||
TransformerFactory factory = XmlProcessorFactoryCdt.createTransformerFactoryWithErrorOnDOCTYPE();
|
||||
Transformer transformer = factory.newTransformer();
|
||||
transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
|
||||
transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
|
||||
|
@ -170,10 +168,15 @@ public class SoundAction extends AbstractBreakpointAction {
|
|||
|
||||
@Override
|
||||
public void initializeFromMemento(String data) {
|
||||
if (data == null || data.isBlank()) {
|
||||
// An empty string will cause a sax parser error below
|
||||
return;
|
||||
}
|
||||
|
||||
Element root = null;
|
||||
DocumentBuilder parser;
|
||||
try {
|
||||
parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
parser = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
parser.setErrorHandler(new DefaultHandler());
|
||||
root = parser.parse(new InputSource(new StringReader(data))).getDocumentElement();
|
||||
String value = root.getAttribute("file"); //$NON-NLS-1$
|
||||
|
|
|
@ -20,7 +20,6 @@ import java.util.ArrayList;
|
|||
import java.util.Iterator;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.transform.OutputKeys;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
|
@ -29,6 +28,7 @@ import javax.xml.transform.stream.StreamResult;
|
|||
|
||||
import org.eclipse.cdt.debug.core.breakpointactions.IBreakpointAction;
|
||||
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.core.runtime.PlatformObject;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
|
@ -161,7 +161,7 @@ public class SoundActionPage extends PlatformObject implements IBreakpointAction
|
|||
Element root = null;
|
||||
DocumentBuilder parser;
|
||||
try {
|
||||
parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
parser = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
parser.setErrorHandler(new DefaultHandler());
|
||||
root = parser.parse(new InputSource(new StringReader(recentSoundData))).getDocumentElement();
|
||||
|
||||
|
@ -198,10 +198,8 @@ public class SoundActionPage extends PlatformObject implements IBreakpointAction
|
|||
public void saveRecentSounds() {
|
||||
String recentSoundData = ""; //$NON-NLS-1$
|
||||
|
||||
DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder docBuilder = null;
|
||||
try {
|
||||
docBuilder = dfactory.newDocumentBuilder();
|
||||
DocumentBuilder docBuilder = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
Document doc = docBuilder.newDocument();
|
||||
|
||||
Element rootElement = doc.createElement("recentSounds"); //$NON-NLS-1$
|
||||
|
@ -218,7 +216,7 @@ public class SoundActionPage extends PlatformObject implements IBreakpointAction
|
|||
|
||||
ByteArrayOutputStream s = new ByteArrayOutputStream();
|
||||
|
||||
TransformerFactory factory = TransformerFactory.newInstance();
|
||||
TransformerFactory factory = XmlProcessorFactoryCdt.createTransformerFactoryWithErrorOnDOCTYPE();
|
||||
Transformer transformer = factory.newTransformer();
|
||||
transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
|
||||
transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
|
||||
|
|
|
@ -18,7 +18,6 @@ import java.io.StringReader;
|
|||
import java.text.MessageFormat;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.transform.TransformerException;
|
||||
|
||||
|
@ -27,6 +26,7 @@ import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
|
|||
import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator;
|
||||
import org.eclipse.cdt.debug.core.sourcelookup.SourceLookupFactory;
|
||||
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.IResourceChangeListener;
|
||||
import org.eclipse.core.resources.ResourcesPlugin;
|
||||
|
@ -80,7 +80,7 @@ public class OldDefaultSourceLocator implements IPersistableSourceLocator, IAdap
|
|||
Document document = null;
|
||||
Throwable ex = null;
|
||||
try {
|
||||
document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
|
||||
document = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE().newDocument();
|
||||
Element element = document.createElement(ELEMENT_NAME);
|
||||
document.appendChild(element);
|
||||
element.setAttribute(ATTR_PROJECT, getCSourceLocator().getProject().getName());
|
||||
|
@ -109,7 +109,7 @@ public class OldDefaultSourceLocator implements IPersistableSourceLocator, IAdap
|
|||
Exception ex = null;
|
||||
try {
|
||||
Element root = null;
|
||||
DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
DocumentBuilder parser = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
StringReader reader = new StringReader(memento);
|
||||
InputSource source = new InputSource(reader);
|
||||
root = parser.parse(source).getDocumentElement();
|
||||
|
|
|
@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
|
|||
Bundle-Name: %pluginName
|
||||
Bundle-Vendor: %providerName
|
||||
Bundle-SymbolicName: org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui;singleton:=true
|
||||
Bundle-Version: 1.3.100.qualifier
|
||||
Bundle-Version: 1.3.200.qualifier
|
||||
Bundle-Activator: org.eclipse.cdt.dsf.gdb.multicorevisualizer.internal.ui.MulticoreVisualizerUIPlugin
|
||||
Bundle-Localization: plugin
|
||||
Require-Bundle: org.eclipse.ui,
|
||||
|
@ -15,7 +15,7 @@ Require-Bundle: org.eclipse.ui,
|
|||
org.eclipse.cdt.visualizer.core,
|
||||
org.eclipse.cdt.visualizer.ui,
|
||||
org.eclipse.debug.ui,
|
||||
org.eclipse.cdt.core,
|
||||
org.eclipse.cdt.core;bundle-version="8.3.0",
|
||||
org.eclipse.cdt.debug.ui
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-17
|
||||
|
|
|
@ -22,13 +22,13 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.transform.OutputKeys;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.w3c.dom.Attr;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
@ -61,10 +61,8 @@ public class MementoUtils {
|
|||
public static String encodeMapIntoMemento(Map<String, String> keyPairValues) {
|
||||
String returnValue = null;
|
||||
|
||||
DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder docBuilder = null;
|
||||
try {
|
||||
docBuilder = dfactory.newDocumentBuilder();
|
||||
DocumentBuilder docBuilder = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
Document doc = docBuilder.newDocument();
|
||||
|
||||
Element rootElement = doc.createElement(ROOT_ELEMENT_TAGNAME);
|
||||
|
@ -80,7 +78,7 @@ public class MementoUtils {
|
|||
|
||||
ByteArrayOutputStream s = new ByteArrayOutputStream();
|
||||
|
||||
TransformerFactory factory = TransformerFactory.newInstance();
|
||||
TransformerFactory factory = XmlProcessorFactoryCdt.createTransformerFactoryWithErrorOnDOCTYPE();
|
||||
Transformer transformer = factory.newTransformer();
|
||||
transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
|
||||
transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
|
||||
|
@ -103,7 +101,7 @@ public class MementoUtils {
|
|||
Element root = null;
|
||||
DocumentBuilder parser;
|
||||
try {
|
||||
parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
parser = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
parser.setErrorHandler(new DefaultHandler());
|
||||
root = parser.parse(new InputSource(new StringReader(memento))).getDocumentElement();
|
||||
NodeList nodeList = root.getChildNodes();
|
||||
|
@ -142,10 +140,8 @@ public class MementoUtils {
|
|||
public static String encodeListIntoMemento(List<String> labels) {
|
||||
String returnValue = null;
|
||||
|
||||
DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder docBuilder = null;
|
||||
try {
|
||||
docBuilder = dfactory.newDocumentBuilder();
|
||||
DocumentBuilder docBuilder = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
Document doc = docBuilder.newDocument();
|
||||
|
||||
Element rootElement = doc.createElement(ROOT_ELEMENT_TAGNAME);
|
||||
|
@ -159,7 +155,7 @@ public class MementoUtils {
|
|||
|
||||
ByteArrayOutputStream s = new ByteArrayOutputStream();
|
||||
|
||||
TransformerFactory factory = TransformerFactory.newInstance();
|
||||
TransformerFactory factory = XmlProcessorFactoryCdt.createTransformerFactoryWithErrorOnDOCTYPE();
|
||||
Transformer transformer = factory.newTransformer();
|
||||
transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
|
||||
transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
|
||||
|
@ -182,7 +178,7 @@ public class MementoUtils {
|
|||
Element root = null;
|
||||
DocumentBuilder parser;
|
||||
try {
|
||||
parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
parser = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
parser.setErrorHandler(new DefaultHandler());
|
||||
root = parser.parse(new InputSource(new StringReader(memento))).getDocumentElement();
|
||||
NodeList nodeList = root.getChildNodes();
|
||||
|
|
|
@ -9,7 +9,7 @@ Bundle-Localization: plugin
|
|||
Require-Bundle: org.eclipse.core.runtime,
|
||||
org.eclipse.cdt.dsf,
|
||||
org.eclipse.debug.core,
|
||||
org.eclipse.cdt.core,
|
||||
org.eclipse.cdt.core;bundle-version="8.3.0",
|
||||
org.eclipse.cdt.debug.core,
|
||||
org.eclipse.core.variables,
|
||||
org.eclipse.cdt.launch;bundle-version="10.3.0",
|
||||
|
|
|
@ -18,7 +18,6 @@ import java.io.ByteArrayOutputStream;
|
|||
import java.io.StringReader;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.transform.OutputKeys;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
|
@ -26,6 +25,7 @@ import javax.xml.transform.dom.DOMSource;
|
|||
import javax.xml.transform.stream.StreamResult;
|
||||
|
||||
import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin;
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.xml.sax.InputSource;
|
||||
|
@ -124,10 +124,8 @@ public class CollectAction extends AbstractTracepointAction {
|
|||
public String getMemento() {
|
||||
String collectData = ""; //$NON-NLS-1$
|
||||
|
||||
DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder docBuilder = null;
|
||||
try {
|
||||
docBuilder = dfactory.newDocumentBuilder();
|
||||
DocumentBuilder docBuilder = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
Document doc = docBuilder.newDocument();
|
||||
|
||||
Element rootElement = doc.createElement(COLLECT_ACTION_ELEMENT_NAME);
|
||||
|
@ -142,7 +140,7 @@ public class CollectAction extends AbstractTracepointAction {
|
|||
|
||||
ByteArrayOutputStream s = new ByteArrayOutputStream();
|
||||
|
||||
TransformerFactory factory = TransformerFactory.newInstance();
|
||||
TransformerFactory factory = XmlProcessorFactoryCdt.createTransformerFactoryWithErrorOnDOCTYPE();
|
||||
Transformer transformer = factory.newTransformer();
|
||||
transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
|
||||
transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
|
||||
|
@ -189,7 +187,7 @@ public class CollectAction extends AbstractTracepointAction {
|
|||
Element root = null;
|
||||
DocumentBuilder parser;
|
||||
try {
|
||||
parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
parser = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
parser.setErrorHandler(new DefaultHandler());
|
||||
root = parser.parse(new InputSource(new StringReader(data))).getDocumentElement();
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@ import java.io.ByteArrayOutputStream;
|
|||
import java.io.StringReader;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.transform.OutputKeys;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
|
@ -27,6 +26,7 @@ import javax.xml.transform.dom.DOMSource;
|
|||
import javax.xml.transform.stream.StreamResult;
|
||||
|
||||
import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin;
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.xml.sax.InputSource;
|
||||
|
@ -62,10 +62,8 @@ public class EvaluateAction extends AbstractTracepointAction {
|
|||
public String getMemento() {
|
||||
String collectData = ""; //$NON-NLS-1$
|
||||
|
||||
DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder docBuilder = null;
|
||||
try {
|
||||
docBuilder = dfactory.newDocumentBuilder();
|
||||
DocumentBuilder docBuilder = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
Document doc = docBuilder.newDocument();
|
||||
|
||||
Element rootElement = doc.createElement("evalData"); //$NON-NLS-1$
|
||||
|
@ -75,7 +73,7 @@ public class EvaluateAction extends AbstractTracepointAction {
|
|||
|
||||
ByteArrayOutputStream s = new ByteArrayOutputStream();
|
||||
|
||||
TransformerFactory factory = TransformerFactory.newInstance();
|
||||
TransformerFactory factory = XmlProcessorFactoryCdt.createTransformerFactoryWithErrorOnDOCTYPE();
|
||||
Transformer transformer = factory.newTransformer();
|
||||
transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
|
||||
transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
|
||||
|
@ -108,7 +106,7 @@ public class EvaluateAction extends AbstractTracepointAction {
|
|||
Element root = null;
|
||||
DocumentBuilder parser;
|
||||
try {
|
||||
parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
parser = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
parser.setErrorHandler(new DefaultHandler());
|
||||
root = parser.parse(new InputSource(new StringReader(data))).getDocumentElement();
|
||||
fEvalString = root.getAttribute("evalString"); //$NON-NLS-1$
|
||||
|
|
|
@ -19,7 +19,6 @@ import java.util.ArrayList;
|
|||
import java.util.Iterator;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.transform.OutputKeys;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
|
@ -27,6 +26,7 @@ import javax.xml.transform.dom.DOMSource;
|
|||
import javax.xml.transform.stream.StreamResult;
|
||||
|
||||
import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin;
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.Node;
|
||||
|
@ -90,7 +90,7 @@ public class TracepointActionManager {
|
|||
Element root = null;
|
||||
DocumentBuilder parser;
|
||||
try {
|
||||
parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
parser = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
parser.setErrorHandler(new DefaultHandler());
|
||||
root = parser.parse(new InputSource(new StringReader(actionData))).getDocumentElement();
|
||||
|
||||
|
@ -146,10 +146,8 @@ public class TracepointActionManager {
|
|||
public void saveActionData() {
|
||||
String actionData = ""; //$NON-NLS-1$
|
||||
|
||||
DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder docBuilder = null;
|
||||
try {
|
||||
docBuilder = dfactory.newDocumentBuilder();
|
||||
DocumentBuilder docBuilder = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
Document doc = docBuilder.newDocument();
|
||||
|
||||
Element rootElement = doc.createElement("tracepointActionData"); //$NON-NLS-1$
|
||||
|
@ -168,7 +166,7 @@ public class TracepointActionManager {
|
|||
|
||||
ByteArrayOutputStream s = new ByteArrayOutputStream();
|
||||
|
||||
TransformerFactory factory = TransformerFactory.newInstance();
|
||||
TransformerFactory factory = XmlProcessorFactoryCdt.createTransformerFactoryWithErrorOnDOCTYPE();
|
||||
Transformer transformer = factory.newTransformer();
|
||||
transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
|
||||
transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
|
||||
|
|
|
@ -19,7 +19,6 @@ import java.io.ByteArrayOutputStream;
|
|||
import java.io.StringReader;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.transform.OutputKeys;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
|
@ -27,6 +26,7 @@ import javax.xml.transform.dom.DOMSource;
|
|||
import javax.xml.transform.stream.StreamResult;
|
||||
|
||||
import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin;
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.xml.sax.InputSource;
|
||||
|
@ -98,10 +98,8 @@ public class WhileSteppingAction extends AbstractTracepointAction {
|
|||
public String getMemento() {
|
||||
String collectData = ""; //$NON-NLS-1$
|
||||
|
||||
DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder docBuilder = null;
|
||||
try {
|
||||
docBuilder = dfactory.newDocumentBuilder();
|
||||
DocumentBuilder docBuilder = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
Document doc = docBuilder.newDocument();
|
||||
|
||||
Element rootElement = doc.createElement("whileSteppingData"); //$NON-NLS-1$
|
||||
|
@ -112,7 +110,7 @@ public class WhileSteppingAction extends AbstractTracepointAction {
|
|||
|
||||
ByteArrayOutputStream s = new ByteArrayOutputStream();
|
||||
|
||||
TransformerFactory factory = TransformerFactory.newInstance();
|
||||
TransformerFactory factory = XmlProcessorFactoryCdt.createTransformerFactoryWithErrorOnDOCTYPE();
|
||||
Transformer transformer = factory.newTransformer();
|
||||
transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
|
||||
transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
|
||||
|
@ -145,7 +143,7 @@ public class WhileSteppingAction extends AbstractTracepointAction {
|
|||
Element root = null;
|
||||
DocumentBuilder parser;
|
||||
try {
|
||||
parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
parser = XmlProcessorFactoryCdt.createDocumentBuilderWithErrorOnDOCTYPE();
|
||||
parser.setErrorHandler(new DefaultHandler());
|
||||
root = parser.parse(new InputSource(new StringReader(data))).getDocumentElement();
|
||||
setStepCount(Integer.parseInt(root.getAttribute("whileSteppingCount"))); //$NON-NLS-1$
|
||||
|
|
|
@ -2,13 +2,14 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %pluginName
|
||||
Bundle-SymbolicName: org.eclipse.cdt.testsrunner.boost;singleton:=true
|
||||
Bundle-Version: 7.2.0.qualifier
|
||||
Bundle-Version: 7.2.100.qualifier
|
||||
Bundle-Activator: org.eclipse.cdt.testsrunner.internal.boost.BoostTestsRunnerPlugin
|
||||
Bundle-Vendor: %providerName
|
||||
Bundle-Localization: plugin
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-17
|
||||
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.5.0",
|
||||
org.eclipse.cdt.testsrunner;bundle-version="3.5.0"
|
||||
org.eclipse.cdt.testsrunner;bundle-version="3.5.0",
|
||||
org.eclipse.cdt.core;bundle-version="8.3.0"
|
||||
Export-Package: org.eclipse.cdt.testsrunner.internal.boost;x-friends:="org.eclipse.cdt.testsrunner.tests"
|
||||
Automatic-Module-Name: org.eclipse.cdt.testsrunner.boost
|
||||
|
|
|
@ -19,8 +19,8 @@ import java.text.MessageFormat;
|
|||
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.parsers.SAXParser;
|
||||
import javax.xml.parsers.SAXParserFactory;
|
||||
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.eclipse.cdt.testsrunner.launcher.ITestsRunnerProvider;
|
||||
import org.eclipse.cdt.testsrunner.model.ITestModelUpdater;
|
||||
import org.eclipse.cdt.testsrunner.model.TestingException;
|
||||
|
@ -94,8 +94,7 @@ public class BoostTestsRunnerProvider implements ITestsRunnerProvider {
|
|||
@Override
|
||||
public void run(ITestModelUpdater modelUpdater, InputStream inputStream) throws TestingException {
|
||||
try {
|
||||
SAXParserFactory spf = SAXParserFactory.newInstance();
|
||||
SAXParser sp = spf.newSAXParser();
|
||||
SAXParser sp = XmlProcessorFactoryCdt.createSAXParserWithErrorOnDOCTYPE();
|
||||
sp.parse(inputStream, new BoostXmlLogHandler(modelUpdater));
|
||||
|
||||
} catch (IOException e) {
|
||||
|
|
|
@ -2,13 +2,14 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %pluginName
|
||||
Bundle-SymbolicName: org.eclipse.cdt.testsrunner.qttest;singleton:=true
|
||||
Bundle-Version: 7.2.0.qualifier
|
||||
Bundle-Version: 7.2.100.qualifier
|
||||
Bundle-Activator: org.eclipse.cdt.testsrunner.internal.qttest.QtTestsRunnerPlugin
|
||||
Bundle-Vendor: %providerName
|
||||
Bundle-Localization: plugin
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-17
|
||||
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.5.0",
|
||||
org.eclipse.cdt.testsrunner;bundle-version="3.5.0"
|
||||
org.eclipse.cdt.testsrunner;bundle-version="3.5.0",
|
||||
org.eclipse.cdt.core;bundle-version="8.3.0"
|
||||
Export-Package: org.eclipse.cdt.testsrunner.internal.qttest;x-friends:="org.eclipse.cdt.testsrunner.tests"
|
||||
Automatic-Module-Name: org.eclipse.cdt.testsrunner.qttest
|
||||
|
|
|
@ -19,8 +19,8 @@ import java.text.MessageFormat;
|
|||
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.parsers.SAXParser;
|
||||
import javax.xml.parsers.SAXParserFactory;
|
||||
|
||||
import org.eclipse.cdt.internal.core.XmlProcessorFactoryCdt;
|
||||
import org.eclipse.cdt.testsrunner.launcher.ITestsRunnerProvider;
|
||||
import org.eclipse.cdt.testsrunner.model.ITestModelUpdater;
|
||||
import org.eclipse.cdt.testsrunner.model.TestingException;
|
||||
|
@ -111,8 +111,7 @@ public class QtTestsRunnerProvider implements ITestsRunnerProvider {
|
|||
@Override
|
||||
public void run(ITestModelUpdater modelUpdater, InputStream inputStream) throws TestingException {
|
||||
try {
|
||||
SAXParserFactory spf = SAXParserFactory.newInstance();
|
||||
SAXParser sp = spf.newSAXParser();
|
||||
SAXParser sp = XmlProcessorFactoryCdt.createSAXParserWithErrorOnDOCTYPE();
|
||||
sp.parse(inputStream, new QtXmlLogHandler(modelUpdater));
|
||||
|
||||
} catch (IOException e) {
|
||||
|
|
Loading…
Add table
Reference in a new issue