Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ protected String getValueAsString() {
if (itemList.size() == 0) {
return "";
}
StringBuffer sb = new StringBuffer( itemList.size() * 8 );
StringBuilder sb = new StringBuilder( itemList.size() * 8 );
Iterator i = itemList.iterator();
if (i.hasNext()) {
sb.append(((SVGItem) i.next()).getValueAsString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ protected String getValueAsString() {
if (itemList.size() == 0) {
return "";
}
StringBuffer sb = new StringBuffer( itemList.size() * 8 );
StringBuilder sb = new StringBuilder( itemList.size() * 8 );
Iterator i = itemList.iterator();
if (i.hasNext()) {
sb.append(((SVGItem) i.next()).getValueAsString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ protected String getValueAsString() {
if (itemList.size() == 0) {
return "";
}
StringBuffer sb = new StringBuffer( itemList.size() * 8 );
StringBuilder sb = new StringBuilder( itemList.size() * 8 );
Iterator i = itemList.iterator();
if (i.hasNext()) {
sb.append(((SVGItem) i.next()).getValueAsString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ protected String getValueAsString() {
if (itemList.size() == 0) {
return "";
}
StringBuffer sb = new StringBuffer( itemList.size() * 8 );
StringBuilder sb = new StringBuilder( itemList.size() * 8 );
Iterator i = itemList.iterator();
if (i.hasNext()) {
sb.append(((SVGItem) i.next()).getValueAsString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ protected String getValueAsString() {
if (itemList.size() == 0) {
return "";
}
StringBuffer sb = new StringBuffer( itemList.size() * 8 );
StringBuilder sb = new StringBuilder( itemList.size() * 8 );
Iterator i = itemList.iterator();
if (i.hasNext()) {
sb.append(((SVGItem) i.next()).getValueAsString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public String formatMessage(String key, Object[] args)
* <b>DOM</b>: Implements {@link SVGDocument#getTitle()}.
*/
public String getTitle() {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
boolean preserve = false;

for (Node n = getDocumentElement().getFirstChild();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public StyleSheet getCSSStyleSheet() {
String text = "";
Node n = getFirstChild();
if (n != null) {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
while (n != null) {
if (n.getNodeType() == Node.CDATA_SECTION_NODE
|| n.getNodeType() == Node.TEXT_NODE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public AnimatableValue getZeroValue() {
* Length lists can never be used for CSS properties.
*/
public String getCssText() {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
if (lengthValues.length > 0) {
sb.append(formatNumber(lengthValues[0]));
sb.append(AnimatableLengthValue.UNITS[lengthTypes[0] - 1]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public AnimatableValue getZeroValue() {
* Returns a string representation of this object.
*/
public String toStringRep() {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append(formatNumber(x));
sb.append(',');
sb.append(formatNumber(y));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public AnimatableValue getZeroValue() {
* Returns the CSS text representation of the value.
*/
public String getCssText() {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append(numbers[0]);
for (int i = 1; i < numbers.length; i++) {
sb.append(' ');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public AnimatableValue getZeroValue() {
* Returns the CSS text representation of the value.
*/
public String getCssText() {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append(formatNumber(number));
if (hasOptionalNumber) {
sb.append(' ');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public AnimatableValue getZeroValue() {
* Returns the CSS text representation of the value.
*/
public String getCssText() {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append(formatNumber(value));
if (isPercentage) {
sb.append('%');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public AnimatableValue getZeroValue() {
* Returns a string representation of this object.
*/
public String toStringRep() {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
int k = 0;
for (short command : commands) {
sb.append(PATH_COMMANDS[command]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public AnimatableValue getZeroValue() {
* Returns a string representation of this object.
*/
public String toStringRep() {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
sb.append(x);
sb.append(',');
sb.append(y);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ public AnimatableValue getZeroValue() {
* Returns the CSS text representation of the value.
*/
public String toStringRep() {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
Iterator i = transforms.iterator();
while (i.hasNext()) {
AbstractSVGTransform t = (AbstractSVGTransform) i.next();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ private void normalize( int splitChannel, int[] counts ){
// if ( flagChangedLo || flagChangedHi ){
// System.out.println("old min:" + min[ splitChannel ] + "/max:" + max[ splitChannel ]
// + " new: " + loBound + "/" + hiBound );
// StringBuffer buff = new StringBuffer( 100 );
// StringBuilder buff = new StringBuilder( 100 );
// for( int i= min[ splitChannel ]; i <= max[ splitChannel]; i++ ){
// buff.append( counts[ i ] );
// buff.append( ',' );
Expand Down Expand Up @@ -592,7 +592,7 @@ static byte[][] computeRGB( int nCubes, Cube[] cubes ){
*/
static void logRGB( byte[] r, byte[] g, byte[] b ){

StringBuffer buff = new StringBuffer( 100 );
StringBuilder buff = new StringBuilder( 100 );
int nColors = r.length;
for( int i= 0; i < nColors; i++ ) {
String rgbStr= "(" + (r[i]+128) + ',' + (g[i] +128 ) + ',' + (b[i] + 128) + ")," ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void insertString(int offs, String str, AttributeSet a)
// Now, test that new value is within range.
String added = new String(digit, 0, j);
try{
StringBuffer val = new StringBuffer(curVal);
StringBuilder val = new StringBuilder(curVal);
val.insert(offs, added);
String valStr = val.toString();
if( valStr.equals(".") || valStr.equals("-") || valStr.equals("-."))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ protected void loadScript(AbstractElement script) {
// Inline script.
Node n = script.getFirstChild();
if (n != null) {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
while (n != null) {
if (n.getNodeType() == Node.CDATA_SECTION_NODE
|| n.getNodeType() == Node.TEXT_NODE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public Object run(Context cx) {
if (ii == null) ii = ImportInfo.getImports();

// import Java lang package & DOM Level 3 & SVG DOM packages
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
Iterator iter;
iter = ii.getPackages();
while (iter.hasNext()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public SVGGVTFont createFont(BridgeContext ctx,
if (glyphCodes[i].length() > 1) {
// ligature, may need to reverse if arabic so that it is in visual order
if (ArabicTextHandler.arabicChar(glyphCodes[i].charAt(0))) {
glyphCodes[i] = (new StringBuffer(glyphCodes[i])).reverse().toString();
glyphCodes[i] = (new StringBuilder(glyphCodes[i])).reverse().toString();
}
}
glyphNames[i] = glyphElement.getAttributeNS(null, SVG_GLYPH_NAME_ATTRIBUTE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ public GVTGlyphVector createGlyphVector(FontRenderContext frc,
CharacterIterator ci) {
// construct a string from the glyphCodes
int nGlyphs = glyphCodes.length;
StringBuffer workBuff = new StringBuffer( nGlyphs );
StringBuilder workBuff = new StringBuilder( nGlyphs );
for (int glyphCode : glyphCodes) {
workBuff.append(glyphUnicodes[glyphCode]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -846,8 +846,8 @@ int getElementEndIndex(Element element) {
protected AttributedString buildAttributedString(BridgeContext ctx,
Element element) {

AttributedStringBuffer asb = new AttributedStringBuffer();
fillAttributedStringBuffer(ctx, element, true, null, null, null, asb);
AttributedStringBuilder asb = new AttributedStringBuilder();
fillAttributedStringBuilder(ctx, element, true, null, null, null, asb);
return asb.toAttributedString();
}

Expand All @@ -861,15 +861,15 @@ protected AttributedString buildAttributedString(BridgeContext ctx,
protected int endLimit;

/**
* Fills the given AttributedStringBuffer.
* Fills the given AttributedStringBuilder.
*/
protected void fillAttributedStringBuffer(BridgeContext ctx,
protected void fillAttributedStringBuilder(BridgeContext ctx,
Element element,
boolean top,
TextPath textPath,
Integer bidiLevel,
Map initialAttributes,
AttributedStringBuffer asb) {
AttributedStringBuilder asb) {
// 'requiredFeatures', 'requiredExtensions', 'systemLanguage' &
// 'display="none".
if ((!SVGUtilities.matchUserAgent(element, ctx.getUserAgent())) ||
Expand Down Expand Up @@ -927,7 +927,7 @@ protected void fillAttributedStringBuffer(BridgeContext ctx,
if (ln.equals(SVG_TSPAN_TAG) ||
ln.equals(SVG_ALT_GLYPH_TAG)) {
int before = asb.count;
fillAttributedStringBuffer(ctx,
fillAttributedStringBuilder(ctx,
nodeElement,
false,
textPath,
Expand All @@ -944,7 +944,7 @@ protected void fillAttributedStringBuffer(BridgeContext ctx,
= textPathBridge.createTextPath(ctx, nodeElement);
if (newTextPath != null) {
int before = asb.count;
fillAttributedStringBuffer(ctx,
fillAttributedStringBuilder(ctx,
nodeElement,
false,
newTextPath,
Expand Down Expand Up @@ -991,7 +991,7 @@ protected void fillAttributedStringBuffer(BridgeContext ctx,
SVG_EVENT_CLICK, l, false);

int before = asb.count;
fillAttributedStringBuffer(ctx,
fillAttributedStringBuilder(ctx,
nodeElement,
false,
textPath,
Expand Down Expand Up @@ -1046,7 +1046,7 @@ protected void fillAttributedStringBuffer(BridgeContext ctx,
protected String normalizeString(String s,
boolean preserve,
boolean stripfirst) {
StringBuffer sb = new StringBuffer(s.length());
StringBuilder sb = new StringBuilder(s.length());
if (preserve) {
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
Expand Down Expand Up @@ -1104,7 +1104,7 @@ protected String normalizeString(String s,
/**
* This class is used to build an AttributedString.
*/
protected static class AttributedStringBuffer {
protected static class AttributedStringBuilder {

/**
* The strings.
Expand All @@ -1127,17 +1127,17 @@ protected static class AttributedStringBuffer {
protected int length;

/**
* Creates a new empty AttributedStringBuffer.
* Creates a new empty AttributedStringBuilder.
*/
public AttributedStringBuffer() {
public AttributedStringBuilder() {
strings = new ArrayList();
attributes = new ArrayList();
count = 0;
length = 0;
}

/**
* Tells whether this AttributedStringBuffer is empty.
* Tells whether this AttributedStringBuilder is empty.
*/
public boolean isEmpty() {
return count == 0;
Expand Down Expand Up @@ -1224,7 +1224,7 @@ public AttributedString toAttributedString() {
(Map)attributes.get(0));
}

StringBuffer sb = new StringBuffer( strings.size() * 5 );
StringBuilder sb = new StringBuilder( strings.size() * 5 );
for (Object string : strings) {
sb.append((String) string);
}
Expand Down Expand Up @@ -1261,7 +1261,7 @@ public String toString() {
return (String)strings.get(0);
}

StringBuffer sb = new StringBuffer( strings.size() * 5 );
StringBuilder sb = new StringBuilder( strings.size() * 5 );
for (Object string : strings) {
sb.append((String) string);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,7 @@ public void run() {
}
}
r = new BufferedReader(r);
final StringBuffer sb = new StringBuffer();
final StringBuilder sb = new StringBuilder();
int read;
char[] buf = new char[4096];
while ((read = r.read(buf, 0, buf.length)) != -1) {
Expand Down Expand Up @@ -1224,7 +1224,7 @@ public void run() {
r = new InputStreamReader(is, e);
r = new BufferedReader(r);

final StringBuffer sb = new StringBuffer();
final StringBuilder sb = new StringBuilder();
int read;
char[] buf = new char[4096];
while ((read = r.read(buf, 0, buf.length)) != -1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public String getText() {
if (aci == null) {
text = "";
} else {
StringBuffer buf = new StringBuffer(aci.getEndIndex());
StringBuilder buf = new StringBuilder(aci.getEndIndex());
for (char c = aci.first();
c != CharacterIterator.DONE;
c = aci.next()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public abstract class TextUtilities implements CSSConstants, ErrorConstants {
* Returns the content of the given element.
*/
public static String getElementContent(Element e) {
StringBuffer result = new StringBuffer();
StringBuilder result = new StringBuilder();
for (Node n = e.getFirstChild();
n != null;
n = n.getNextSibling()) {
Expand Down
Loading