incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awi...@apache.org
Subject svn commit: r490782 - /incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/PropertyNodeParser.java
Date Thu, 28 Dec 2006 20:19:19 GMT
Author: awiner
Date: Thu Dec 28 12:19:18 2006
New Revision: 490782

URL: http://svn.apache.org/viewvc?view=rev&rev=490782
Log:
Fix sporadic problem with legacy .xss file and missing whitespace in property values

Modified:
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/PropertyNodeParser.java

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/PropertyNodeParser.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/PropertyNodeParser.java?view=diff&rev=490782&r1=490781&r2=490782
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/PropertyNodeParser.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/style/xml/parse/PropertyNodeParser.java
Thu Dec 28 12:19:18 2006
@@ -98,6 +98,11 @@
     )
   {
     String moreText = new String(text, start, length);
+    if (_whitespace != null)
+    {
+      moreText = _whitespace + moreText;
+      _whitespace = null;
+    }
 
     if (_value == null)
       _value = moreText;
@@ -105,6 +110,19 @@
       _value = _value + moreText;
   }
 
+  public void addWhitespace(
+    ParseContext context,
+    char[]       text,
+    int          start,
+    int          length) throws SAXParseException
+  {
+    String whitespace = new String(text, start, length);
+    if (_whitespace == null)
+      _whitespace = whitespace;
+    else
+      _whitespace = _whitespace + whitespace;
+  }
+
   // Validates the value using a PropertyValidater.  Returns an error
   // message if there are validation errors.  Otherwise, returns null
   // if everything is okay.
@@ -126,6 +144,7 @@
 
   private String _name;
   private String _value;
+  private String _whitespace;
 
   private static final String _DEPRECATED_ERROR =
     "The <colorProperty> element is deprecated.  Colors must be explicitly specified
using <property> elements.";



Mime
View raw message