Author: mrglavas
Date: Sat Sep 27 10:49:27 2008
New Revision: 699702

URL: http://svn.apache.org/viewvc?rev=699702&view=rev
Log:
Include an error message in each of the NPEs thrown for a null feature/property 
name parameter.

Modified:
    
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/validation/ValidatorHandlerImpl.java
    
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/validation/ValidatorImpl.java

Modified: 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/validation/ValidatorHandlerImpl.java
URL: 
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/validation/ValidatorHandlerImpl.java?rev=699702&r1=699701&r2=699702&view=diff
==============================================================================
--- 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/validation/ValidatorHandlerImpl.java
 (original)
+++ 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/validation/ValidatorHandlerImpl.java
 Sat Sep 27 10:49:27 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/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/validation/ValidatorImpl.java
URL: 
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/validation/ValidatorImpl.java?rev=699702&r1=699701&r2=699702&view=diff
==============================================================================
--- 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/validation/ValidatorImpl.java
 (original)
+++ 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/validation/ValidatorImpl.java
 Sat Sep 27 10:49:27 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]

Reply via email to