nddelima 2005/06/13 15:26:42
Modified: java/src/org/apache/xml/serialize DOMSerializerImpl.java
java/src/org/apache/xerces/parsers DOMParserImpl.java
java/src/org/apache/xerces/dom DOMConfigurationImpl.java
Log:
Fix for defect http://issues.apache.org/jira/browse/XERCESJ-865
Revision Changes Path
1.36 +2 -3
xml-xerces/java/src/org/apache/xml/serialize/DOMSerializerImpl.java
Index: DOMSerializerImpl.java
===================================================================
RCS file:
/home/cvs/xml-xerces/java/src/org/apache/xml/serialize/DOMSerializerImpl.java,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- DOMSerializerImpl.java 13 Jun 2005 21:37:49 -0000 1.35
+++ DOMSerializerImpl.java 13 Jun 2005 22:26:42 -0000 1.36
@@ -250,13 +250,12 @@
if (value == null || value instanceof DOMErrorHandler) {
fErrorHandler = (DOMErrorHandler)value;
} else {
- // REVISIT: modify error exception to TYPE_MISMATCH
String msg =
DOMMessageFormatter.formatMessage(
DOMMessageFormatter.DOM_DOMAIN,
"TYPE_MISMATCH_ERR",
new Object[] { name });
- throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
+ throw new DOMException(DOMException.TYPE_MISMATCH_ERR, msg);
}
} else if (
name.equalsIgnoreCase(Constants.DOM_RESOURCE_RESOLVER)
1.34 +5 -5
xml-xerces/java/src/org/apache/xerces/parsers/DOMParserImpl.java
Index: DOMParserImpl.java
===================================================================
RCS file:
/home/cvs/xml-xerces/java/src/org/apache/xerces/parsers/DOMParserImpl.java,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- DOMParserImpl.java 13 Jun 2005 21:37:49 -0000 1.33
+++ DOMParserImpl.java 13 Jun 2005 22:26:42 -0000 1.34
@@ -466,7 +466,7 @@
DOMMessageFormatter.DOM_DOMAIN,
"TYPE_MISMATCH_ERR",
new Object[] { name });
- throw new DOMException (DOMException.NOT_SUPPORTED_ERR,
msg);
+ throw new DOMException (DOMException.TYPE_MISMATCH_ERR,
msg);
}
}
@@ -484,7 +484,7 @@
DOMMessageFormatter.DOM_DOMAIN,
"TYPE_MISMATCH_ERR",
new Object[] { name });
- throw new DOMException (DOMException.NOT_SUPPORTED_ERR,
msg);
+ throw new DOMException (DOMException.TYPE_MISMATCH_ERR,
msg);
}
}
@@ -528,7 +528,7 @@
DOMMessageFormatter.DOM_DOMAIN,
"TYPE_MISMATCH_ERR",
new Object[] { name });
- throw new DOMException (DOMException.NOT_SUPPORTED_ERR,
msg);
+ throw new DOMException (DOMException.TYPE_MISMATCH_ERR,
msg);
}
}
@@ -579,7 +579,7 @@
DOMMessageFormatter.DOM_DOMAIN,
"TYPE_MISMATCH_ERR",
new Object[] { name });
- throw new DOMException (DOMException.NOT_SUPPORTED_ERR,
msg);
+ throw new DOMException (DOMException.TYPE_MISMATCH_ERR,
msg);
}
}
1.35 +16 -8
xml-xerces/java/src/org/apache/xerces/dom/DOMConfigurationImpl.java
Index: DOMConfigurationImpl.java
===================================================================
RCS file:
/home/cvs/xml-xerces/java/src/org/apache/xerces/dom/DOMConfigurationImpl.java,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- DOMConfigurationImpl.java 13 Jun 2005 21:12:48 -0000 1.34
+++ DOMConfigurationImpl.java 13 Jun 2005 22:26:42 -0000 1.35
@@ -519,6 +519,7 @@
* setParameter
*/
public void setParameter(String name, Object value) throws DOMException {
+ boolean found = true;
// REVISIT: Recognizes DOM L3 default features only.
// Does not yet recognize Xerces features.
@@ -606,15 +607,22 @@
features = (short) (state ? features | PSVI : features &
~PSVI);
}
else {
+ found = false;
+ /*
String msg =
DOMMessageFormatter.formatMessage(
DOMMessageFormatter.DOM_DOMAIN,
"FEATURE_NOT_FOUND",
new Object[] { name });
throw new DOMException(DOMException.NOT_FOUND_ERR, msg);
+ */
}
+
}
- else { // set properties
+
+ if (!found || !(value instanceof Boolean)) { // set properties
+ found = true;
+
if (name.equalsIgnoreCase(Constants.DOM_ERROR_HANDLER)) {
if (value instanceof DOMErrorHandler || value == null) {
fErrorHandlerWrapper.setErrorHandler((DOMErrorHandler)value);
@@ -628,7 +636,7 @@
DOMMessageFormatter.DOM_DOMAIN,
"TYPE_MISMATCH_ERR",
new Object[] { name });
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
msg);
+ throw new DOMException(DOMException.TYPE_MISMATCH_ERR,
msg);
}
}
else if (name.equalsIgnoreCase(Constants.DOM_RESOURCE_RESOLVER))
{
@@ -645,7 +653,7 @@
DOMMessageFormatter.DOM_DOMAIN,
"TYPE_MISMATCH_ERR",
new Object[] { name });
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
msg);
+ throw new DOMException(DOMException.TYPE_MISMATCH_ERR,
msg);
}
}
@@ -666,7 +674,7 @@
DOMMessageFormatter.DOM_DOMAIN,
"TYPE_MISMATCH_ERR",
new Object[] { name });
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
msg);
+ throw new DOMException(DOMException.TYPE_MISMATCH_ERR,
msg);
}
}
@@ -698,7 +706,7 @@
DOMMessageFormatter.DOM_DOMAIN,
"TYPE_MISMATCH_ERR",
new Object[] { name });
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
msg);
+ throw new DOMException(DOMException.TYPE_MISMATCH_ERR,
msg);
}
}
@@ -714,7 +722,7 @@
DOMMessageFormatter.DOM_DOMAIN,
"TYPE_MISMATCH_ERR",
new Object[] { name });
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
msg);
+ throw new DOMException(DOMException.TYPE_MISMATCH_ERR,
msg);
}
}
else if (name.equalsIgnoreCase (GRAMMAR_POOL)){
@@ -728,7 +736,7 @@
DOMMessageFormatter.DOM_DOMAIN,
"TYPE_MISMATCH_ERR",
new Object[] { name });
- throw new DOMException(DOMException.NOT_SUPPORTED_ERR,
msg);
+ throw new DOMException(DOMException.TYPE_MISMATCH_ERR,
msg);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]