Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJared Burns2005-02-10 17:14:26 -0500
committerJared Burns2005-02-10 17:14:26 -0500
commit0de0dc405715c295c241a6dbe29b2dd75e799e70 (patch)
tree421c297c4df2a38edfca426afb587ff4881c0110
parenta738dbc45deb7282ebbcbd9a5a5bc5ae3a5d7c6e (diff)
downloadeclipse.platform.debug-0de0dc405715c295c241a6dbe29b2dd75e799e70.tar.gz
eclipse.platform.debug-0de0dc405715c295c241a6dbe29b2dd75e799e70.tar.xz
eclipse.platform.debug-0de0dc405715c295c241a6dbe29b2dd75e799e70.zip
Bug 73397 - Setting ErrorHandlers for XML parsing
-rw-r--r--org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariableManager.java2
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java2
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java2
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationManager.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/WorkingSetSourceContainerType.java2
7 files changed, 14 insertions, 0 deletions
diff --git a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariableManager.java b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariableManager.java
index b29ce4e9c..f4d6742ba 100644
--- a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariableManager.java
+++ b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariableManager.java
@@ -51,6 +51,7 @@ import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
/**
* Singleton string variable manager.
@@ -233,6 +234,7 @@ public class StringVariableManager implements IStringVariableManager {
try {
ByteArrayInputStream stream = new ByteArrayInputStream(variablesString.getBytes("UTF-8")); //$NON-NLS-1$
DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ parser.setErrorHandler(new DefaultHandler());
root = parser.parse(stream).getDocumentElement();
} catch (UnsupportedEncodingException e) {
ex = e;
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java
index cc299c627..a4c18beb0 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java
@@ -58,6 +58,7 @@ import org.osgi.framework.BundleContext;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
/**
* There is one instance of the debug plug-in available from
@@ -1137,6 +1138,7 @@ public class DebugPlugin extends Plugin {
InputStream stream = null;
try{
DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ parser.setErrorHandler(new DefaultHandler());
stream = new ByteArrayInputStream(document.getBytes());
root = parser.parse(stream).getDocumentElement();
} catch (ParserConfigurationException e) {
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java
index c1e1a1bca..558b795eb 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java
@@ -50,6 +50,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
/**
* Launch configuration handle.
@@ -88,6 +89,7 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
Element root = null;
DocumentBuilder parser =
DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ parser.setErrorHandler(new DefaultHandler());
StringReader reader = new StringReader(memento);
InputSource source = new InputSource(reader);
root = parser.parse(source).getDocumentElement();
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java
index 2000721ef..9bb20d968 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java
@@ -98,6 +98,7 @@ import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
/**
* Manages launch configurations, launch configuration types, and registered launches.
@@ -492,6 +493,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
SAXException {
Element root = null;
DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ parser.setErrorHandler(new DefaultHandler());
root = parser.parse(new InputSource(stream)).getDocumentElement();
LaunchConfigurationInfo info = new LaunchConfigurationInfo();
info.initializeFromXML(root);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationManager.java
index 088be8482..122a26c4f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationManager.java
@@ -68,6 +68,7 @@ import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
public class LaunchConfigurationManager implements ILaunchListener {
/**
@@ -387,6 +388,7 @@ public class LaunchConfigurationManager implements ILaunchListener {
rootHistoryElement = null;
try {
DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ parser.setErrorHandler(new DefaultHandler());
rootHistoryElement = parser.parse(new InputSource(stream)).getDocumentElement();
} catch (SAXException e) {
DebugUIPlugin.log(e);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java
index 895546fe3..767e59e8d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java
@@ -52,6 +52,7 @@ import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
/**
* The perspective manager manages the 'perspective' settings
@@ -708,6 +709,7 @@ public class PerspectiveManager implements ILaunchListener, IDebugEventSetListen
try {
Element root = null;
DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ parser.setErrorHandler(new DefaultHandler());
StringReader reader = new StringReader(xml);
InputSource source = new InputSource(reader);
root = parser.parse(source).getDocumentElement();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/WorkingSetSourceContainerType.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/WorkingSetSourceContainerType.java
index 5ea107f57..d82cd0bd9 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/WorkingSetSourceContainerType.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/WorkingSetSourceContainerType.java
@@ -25,6 +25,7 @@ import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
/**
* The factory for creating/restoring working set source containers.
@@ -54,6 +55,7 @@ public class WorkingSetSourceContainerType extends AbstractSourceContainerTypeDe
Element root = null;
DocumentBuilder parser =
DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ parser.setErrorHandler(new DefaultHandler());
StringReader reader = new StringReader(memento);
InputSource source = new InputSource(reader);
root = parser.parse(source).getDocumentElement();

Back to the top