You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ru...@apache.org on 2002/08/23 23:10:54 UTC
cvs commit: xml-axis/java/src/org/apache/axis/encoding DeserializationContextImpl.java SerializationContextImpl.java
rubys 2002/08/23 14:10:54
Modified: java/src/org/apache/axis/encoding
DeserializationContextImpl.java
SerializationContextImpl.java
Log:
Save the JVM the trouble of counting the number of characters in one
character strings and flushing StringWriters (to where?)
Revision Changes Path
1.52 +3 -3 xml-axis/java/src/org/apache/axis/encoding/DeserializationContextImpl.java
Index: DeserializationContextImpl.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/DeserializationContextImpl.java,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- DeserializationContextImpl.java 23 Aug 2002 18:31:26 -0000 1.51
+++ DeserializationContextImpl.java 23 Aug 2002 21:10:54 -0000 1.52
@@ -539,7 +539,7 @@
public void addObjectById(String id, Object obj)
{
// The resolver uses the href syntax as the key.
- String idStr = "#" + id;
+ String idStr = '#' + id;
if ((idMap == null) || (id == null))
return ;
@@ -596,7 +596,7 @@
if (localIDs == null)
localIDs = new LocalIDResolver();
- String absID = "#" + id;
+ String absID = '#' + id;
localIDs.addReferencedObject(absID, elem);
@@ -868,7 +868,7 @@
SOAPHandler nextHandler = null;
String prefix = "";
- int idx = qName.indexOf(":");
+ int idx = qName.indexOf(':');
if (idx > 0)
prefix = qName.substring(0, idx);
1.60 +14 -18 xml-axis/java/src/org/apache/axis/encoding/SerializationContextImpl.java
Index: SerializationContextImpl.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/SerializationContextImpl.java,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -r1.59 -r1.60
--- SerializationContextImpl.java 20 Aug 2002 19:41:24 -0000 1.59
+++ SerializationContextImpl.java 23 Aug 2002 21:10:54 -0000 1.60
@@ -733,7 +733,7 @@
if (attributes != null && 0 < attributes.getLength())
attrs.setAttributes(attributes);
attrs.addAttribute("", Constants.ATTR_HREF, "href",
- "CDATA", "#" + id);
+ "CDATA", '#' + id);
startElement(elemQName, attrs);
endElement();
@@ -795,7 +795,7 @@
encodingStyle = soapConstants.getEncodingURI();
}
String encStyle = getPrefixForURI(soapConstants.getEnvelopeURI()) +
- ":" + Constants.ATTR_ENCODING_STYLE;
+ ':' + Constants.ATTR_ENCODING_STYLE;
attrs.addAttribute(soapConstants.getEnvelopeURI(),
Constants.ATTR_ENCODING_STYLE,
encStyle,
@@ -857,21 +857,21 @@
}
if (writingStartTag) {
- writer.write(">");
- if (pretty) writer.write("\n");
+ writer.write('>');
+ if (pretty) writer.write('\n');
indent++;
}
if (pretty) for (int i=0; i<indent; i++) writer.write(' ');
String elementQName = qName2String(qName, true);
- writer.write("<");
+ writer.write('<');
writer.write(elementQName);
if (attributes != null) {
for (int i = 0; i < attributes.getLength(); i++) {
String qname = attributes.getQName(i);
- writer.write(" ");
+ writer.write(' ');
String prefix = "";
String uri = attributes.getURI(i);
@@ -889,7 +889,7 @@
}
}
if (prefix.length() > 0) {
- qname = prefix + ":" + attributes.getLocalName(i);
+ qname = prefix + ':' + attributes.getLocalName(i);
} else {
qname = attributes.getLocalName(i);
}
@@ -906,21 +906,21 @@
writer.write(qname);
writer.write("=\"");
writer.write(XMLUtils.xmlEncodeString(attributes.getValue(i)));
- writer.write("\"");
+ writer.write('"');
}
}
for (Mapping map=nsStack.topOfFrame(); map!=null; map=nsStack.next()) {
StringBuffer sb = new StringBuffer("xmlns");
if (map.getPrefix().length() > 0) {
- sb.append(":");
+ sb.append(':');
sb.append(map.getPrefix());
}
if ((vecQNames==null) || (vecQNames.indexOf(sb.toString())==-1)) {
- writer.write(" ");
+ writer.write(' ');
sb.append("=\"");
sb.append(map.getNamespaceURI());
- sb.append("\"");
+ sb.append('"');
writer.write(sb.toString());
}
}
@@ -930,7 +930,6 @@
elementStack.push(elementQName);
nsStack.push();
- writer.flush();
onlyXML=true;
}
@@ -951,7 +950,7 @@
if (writingStartTag) {
writer.write("/>");
- if (pretty) writer.write("\n");
+ if (pretty) writer.write('\n');
writingStartTag = false;
return;
}
@@ -964,7 +963,6 @@
writer.write(elementQName);
writer.write('>');
if (pretty) if (indent>0) writer.write('\n');
- writer.flush();
onlyXML=true;
}
@@ -979,11 +977,10 @@
throws IOException
{
if (writingStartTag) {
- writer.write(">");
+ writer.write('>');
writingStartTag = false;
}
writeSafeString(String.valueOf(p1,p2,p3));
- writer.flush();
onlyXML=false;
}
@@ -995,11 +992,10 @@
throws IOException
{
if (writingStartTag) {
- writer.write(">");
+ writer.write('>');
writingStartTag = false;
}
writer.write(string);
- writer.flush();
onlyXML=false;
}