commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hgi...@apache.org
Subject svn commit: r333085 - /jakarta/commons/proper/jelly/branches/hans-speed-improvement/src/java/org/apache/commons/jelly/parser/XMLParser.java
Date Sun, 13 Nov 2005 18:26:58 GMT
Author: hgilde
Date: Sun Nov 13 10:26:50 2005
New Revision: 333085

URL: http://svn.apache.org/viewcvs?rev=333085&view=rev
Log:
remove unused code that aparantly used to
generate text for tags that can't be
resolved to a script. This mechanism was replaced
long ago.

Modified:
    jakarta/commons/proper/jelly/branches/hans-speed-improvement/src/java/org/apache/commons/jelly/parser/XMLParser.java

Modified: jakarta/commons/proper/jelly/branches/hans-speed-improvement/src/java/org/apache/commons/jelly/parser/XMLParser.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/jelly/branches/hans-speed-improvement/src/java/org/apache/commons/jelly/parser/XMLParser.java?rev=333085&r1=333084&r2=333085&view=diff
==============================================================================
--- jakarta/commons/proper/jelly/branches/hans-speed-improvement/src/java/org/apache/commons/jelly/parser/XMLParser.java
(original)
+++ jakarta/commons/proper/jelly/branches/hans-speed-improvement/src/java/org/apache/commons/jelly/parser/XMLParser.java
Sun Nov 13 10:26:50 2005
@@ -592,6 +592,7 @@
             // otherwise pass the text to the current body
             TagScript newTagScript = createTag(namespaceURI, localName, list);
             if (newTagScript == null) {
+                //TODO createStaticTag should always return a tag (or throw an exception
                 newTagScript = createStaticTag(namespaceURI, localName, qName, list);
             }
             tagScript = newTagScript;
@@ -617,19 +618,8 @@
                 tagScript.setTagBody(script);
             }
             else {
-                // XXXX: might wanna handle empty elements later...
-                textBuffer.append("<");
-                textBuffer.append(qName);
-                int size = list.getLength();
-                for (int i = 0; i < size; i++) {
-                    textBuffer.append(" ");
-                    textBuffer.append(list.getQName(i));
-                    textBuffer.append("=");
-                    textBuffer.append("\"");
-                    textBuffer.append(list.getValue(i));
-                    textBuffer.append("\"");
-                }
-                textBuffer.append(">");
+                //this should never happen because of createStaticTag
+                throw new SAXException("Failed to create script for tag.");
             }
         }
         catch (SAXException e) {
@@ -680,9 +670,8 @@
                 script = (ScriptBlock) scriptStack.pop();
             }
             else {
-                textBuffer.append("</");
-                textBuffer.append(qName);
-                textBuffer.append(">");
+                //this should never happen, because there would at least be a static tag
+                throw new SAXException("While parsing, the tag stack has become corrupt.");
             }
 
             // now lets set the parent tag variable
@@ -1048,7 +1037,6 @@
         Attributes list)
         throws SAXException {
         try {
-            StaticTag tag = new StaticTag( namespaceURI, localName, qName );
             StaticTagScript script = new StaticTagScript(
                 new TagFactory() {
                     public Tag createTag(String name, Attributes attributes) {



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message