You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mr...@apache.org on 2005/10/24 05:23:01 UTC
svn commit: r327940 - in /xerces/java/trunk/src/org/apache/xerces: impl/
impl/dtd/ impl/dtd/models/ impl/xs/ impl/xs/models/ jaxp/datatype/ util/ xni/
Author: mrglavas
Date: Sun Oct 23 20:22:51 2005
New Revision: 327940
URL: http://svn.apache.org/viewcvs?rev=327940&view=rev
Log:
JIRA Issue #1107:
http://issues.apache.org/jira/browse/XERCESJ-1107
Improving usage of StringBuffers throughout the code. Patch thanks to Dave Brosius.
Modified:
xerces/java/trunk/src/org/apache/xerces/impl/XMLEntityManager.java
xerces/java/trunk/src/org/apache/xerces/impl/dtd/DTDGrammar.java
xerces/java/trunk/src/org/apache/xerces/impl/dtd/models/CMAny.java
xerces/java/trunk/src/org/apache/xerces/impl/dtd/models/CMLeaf.java
xerces/java/trunk/src/org/apache/xerces/impl/dtd/models/CMStateSet.java
xerces/java/trunk/src/org/apache/xerces/impl/xs/XSComplexTypeDecl.java
xerces/java/trunk/src/org/apache/xerces/impl/xs/XSParticleDecl.java
xerces/java/trunk/src/org/apache/xerces/impl/xs/models/XSCMLeaf.java
xerces/java/trunk/src/org/apache/xerces/jaxp/datatype/DurationImpl.java
xerces/java/trunk/src/org/apache/xerces/util/AugmentationsImpl.java
xerces/java/trunk/src/org/apache/xerces/xni/QName.java
Modified: xerces/java/trunk/src/org/apache/xerces/impl/XMLEntityManager.java
URL: http://svn.apache.org/viewcvs/xerces/java/trunk/src/org/apache/xerces/impl/XMLEntityManager.java?rev=327940&r1=327939&r2=327940&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/XMLEntityManager.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/XMLEntityManager.java Sun Oct 23 20:22:51 2005
@@ -990,7 +990,6 @@
isBigEndian = (Boolean)(encodingDesc[1]);
stream.reset();
- int offset = 0;
// Special case UTF-8 files with BOM created by Microsoft
// tools. It's more efficient to consume the BOM than make
// the reader perform extra checks. -Ac
@@ -2682,13 +2681,13 @@
public String toString() {
StringBuffer str = new StringBuffer();
- str.append("name=\""+name+'"');
+ str.append("name=\"").append(name).append('"');
str.append(",ch=");
str.append(ch);
- str.append(",position=" + position);
- str.append(",count=" + count);
- str.append(",baseCharOffset=" + baseCharOffset);
- str.append(",startPosition=" + startPosition);
+ str.append(",position=").append(position);
+ str.append(",count=").append(count);
+ str.append(",baseCharOffset=").append(baseCharOffset);
+ str.append(",startPosition=").append(startPosition);
return str.toString();
} // toString():String
Modified: xerces/java/trunk/src/org/apache/xerces/impl/dtd/DTDGrammar.java
URL: http://svn.apache.org/viewcvs/xerces/java/trunk/src/org/apache/xerces/impl/dtd/DTDGrammar.java?rev=327940&r1=327939&r2=327940&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/dtd/DTDGrammar.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/dtd/DTDGrammar.java Sun Oct 23 20:22:51 2005
@@ -1505,7 +1505,7 @@
str.append("#PCDATA");
}
else if (contentSpec.otherValue != null) {
- str.append("##any:uri="+contentSpec.otherValue);
+ str.append("##any:uri=").append(contentSpec.otherValue);
}
else if (contentSpec.value == null) {
str.append("##any");
@@ -1539,7 +1539,7 @@
str.append("#PCDATA");
}
else if (contentSpec.otherValue != null) {
- str.append("##any:uri="+contentSpec.otherValue);
+ str.append("##any:uri=").append(contentSpec.otherValue);
}
else if (contentSpec.value == null) {
str.append("##any");
@@ -2022,7 +2022,7 @@
str.append("#PCDATA");
}
else if (contentSpec.value == null && contentSpec.otherValue != null) {
- str.append("##any:uri="+contentSpec.otherValue);
+ str.append("##any:uri=").append(contentSpec.otherValue);
}
else if (contentSpec.value == null) {
str.append("##any");
Modified: xerces/java/trunk/src/org/apache/xerces/impl/dtd/models/CMAny.java
URL: http://svn.apache.org/viewcvs/xerces/java/trunk/src/org/apache/xerces/impl/dtd/models/CMAny.java?rev=327940&r1=327939&r2=327940&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/dtd/models/CMAny.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/dtd/models/CMAny.java Sun Oct 23 20:22:51 2005
@@ -105,18 +105,14 @@
public String toString()
{
StringBuffer strRet = new StringBuffer();
- strRet.append("(");
+ strRet.append('(');
strRet.append("##any:uri=");
strRet.append(fURI);
strRet.append(')');
- if (fPosition >= 0)
- {
- strRet.append
- (
- " (Pos:"
- + Integer.toString(fPosition)
- + ")"
- );
+ if (fPosition >= 0) {
+ strRet.append(" (Pos:")
+ .append(Integer.toString(fPosition))
+ .append(')');
}
return strRet.toString();
}
Modified: xerces/java/trunk/src/org/apache/xerces/impl/dtd/models/CMLeaf.java
URL: http://svn.apache.org/viewcvs/xerces/java/trunk/src/org/apache/xerces/impl/dtd/models/CMLeaf.java?rev=327940&r1=327939&r2=327940&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/dtd/models/CMLeaf.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/dtd/models/CMLeaf.java Sun Oct 23 20:22:51 2005
@@ -103,14 +103,10 @@
strRet.append(',');
strRet.append(fElement.localpart);
strRet.append(')');
- if (fPosition >= 0)
- {
- strRet.append
- (
- " (Pos:"
- + Integer.toString(fPosition)
- + ")"
- );
+ if (fPosition >= 0) {
+ strRet.append(" (Pos:")
+ .append(Integer.toString(fPosition))
+ .append(')');
}
return strRet.toString();
}
Modified: xerces/java/trunk/src/org/apache/xerces/impl/dtd/models/CMStateSet.java
URL: http://svn.apache.org/viewcvs/xerces/java/trunk/src/org/apache/xerces/impl/dtd/models/CMStateSet.java?rev=327940&r1=327939&r2=327940&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/dtd/models/CMStateSet.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/dtd/models/CMStateSet.java Sun Oct 23 20:22:51 2005
@@ -1,5 +1,5 @@
/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
+ * Copyright 1999-2002,2004,2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -74,11 +74,11 @@
StringBuffer strRet = new StringBuffer();
try
{
- strRet.append("{");
- for (int index = 0; index < fBitCount; index++)
- {
- if (getBit(index))
- strRet.append(" " + index);
+ strRet.append('{');
+ for (int index = 0; index < fBitCount; index++) {
+ if (getBit(index)) {
+ strRet.append(' ').append(index);
+ }
}
strRet.append(" }");
}
Modified: xerces/java/trunk/src/org/apache/xerces/impl/xs/XSComplexTypeDecl.java
URL: http://svn.apache.org/viewcvs/xerces/java/trunk/src/org/apache/xerces/impl/xs/XSComplexTypeDecl.java?rev=327940&r1=327939&r2=327940&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/xs/XSComplexTypeDecl.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/xs/XSComplexTypeDecl.java Sun Oct 23 20:22:51 2005
@@ -172,18 +172,19 @@
String contentType[] = {"EMPTY", "SIMPLE", "ELEMENT", "MIXED"};
String derivedBy[] = {"EMPTY", "EXTENSION", "RESTRICTION"};
- str.append("Complex type name='" + fTargetNamespace + "," + getTypeName() + "', ");
- if (fBaseType != null)
- str.append(" base type name='" + fBaseType.getName() + "', ");
-
- str.append(" content type='" + contentType[fContentType] + "', ");
- str.append(" isAbstract='" + getAbstract() + "', ");
- str.append(" hasTypeId='" + containsTypeID() + "', ");
- str.append(" final='" + fFinal + "', ");
- str.append(" block='" + fBlock + "', ");
- if (fParticle != null)
- str.append(" particle='" + fParticle.toString() + "', ");
- str.append(" derivedBy='" + derivedBy[fDerivedBy] + "'. ");
+ str.append("Complex type name='").append(fTargetNamespace).append(",").append(getTypeName()).append("', ");
+ if (fBaseType != null) {
+ str.append(" base type name='").append(fBaseType.getName()).append("', ");
+ }
+ str.append(" content type='").append(contentType[fContentType]).append("', ");
+ str.append(" isAbstract='").append(getAbstract()).append("', ");
+ str.append(" hasTypeId='").append(containsTypeID()).append("', ");
+ str.append(" final='").append(fFinal).append("', ");
+ str.append(" block='").append(fBlock).append("', ");
+ if (fParticle != null) {
+ str.append(" particle='").append(fParticle.toString()).append("', ");
+ }
+ str.append(" derivedBy='").append(derivedBy[fDerivedBy]).append("'. ");
}
Modified: xerces/java/trunk/src/org/apache/xerces/impl/xs/XSParticleDecl.java
URL: http://svn.apache.org/viewcvs/xerces/java/trunk/src/org/apache/xerces/impl/xs/XSParticleDecl.java?rev=327940&r1=327939&r2=327940&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/xs/XSParticleDecl.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/xs/XSParticleDecl.java Sun Oct 23 20:22:51 2005
@@ -1,5 +1,5 @@
/*
- * Copyright 2001, 2002,2004 The Apache Software Foundation.
+ * Copyright 2001,2002,2004,2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -126,11 +126,11 @@
appendParticle(buffer);
if (!(fMinOccurs == 0 && fMaxOccurs == 0 ||
fMinOccurs == 1 && fMaxOccurs == 1)) {
- buffer.append("{" + fMinOccurs);
+ buffer.append("{").append(fMinOccurs);
if (fMaxOccurs == SchemaSymbols.OCCURRENCE_UNBOUNDED)
buffer.append("-UNBOUNDED");
else if (fMinOccurs != fMaxOccurs)
- buffer.append("-" + fMaxOccurs);
+ buffer.append("-").append(fMaxOccurs);
buffer.append("}");
}
fDescription = buffer.toString();
Modified: xerces/java/trunk/src/org/apache/xerces/impl/xs/models/XSCMLeaf.java
URL: http://svn.apache.org/viewcvs/xerces/java/trunk/src/org/apache/xerces/impl/xs/models/XSCMLeaf.java?rev=327940&r1=327939&r2=327940&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/xs/models/XSCMLeaf.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/xs/models/XSCMLeaf.java Sun Oct 23 20:22:51 2005
@@ -1,5 +1,5 @@
/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
+ * Copyright 1999-2002,2004,2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -97,12 +97,9 @@
public String toString() {
StringBuffer strRet = new StringBuffer(fLeaf.toString());
if (fPosition >= 0) {
- strRet.append
- (
- " (Pos:"
- + Integer.toString(fPosition)
- + ")"
- );
+ strRet.append(" (Pos:")
+ .append(Integer.toString(fPosition))
+ .append(')');
}
return strRet.toString();
}
Modified: xerces/java/trunk/src/org/apache/xerces/jaxp/datatype/DurationImpl.java
URL: http://svn.apache.org/viewcvs/xerces/java/trunk/src/org/apache/xerces/jaxp/datatype/DurationImpl.java?rev=327940&r1=327939&r2=327940&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/jaxp/datatype/DurationImpl.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/jaxp/datatype/DurationImpl.java Sun Oct 23 20:22:51 2005
@@ -985,25 +985,25 @@
buf.append('P');
if (years != null) {
- buf.append(years + "Y");
+ buf.append(years).append('Y');
}
if (months != null) {
- buf.append(months + "M");
+ buf.append(months).append('M');
}
if (days != null) {
- buf.append(days + "D");
+ buf.append(days).append('D');
}
if (hours != null || minutes != null || seconds != null) {
buf.append('T');
if (hours != null) {
- buf.append(hours + "H");
+ buf.append(hours).append('H');
}
if (minutes != null) {
- buf.append(minutes + "M");
+ buf.append(minutes).append('M');
}
if (seconds != null) {
- buf.append(toString(seconds) + "S");
+ buf.append(toString(seconds)).append('S');
}
}
Modified: xerces/java/trunk/src/org/apache/xerces/util/AugmentationsImpl.java
URL: http://svn.apache.org/viewcvs/xerces/java/trunk/src/org/apache/xerces/util/AugmentationsImpl.java?rev=327940&r1=327939&r2=327940&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/util/AugmentationsImpl.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/util/AugmentationsImpl.java Sun Oct 23 20:22:51 2005
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2002,2004 The Apache Software Foundation.
+ * Copyright 2000-2002,2004,2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,7 +32,7 @@
* @author Elena Litani, IBM
* @version $Id$
*/
-public class AugmentationsImpl implements Augmentations{
+public class AugmentationsImpl implements Augmentations {
private AugmentationsItemsContainer fAugmentationsContainer =
new SmallContainer();
@@ -192,7 +192,7 @@
public String toString() {
StringBuffer buff = new StringBuffer();
- buff.append("SmallContainer - fNumEntries == " + fNumEntries);
+ buff.append("SmallContainer - fNumEntries == ").append(fNumEntries);
for (int i = 0; i < SIZE_LIMIT*2; i=i+2) {
buff.append("\nfAugmentations[");
Modified: xerces/java/trunk/src/org/apache/xerces/xni/QName.java
URL: http://svn.apache.org/viewcvs/xerces/java/trunk/src/org/apache/xerces/xni/QName.java?rev=327940&r1=327939&r2=327940&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/xni/QName.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/xni/QName.java Sun Oct 23 20:22:51 2005
@@ -163,28 +163,28 @@
StringBuffer str = new StringBuffer();
boolean comma = false;
if (prefix != null) {
- str.append("prefix=\""+prefix+'"');
+ str.append("prefix=\"").append(prefix).append('"');
comma = true;
}
if (localpart != null) {
if (comma) {
str.append(',');
}
- str.append("localpart=\""+localpart+'"');
+ str.append("localpart=\"").append(localpart).append('"');
comma = true;
}
if (rawname != null) {
if (comma) {
str.append(',');
}
- str.append("rawname=\""+rawname+'"');
+ str.append("rawname=\"").append(rawname).append('"');
comma = true;
}
if (uri != null) {
if (comma) {
str.append(',');
}
- str.append("uri=\""+uri+'"');
+ str.append("uri=\"").append(uri).append('"');
}
return str.toString();
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org