diff options
author | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2008-05-05 23:39:35 +0000 |
---|---|---|
committer | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2008-05-05 23:39:35 +0000 |
commit | 9f1c4a8dbed55775f1734a27c6a560b405190cb5 (patch) | |
tree | 0533a7de8a693e3fb811022807f99a98de56be93 /gnu/javax | |
parent | 6adf82b1031640fe3e37ab9f4b62026ae68e2cc1 (diff) | |
download | classpath-9f1c4a8dbed55775f1734a27c6a560b405190cb5.tar.gz |
2008-05-06 Andrew John Hughes <gnu_andrew@member.fsf.org>
PR classpath/21869
* gnu/javax/swing/text/html/parser/htmlValidator.java,
* gnu/javax/swing/text/html/parser/models/list.java,
* gnu/javax/swing/text/html/parser/models/node.java,
* gnu/javax/swing/text/html/parser/support/Parser.java:
Swap use of StringBuffer for CPStringBuilder,
Diffstat (limited to 'gnu/javax')
4 files changed, 31 insertions, 23 deletions
diff --git a/gnu/javax/swing/text/html/parser/htmlValidator.java b/gnu/javax/swing/text/html/parser/htmlValidator.java index 7507850e8..7f16f1f2d 100644 --- a/gnu/javax/swing/text/html/parser/htmlValidator.java +++ b/gnu/javax/swing/text/html/parser/htmlValidator.java @@ -38,6 +38,8 @@ exception statement from your version. */ package gnu.javax.swing.text.html.parser; +import gnu.java.lang.CPStringBuilder; + import gnu.javax.swing.text.html.parser.models.node; import gnu.javax.swing.text.html.parser.models.transformer; @@ -499,11 +501,11 @@ public abstract class htmlValidator dtdAttribute = tag.getElement().getAttribute(foundAttribute.toString()); if (dtdAttribute == null) { - StringBuffer valid = - new StringBuffer("The tag <" + tag.getHTMLTag() + - "> cannot contain the attribute '" + foundAttribute + - "'. The valid attributes for this tag are: " - ); + CPStringBuilder valid = + new CPStringBuilder("The tag <" + tag.getHTMLTag() + + "> cannot contain the attribute '" + foundAttribute + + "'. The valid attributes for this tag are: " + ); AttributeList a = tag.getElement().getAttributes(); @@ -545,22 +547,22 @@ public abstract class htmlValidator !dtdAttribute.values.contains(value.toUpperCase()) ) { - StringBuffer valid; + CPStringBuilder valid; if (dtdAttribute.values.size() == 1) valid = - new StringBuffer("The attribute '" + foundAttribute + - "' of the tag <" + tag.getHTMLTag() + - "> cannot have the value '" + value + - "'. The only valid value is " - ); + new CPStringBuilder("The attribute '" + foundAttribute + + "' of the tag <" + tag.getHTMLTag() + + "> cannot have the value '" + value + + "'. The only valid value is " + ); else valid = - new StringBuffer("The attribute '" + foundAttribute + - "' of the tag <" + tag.getHTMLTag() + - "> cannot have the value '" + value + "'. The " + - dtdAttribute.values.size() + - " valid values are: " - ); + new CPStringBuilder("The attribute '" + foundAttribute + + "' of the tag <" + tag.getHTMLTag() + + "> cannot have the value '" + value + "'. The " + + dtdAttribute.values.size() + + " valid values are: " + ); Enumeration vv = dtdAttribute.values.elements(); while (vv.hasMoreElements()) diff --git a/gnu/javax/swing/text/html/parser/models/list.java b/gnu/javax/swing/text/html/parser/models/list.java index b77ef7fd8..c303ae857 100644 --- a/gnu/javax/swing/text/html/parser/models/list.java +++ b/gnu/javax/swing/text/html/parser/models/list.java @@ -38,6 +38,8 @@ exception statement from your version. */ package gnu.javax.swing.text.html.parser.models; +import gnu.java.lang.CPStringBuilder; + import java.io.Serializable; /** @@ -296,7 +298,7 @@ public class list */ public String toString() { - StringBuffer b = new StringBuffer(); + CPStringBuilder b = new CPStringBuilder(); b.append(" ( "); for (int i = 0; i < nodes.length; i++) { diff --git a/gnu/javax/swing/text/html/parser/models/node.java b/gnu/javax/swing/text/html/parser/models/node.java index 54469b349..f45a13b3e 100644 --- a/gnu/javax/swing/text/html/parser/models/node.java +++ b/gnu/javax/swing/text/html/parser/models/node.java @@ -38,6 +38,8 @@ exception statement from your version. */ package gnu.javax.swing.text.html.parser.models; +import gnu.java.lang.CPStringBuilder; + import java.io.Serializable; /** @@ -239,7 +241,7 @@ public class node */ public String toString() { - StringBuffer b = new StringBuffer(); + CPStringBuilder b = new CPStringBuilder(); b.append(token); if (unary != 0) diff --git a/gnu/javax/swing/text/html/parser/support/Parser.java b/gnu/javax/swing/text/html/parser/support/Parser.java index e99be3238..b087c3c00 100644 --- a/gnu/javax/swing/text/html/parser/support/Parser.java +++ b/gnu/javax/swing/text/html/parser/support/Parser.java @@ -38,6 +38,8 @@ exception statement from your version. */ package gnu.javax.swing.text.html.parser.support; +import gnu.java.lang.CPStringBuilder; + import gnu.javax.swing.text.html.parser.htmlAttributeSet; import gnu.javax.swing.text.html.parser.htmlValidator; import gnu.javax.swing.text.html.parser.support.low.Constants; @@ -132,12 +134,12 @@ public class Parser /** * The buffer to collect the incremental output like text or coment. */ - private StringBuffer buffer = new StringBuffer(); + private final StringBuffer buffer = new StringBuffer(); /** * The buffer to store the document title. */ - private StringBuffer title = new StringBuffer(); + private final StringBuffer title = new StringBuffer(); /** * The current token. @@ -994,7 +996,7 @@ public class Parser // character, not as a token. The character may be part of // the unquoted URL. { - StringBuffer image = new StringBuffer(value.getImage()); + CPStringBuilder image = new CPStringBuilder(value.getImage()); while (next.kind == NUMTOKEN || next.kind == SLASH || next.kind == OTHER) { @@ -1025,7 +1027,7 @@ public class Parser // character, not as a token. The slash may be part of // the unquoted URL. { - StringBuffer image = new StringBuffer(value.getImage()); + CPStringBuilder image = new CPStringBuilder(value.getImage()); while (next.kind == NUMTOKEN || next.kind == SLASH) { image.append(getNextToken().getImage()); |