You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mr...@apache.org on 2008/12/31 20:44:42 UTC

svn commit: r730454 - /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/stax/events/XMLEventImpl.java

Author: mrglavas
Date: Wed Dec 31 11:44:42 2008
New Revision: 730454

URL: http://svn.apache.org/viewvc?rev=730454&view=rev
Log:
Copy the Location passed in if non-null and ensure that the events always return a non-null Location.

Modified:
    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/stax/events/XMLEventImpl.java

Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/stax/events/XMLEventImpl.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/stax/events/XMLEventImpl.java?rev=730454&r1=730453&r2=730454&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/stax/events/XMLEventImpl.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/stax/events/XMLEventImpl.java Wed Dec 31 11:44:42 2008
@@ -27,6 +27,9 @@
 import javax.xml.stream.events.StartElement;
 import javax.xml.stream.events.XMLEvent;
 
+import org.apache.xerces.stax.EmptyLocation;
+import org.apache.xerces.stax.ImmutableLocation;
+
 /**
  * @xerces.internal
  * 
@@ -52,7 +55,12 @@
      */
     XMLEventImpl(final int eventType, final Location location) {
         fEventType = eventType;
-        fLocation = location;
+        if (location != null) {
+            fLocation = new ImmutableLocation(location);
+        }
+        else {
+            fLocation = EmptyLocation.getInstance();
+        }
     }
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org