Author: mrglavas
Date: Sat Sep 27 10:48:59 2008
New Revision: 699701
URL: http://svn.apache.org/viewvc?rev=699701&view=rev
Log:
Include an error message in each of the NPEs thrown for a null feature/property
name parameter.
Modified:
xerces/java/trunk/src/org/apache/xerces/jaxp/validation/ValidatorHandlerImpl.java
xerces/java/trunk/src/org/apache/xerces/jaxp/validation/ValidatorImpl.java
Modified:
xerces/java/trunk/src/org/apache/xerces/jaxp/validation/ValidatorHandlerImpl.java
URL:
http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/jaxp/validation/ValidatorHandlerImpl.java?rev=699701&r1=699700&r2=699701&view=diff
==============================================================================
---
xerces/java/trunk/src/org/apache/xerces/jaxp/validation/ValidatorHandlerImpl.java
(original)
+++
xerces/java/trunk/src/org/apache/xerces/jaxp/validation/ValidatorHandlerImpl.java
Sat Sep 27 10:48:59 2008
@@ -236,7 +236,8 @@
public boolean getFeature(String name)
throws SAXNotRecognizedException, SAXNotSupportedException {
if (name == null) {
- throw new NullPointerException();
+ throw new
NullPointerException(JAXPValidationMessageFormatter.formatMessage(Locale.getDefault(),
+ "FeatureNameNull", null));
}
try {
return fComponentManager.getFeature(name);
@@ -254,7 +255,8 @@
public void setFeature(String name, boolean value)
throws SAXNotRecognizedException, SAXNotSupportedException {
if (name == null) {
- throw new NullPointerException();
+ throw new
NullPointerException(JAXPValidationMessageFormatter.formatMessage(Locale.getDefault(),
+ "FeatureNameNull", null));
}
try {
fComponentManager.setFeature(name, value);
@@ -272,7 +274,8 @@
public Object getProperty(String name)
throws SAXNotRecognizedException, SAXNotSupportedException {
if (name == null) {
- throw new NullPointerException();
+ throw new
NullPointerException(JAXPValidationMessageFormatter.formatMessage(Locale.getDefault(),
+ "ProperyNameNull", null));
}
try {
return fComponentManager.getProperty(name);
@@ -290,7 +293,8 @@
public void setProperty(String name, Object object)
throws SAXNotRecognizedException, SAXNotSupportedException {
if (name == null) {
- throw new NullPointerException();
+ throw new
NullPointerException(JAXPValidationMessageFormatter.formatMessage(Locale.getDefault(),
+ "ProperyNameNull", null));
}
try {
fComponentManager.setProperty(name, object);
Modified:
xerces/java/trunk/src/org/apache/xerces/jaxp/validation/ValidatorImpl.java
URL:
http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/jaxp/validation/ValidatorImpl.java?rev=699701&r1=699700&r2=699701&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/jaxp/validation/ValidatorImpl.java
(original)
+++ xerces/java/trunk/src/org/apache/xerces/jaxp/validation/ValidatorImpl.java
Sat Sep 27 10:48:59 2008
@@ -162,7 +162,8 @@
public boolean getFeature(String name)
throws SAXNotRecognizedException, SAXNotSupportedException {
if (name == null) {
- throw new NullPointerException();
+ throw new
NullPointerException(JAXPValidationMessageFormatter.formatMessage(Locale.getDefault(),
+ "FeatureNameNull", null));
}
if (name.startsWith(JAXP_SOURCE_RESULT_FEATURE_PREFIX)) {
// Indicates to the caller that this Validator supports a specific
JAXP Source or Result.
@@ -193,7 +194,8 @@
public void setFeature(String name, boolean value)
throws SAXNotRecognizedException, SAXNotSupportedException {
if (name == null) {
- throw new NullPointerException();
+ throw new
NullPointerException(JAXPValidationMessageFormatter.formatMessage(Locale.getDefault(),
+ "FeatureNameNull", null));
}
if (name.startsWith(JAXP_SOURCE_RESULT_FEATURE_PREFIX)) {
if (name.equals(StreamSource.FEATURE) ||
@@ -226,7 +228,8 @@
public Object getProperty(String name)
throws SAXNotRecognizedException, SAXNotSupportedException {
if (name == null) {
- throw new NullPointerException();
+ throw new
NullPointerException(JAXPValidationMessageFormatter.formatMessage(Locale.getDefault(),
+ "ProperyNameNull", null));
}
if (CURRENT_ELEMENT_NODE.equals(name)) {
return (fDOMValidatorHelper != null) ?
@@ -248,7 +251,8 @@
public void setProperty(String name, Object object)
throws SAXNotRecognizedException, SAXNotSupportedException {
if (name == null) {
- throw new NullPointerException();
+ throw new
NullPointerException(JAXPValidationMessageFormatter.formatMessage(Locale.getDefault(),
+ "ProperyNameNull", null));
}
if (CURRENT_ELEMENT_NODE.equals(name)) {
throw new SAXNotSupportedException(
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]