abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r592804 - /incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMBuilder.java
Date Wed, 07 Nov 2007 16:09:56 GMT
Author: jmsnell
Date: Wed Nov  7 08:09:55 2007
New Revision: 592804

URL: http://svn.apache.org/viewvc?rev=592804&view=rev
Log:
Minor code simplification. We didn't need two references to the same object

Modified:
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMBuilder.java

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMBuilder.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMBuilder.java?rev=592804&r1=592803&r2=592804&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMBuilder.java
(original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMBuilder.java
Wed Nov  7 08:09:55 2007
@@ -52,7 +52,7 @@
 
   private final FOMFactory fomfactory;
   private final ParserOptions parserOptions;
-  private Document fomDocument = null;
+  private boolean indoc = false;
   private int depth = 0;
   private int depthInSkipElement = 0;
   private boolean ignoreWhitespace = false;
@@ -269,9 +269,9 @@
   
   protected OMElement constructNode(OMContainer parent, String name) {
     OMElement element = null;
-    if (fomDocument == null) {
-      fomDocument = (Document) document;
-      parent = (OMContainer) fomDocument;
+    if (!indoc) {
+      parent = document;
+      indoc = true;
     }
     QName qname = parser.getName();
     if (parserOptions.isQNameAliasMappingEnabled()) {
@@ -328,10 +328,10 @@
   }
 
   public <T extends Element>Document<T> getFomDocument() {
-    while ((fomDocument == null) && !done) {
+    while (!indoc && !done) {
       next();
     }
-    return fomDocument;
+    return (Document<T>) document;
   }
   
   public OMDocument getDocument() {



Mime
View raw message