xmlbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eric...@apache.org
Subject cvs commit: xml-xmlbeans/v2/src/newstore2/org/apache/xmlbeans/impl/newstore2 Xobj.java
Date Thu, 04 Nov 2004 17:22:05 GMT
ericvas     2004/11/04 09:22:04

  Modified:    v2/src/newstore2/org/apache/xmlbeans/impl/newstore2
                        Xobj.java
  Log:
  Cache String value after get
  
  Revision  Changes    Path
  1.13      +27 -1     xml-xmlbeans/v2/src/newstore2/org/apache/xmlbeans/impl/newstore2/Xobj.java
  
  Index: Xobj.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/newstore2/org/apache/xmlbeans/impl/newstore2/Xobj.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- Xobj.java	22 Oct 2004 18:22:09 -0000	1.12
  +++ Xobj.java	4 Nov 2004 17:22:04 -0000	1.13
  @@ -1019,7 +1019,33 @@
               Object src = getFirstChars();
   
               if (wsr == Locale.WS_PRESERVE)
  -                return CharUtil.getString( src, offSrc(), cchSrc() );
  +            {
  +                String s = CharUtil.getString( src, offSrc(), cchSrc() );
  +
  +                // Cache string to be able to use it later again
  +
  +                int cch = s.length();
  +
  +                if (cch > 0)
  +                {
  +                    Xobj lastAttr = lastAttr();
  +
  +                    assert (lastAttr == null ? _cchValue : lastAttr._cchAfter) == cch;
  +
  +                    if (lastAttr != null)
  +                    {
  +                        lastAttr._srcAfter = s;
  +                        lastAttr._offAfter = 0;
  +                    }
  +                    else
  +                    {
  +                        _srcValue = s;
  +                        _offValue = 0;
  +                    }
  +                }
  +
  +                return s;
  +            }
   
               Locale.ScrubBuffer scrub = Locale.getScrubBuffer( wsr );
   
  
  
  

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


Mime
View raw message