Reset StringBuilder instead of creating new ones

This avoids unneeded garbage, especially during XML parsing.  Replaced
with:

find -name \*.java | xargs sed -i 's/^\( *[^ ]*\) = new StringBuilder();$/\1.setLength(0);/'
This commit is contained in:
Andrew Gaul 2014-08-05 23:07:30 -07:00
parent 9e9acf1f3e
commit 59462747e7
104 changed files with 105 additions and 105 deletions

View File

@ -39,7 +39,7 @@ public class ErrorHandler extends ParseSax.HandlerWithResult<AtmosError> {
} else if (qName.equals("Message")) { } else if (qName.equals("Message")) {
this.message = currentText.toString().trim(); this.message = currentText.toString().trim();
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -55,7 +55,7 @@ public class ListDirectoryResponseHandler extends ParseSax.HandlerWithResult<Set
} else if (qName.equals("DirectoryEntry")) { } else if (qName.equals("DirectoryEntry")) {
entries.add(new DirectoryEntry(currentObjectId, currentType, currentName)); entries.add(new DirectoryEntry(currentObjectId, currentType, currentName));
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -65,7 +65,7 @@ public class AlarmHistoryItemHandler extends ParseSax.HandlerForGeneratedRequest
timestamp = dateService.iso8601DateParse(currentText.toString().trim()); timestamp = dateService.iso8601DateParse(currentText.toString().trim());
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
@Override @Override

View File

@ -73,7 +73,7 @@ public class DatapointHandler extends ParseSax.HandlerForGeneratedRequestWithRes
} else if (qName.equals("CustomUnit")) { } else if (qName.equals("CustomUnit")) {
customUnit = currentText.toString().trim(); customUnit = currentText.toString().trim();
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
private Double doubleOrNull() { private Double doubleOrNull() {

View File

@ -54,7 +54,7 @@ public class DimensionHandler extends ParseSax.HandlerForGeneratedRequestWithRes
} else if (qName.equals("Value")) { } else if (qName.equals("Value")) {
value = SaxUtils.currentOrNull(currentText); value = SaxUtils.currentOrNull(currentText);
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
/** /**

View File

@ -72,7 +72,7 @@ public class GetMetricStatisticsResponseHandlerV2 extends ParseSax.HandlerWithRe
label = SaxUtils.currentOrNull(currentText); label = SaxUtils.currentOrNull(currentText);
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -72,7 +72,7 @@ public class ListAlarmHistoryResponseHandler
nextToken = SaxUtils.currentOrNull(currentText); nextToken = SaxUtils.currentOrNull(currentText);
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
@Override @Override

View File

@ -68,7 +68,7 @@ public class ListAlarmsForMetricResponseHandler
} }
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
@Override @Override

View File

@ -72,7 +72,7 @@ public class ListAlarmsResponseHandler
nextToken = SaxUtils.currentOrNull(currentText); nextToken = SaxUtils.currentOrNull(currentText);
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
@Override @Override

View File

@ -84,7 +84,7 @@ public class ListMetricsResponseHandler extends ParseSax.HandlerForGeneratedRequ
nextToken = SaxUtils.currentOrNull(currentText); nextToken = SaxUtils.currentOrNull(currentText);
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
/** /**

View File

@ -165,7 +165,7 @@ public class MetricAlarmHandler extends ParseSax.HandlerForGeneratedRequestWithR
unit = Unit.fromValue(SaxUtils.currentOrNull(currentText)); unit = Unit.fromValue(SaxUtils.currentOrNull(currentText));
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
@Override @Override

View File

@ -96,7 +96,7 @@ public class MetricHandler extends ParseSax.HandlerForGeneratedRequestWithResult
namespace = SaxUtils.currentOrNull(currentText); namespace = SaxUtils.currentOrNull(currentText);
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
/** /**

View File

@ -38,7 +38,7 @@ public class AllocateAddressResponseHandler extends HandlerWithResult<String> {
if (qName.equals("publicIp")) { if (qName.equals("publicIp")) {
ipAddress = currentOrNull(); ipAddress = currentOrNull();
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -73,7 +73,7 @@ public class AttachmentHandler extends ParseSax.HandlerForGeneratedRequestWithRe
} else if (qName.equals("attachTime")) { } else if (qName.equals("attachTime")) {
attachTime = dateCodec.toDate(currentText.toString().trim()); attachTime = dateCodec.toDate(currentText.toString().trim());
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -178,7 +178,7 @@ public abstract class BaseReservationHandler<T> extends HandlerForGeneratedReque
this.attachTime = null; this.attachTime = null;
this.deleteOnTermination = true; this.deleteOnTermination = true;
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }

View File

@ -69,7 +69,7 @@ public class BlockDeviceMappingHandler extends
this.attachmentStatus = null; this.attachmentStatus = null;
this.attachTime = null; this.attachTime = null;
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -36,7 +36,7 @@ public class BooleanValueHandler extends ParseSax.HandlerWithResult<Boolean> {
if (qName.equalsIgnoreCase("value")) { if (qName.equalsIgnoreCase("value")) {
this.value = Boolean.parseBoolean(currentText.toString().trim()); this.value = Boolean.parseBoolean(currentText.toString().trim());
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -98,7 +98,7 @@ public class BundleTaskHandler extends ParseSax.HandlerForGeneratedRequestWithRe
} else if (qName.equals("updateTime")) { } else if (qName.equals("updateTime")) {
updateTime = dateCodec.toDate(currentText.toString().trim()); updateTime = dateCodec.toDate(currentText.toString().trim());
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -145,7 +145,7 @@ public class CreateVolumeResponseHandler extends ParseSax.HandlerForGeneratedReq
} }
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
private Volume newVolume() { private Volume newVolume() {

View File

@ -61,7 +61,7 @@ public class DescribeAddressesResponseHandler extends
ipAddress = null; ipAddress = null;
instanceId = null; instanceId = null;
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -90,7 +90,7 @@ public class DescribeAvailabilityZonesResponseHandler extends ParseSax.HandlerWi
this.zoneState = null; this.zoneState = null;
this.messages = Sets.newHashSet(); this.messages = Sets.newHashSet();
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -219,7 +219,7 @@ public class DescribeImagesResponseHandler extends ParseSax.HandlerForGeneratedR
} }
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -74,7 +74,7 @@ public class DescribeKeyPairsResponseHandler extends ParseSax.HandlerForGenerate
} else if (qName.equals("keyName")) { } else if (qName.equals("keyName")) {
builder.keyName(currentOrNull(currentText)); builder.keyName(currentOrNull(currentText));
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -54,7 +54,7 @@ public class DescribeRegionsResponseHandler extends ParseSax.HandlerWithResult<M
this.region = null; this.region = null;
this.regionEndpoint = null; this.regionEndpoint = null;
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -98,7 +98,7 @@ public class DescribeSecurityGroupsResponseHandler extends
} else if (inSecurityGroupInfo) { } else if (inSecurityGroupInfo) {
securityGroupHandler.endElement(uri, name, qName); securityGroupHandler.endElement(uri, name, qName);
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
protected void endItem(String uri, String name, String qName) throws SAXException { protected void endItem(String uri, String name, String qName) throws SAXException {

View File

@ -74,7 +74,7 @@ public class DescribeSubnetsResponseHandler extends
subnetHandler.endElement(uri, name, qName); subnetHandler.endElement(uri, name, qName);
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
@Override @Override

View File

@ -79,7 +79,7 @@ public class DescribeTagsResponseHandler extends ParseSax.HandlerForGeneratedReq
} else if (inTags) { } else if (inTags) {
tagHander.endElement(uri, name, qName); tagHander.endElement(uri, name, qName);
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
/** /**

View File

@ -44,7 +44,7 @@ public class GetConsoleOutputResponseHandler extends ParseSax.HandlerWithResult<
if (qName.equalsIgnoreCase("output")) { if (qName.equalsIgnoreCase("output")) {
this.output = new String(base64().decode(whitespace.matcher(currentText).replaceAll("")), UTF_8); this.output = new String(base64().decode(whitespace.matcher(currentText).replaceAll("")), UTF_8);
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
@Override @Override

View File

@ -48,7 +48,7 @@ public class GetPasswordDataResponseHandler extends ParseSax.HandlerWithResult<P
} else if (qName.equals("passwordData")) { } else if (qName.equals("passwordData")) {
builder.passwordData(currentText.toString().trim()); builder.passwordData(currentText.toString().trim());
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -39,7 +39,7 @@ public class ImageIdHandler extends ParseSax.HandlerWithResult<String> {
if (qName.equalsIgnoreCase("ImageId")) { if (qName.equalsIgnoreCase("ImageId")) {
this.imageId = currentText.toString().trim(); this.imageId = currentText.toString().trim();
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -38,7 +38,7 @@ public class InstanceInitiatedShutdownBehaviorHandler extends
if (qName.equalsIgnoreCase("value")) { if (qName.equalsIgnoreCase("value")) {
this.behavior = InstanceInitiatedShutdownBehavior.fromValue(currentText.toString().trim()); this.behavior = InstanceInitiatedShutdownBehavior.fromValue(currentText.toString().trim());
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -97,7 +97,7 @@ public class InstanceStateChangeHandler extends
this.previousState = null; this.previousState = null;
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -37,7 +37,7 @@ public class InstanceTypeHandler extends
if (qName.equalsIgnoreCase("value")) { if (qName.equalsIgnoreCase("value")) {
this.type = currentText.toString().trim(); this.type = currentText.toString().trim();
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -72,7 +72,7 @@ public class IpPermissionHandler extends ParseSax.HandlerForGeneratedRequestWith
builder.tenantIdGroupNamePair(userId, groupId); builder.tenantIdGroupNamePair(userId, groupId);
userId = groupId = null; userId = groupId = null;
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
private static String currentOrNegative(StringBuilder currentText) { private static String currentOrNegative(StringBuilder currentText) {

View File

@ -69,7 +69,7 @@ public class KeyPairResponseHandler extends ParseSax.HandlerForGeneratedRequestW
} else if (qName.equals("keyName")) { } else if (qName.equals("keyName")) {
builder.keyName(currentOrNull(currentText)); builder.keyName(currentOrNull(currentText));
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -45,7 +45,7 @@ public class PermissionHandler extends ParseSax.HandlerWithResult<Permission> {
} else if (qName.equalsIgnoreCase("userId")) { } else if (qName.equalsIgnoreCase("userId")) {
userIds.add(currentText.toString().trim()); userIds.add(currentText.toString().trim());
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -113,7 +113,7 @@ public class SecurityGroupHandler extends ParseSax.HandlerForGeneratedRequestWit
} else if (equalsOrSuffix(qName, "groupDescription")) { } else if (equalsOrSuffix(qName, "groupDescription")) {
builder.description(currentOrNull(currentText)); builder.description(currentOrNull(currentText));
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
protected void endItem(String uri, String name, String qName) throws SAXException { protected void endItem(String uri, String name, String qName) throws SAXException {

View File

@ -94,7 +94,7 @@ public class SnapshotHandler extends ParseSax.HandlerForGeneratedRequestWithResu
} else if (qName.equals("ownerAlias")) { } else if (qName.equals("ownerAlias")) {
ownerAlias = currentText.toString().trim(); ownerAlias = currentText.toString().trim();
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -37,7 +37,7 @@ public class StringValueHandler extends
if (qName.equalsIgnoreCase("value")) { if (qName.equalsIgnoreCase("value")) {
this.value = currentText.toString().trim(); this.value = currentText.toString().trim();
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -78,7 +78,7 @@ public class SubnetHandler extends ParseSax.HandlerForGeneratedRequestWithResult
} else if (equalsOrSuffix(qName, "availabilityZone")) { } else if (equalsOrSuffix(qName, "availabilityZone")) {
builder.availabilityZone(currentOrNull(currentText)); builder.availabilityZone(currentOrNull(currentText));
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
@Override @Override

View File

@ -62,7 +62,7 @@ public class TagHandler extends ParseSax.HandlerForGeneratedRequestWithResult<Ta
// empty is same as not present // empty is same as not present
builder.value(Strings.emptyToNull(currentOrNull(currentText))); builder.value(Strings.emptyToNull(currentOrNull(currentText)));
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
/** /**

View File

@ -48,7 +48,7 @@ public class TagSetHandler extends ParseSax.HandlerForGeneratedRequestWithResult
key = null; key = null;
value = null; value = null;
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
@Override @Override

View File

@ -50,7 +50,7 @@ public class NovaCreateVolumeResponseHandler extends CreateVolumeResponseHandler
} else { } else {
volumeStatus = Volume.Status.fromValue(statusString); volumeStatus = Volume.Status.fromValue(statusString);
} }
currentText = new StringBuilder(); currentText.setLength(0);
} else { } else {
super.endElement(uri, name, qName); super.endElement(uri, name, qName);
} }

View File

@ -71,7 +71,7 @@ public class ChangeHandler extends ParseSax.HandlerForGeneratedRequestWithResult
} else if (qName.equals("SubmittedAt")) { } else if (qName.equals("SubmittedAt")) {
submittedAt = dateService.iso8601DateParse(currentOrNull(currentText)); submittedAt = dateService.iso8601DateParse(currentOrNull(currentText));
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
@Override @Override

View File

@ -82,7 +82,7 @@ public class GetHostedZoneResponseHandler extends ParseSax.HandlerForGeneratedRe
nameServers.add(currentOrNull(currentText)); nameServers.add(currentOrNull(currentText));
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
@Override @Override

View File

@ -54,7 +54,7 @@ public class HostedZoneHandler extends ParseSax.HandlerForGeneratedRequestWithRe
} else if (qName.equals("ResourceRecordSetCount")) { } else if (qName.equals("ResourceRecordSetCount")) {
builder.resourceRecordSetCount(Integer.parseInt(currentOrNull(currentText))); builder.resourceRecordSetCount(Integer.parseInt(currentOrNull(currentText)));
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
@Override @Override

View File

@ -37,7 +37,7 @@ public class InvalidChangeBatchHandler extends ParseSax.HandlerForGeneratedReque
if (qName.equals("Message")) { if (qName.equals("Message")) {
builder.add(currentOrNull(currentText)); builder.add(currentOrNull(currentText));
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
@Override @Override

View File

@ -82,7 +82,7 @@ public class ListHostedZonesResponseHandler extends
afterMarker = currentOrNull(currentText); afterMarker = currentOrNull(currentText);
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
@Override @Override

View File

@ -82,7 +82,7 @@ public class ListResourceRecordSetsResponseHandler extends
} else if (qName.equals("NextRecordIdentifier")) { } else if (qName.equals("NextRecordIdentifier")) {
builder.nextRecordIdentifier(currentOrNull(currentText)); builder.nextRecordIdentifier(currentOrNull(currentText));
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
@Override @Override

View File

@ -62,7 +62,7 @@ public class ResourceRecordSetHandler extends ParseSax.HandlerForGeneratedReques
} else if (qName.equals("Region")) { } else if (qName.equals("Region")) {
builder.region(currentOrNull(currentText)); builder.region(currentOrNull(currentText));
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
@Override @Override

View File

@ -83,7 +83,7 @@ public class AccessControlListHandler extends ParseSax.HandlerWithResult<AccessC
} else if (qName.equals("Permission")) { } else if (qName.equals("Permission")) {
currentPermission = currentOrNull(currentText); currentPermission = currentOrNull(currentText);
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -86,7 +86,7 @@ public class BucketLoggingHandler extends ParseSax.HandlerWithResult<BucketLoggi
} else if (qName.equals("Permission")) { } else if (qName.equals("Permission")) {
currentPermission = currentOrNull(currentText); currentPermission = currentOrNull(currentText);
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -56,7 +56,7 @@ public class CopyObjectHandler extends ParseSax.HandlerWithResult<ObjectMetadata
} else if (qName.equals("CopyObjectResult")) { } else if (qName.equals("CopyObjectResult")) {
metadata = new CopyObjectResult(currentLastModified, currentETag); metadata = new CopyObjectResult(currentLastModified, currentETag);
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -71,7 +71,7 @@ public class ListAllMyBucketsHandler extends ParseSax.HandlerWithResult<Set<Buck
currentCreationDate = dateParser currentCreationDate = dateParser
.iso8601DateOrSecondsDateParse(currentOrNull(currentText)); .iso8601DateOrSecondsDateParse(currentOrNull(currentText));
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -135,7 +135,7 @@ public class ListBucketHandler extends ParseSax.HandlerWithResult<ListBucketResp
} else if (qName.equals("IsTruncated")) { } else if (qName.equals("IsTruncated")) {
this.isTruncated = Boolean.parseBoolean(currentOrNull(currentText)); this.isTruncated = Boolean.parseBoolean(currentOrNull(currentText));
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -55,7 +55,7 @@ public class AttributesHandler extends ParseSax.HandlerForGeneratedRequestWithRe
builder.put(this.name, currentOrNull(currentText)); builder.put(this.name, currentOrNull(currentText));
this.name = null; this.name = null;
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
@Override @Override

View File

@ -53,7 +53,7 @@ public class BatchErrorHandler extends ParseSax.HandlerForGeneratedRequestWithRe
} else if (qName.equals("Message")) { } else if (qName.equals("Message")) {
builder.message(currentOrNull(currentText)); builder.message(currentOrNull(currentText));
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
@Override @Override

View File

@ -62,7 +62,7 @@ public class MessageHandler extends ParseSax.HandlerForGeneratedRequestWithResul
builder.addAttribute(this.name, currentOrNull(currentText)); builder.addAttribute(this.name, currentOrNull(currentText));
this.name = null; this.name = null;
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
@Override @Override

View File

@ -59,7 +59,7 @@ public class SendMessageBatchResultEntryHandler extends
} else if (qName.equals("MD5OfMessageBody")) { } else if (qName.equals("MD5OfMessageBody")) {
builder.md5(HashCode.fromBytes(base16().lowerCase().decode(currentOrNull(currentText)))); builder.md5(HashCode.fromBytes(base16().lowerCase().decode(currentOrNull(currentText))));
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
@Override @Override

View File

@ -48,7 +48,7 @@ public abstract class TextFromSingleElementHandler<V> extends ParseSax.HandlerFo
if (qName.equals(elementName)) { if (qName.equals(elementName)) {
text = currentOrNull(currentText); text = currentOrNull(currentText);
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
@Override @Override

View File

@ -46,7 +46,7 @@ public class ErrorHandler extends ParseSax.HandlerWithResult<AWSError> {
} else if (!qName.equals("Error")) { } else if (!qName.equals("Error")) {
error.getDetails().put(qName, currentText.toString().trim()); error.getDetails().put(qName, currentText.toString().trim());
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -64,7 +64,7 @@ public class SessionCredentialsHandler extends ParseSax.HandlerForGeneratedReque
builder.expiration(dateService.iso8601DateParse(currentOrNull(currentText))); builder.expiration(dateService.iso8601DateParse(currentOrNull(currentText)));
} }
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
@Override @Override

View File

@ -83,7 +83,7 @@ public class UserAndSessionCredentialsHandler extends ParseSax.HandlerForGenerat
} else if (qName.equals("PackedPolicySize")) { } else if (qName.equals("PackedPolicySize")) {
builder.packedPolicySize(Integer.parseInt(currentOrNull(currentText))); builder.packedPolicySize(Integer.parseInt(currentOrNull(currentText)));
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
@Override @Override

View File

@ -87,7 +87,7 @@ public class CatalogHandler extends ParseSax.HandlerWithResult<Catalog> {
} else if (SaxUtils.equalsOrSuffix(qName, "IsPublished")) { } else if (SaxUtils.equalsOrSuffix(qName, "IsPublished")) {
published = Boolean.parseBoolean(currentOrNull()); published = Boolean.parseBoolean(currentOrNull());
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -64,7 +64,7 @@ public class CatalogItemHandler extends ParseSax.HandlerWithResult<CatalogItem>
properties.put(key, currentOrNull()); properties.put(key, currentOrNull());
key = null; key = null;
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -75,7 +75,7 @@ public class GuestCustomizationSectionHandler extends ParseSax.HandlerWithResult
public void startElement(String uri, String localName, String qName, Attributes attrs) { public void startElement(String uri, String localName, String qName, Attributes attrs) {
Map<String, String> attributes = SaxUtils.cleanseAttributes(attrs); Map<String, String> attributes = SaxUtils.cleanseAttributes(attrs);
this.currentText = new StringBuilder(); this.currentText.setLength(0);
if (qName.endsWith("GuestCustomizationSection")) { if (qName.endsWith("GuestCustomizationSection")) {
guest = newReferenceType(attributes); guest = newReferenceType(attributes);
} else if (qName.endsWith("Link") && "edit".equals(attributes.get("rel"))) { } else if (qName.endsWith("Link") && "edit".equals(attributes.get("rel"))) {
@ -120,7 +120,7 @@ public class GuestCustomizationSectionHandler extends ParseSax.HandlerWithResult
} else if (qName.endsWith("Name")) { } else if (qName.endsWith("Name")) {
this.name = currentOrNull(); this.name = currentOrNull();
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -70,7 +70,7 @@ public class NetworkConnectionHandler extends ParseSax.HandlerWithResult<Network
} else if (qName.endsWith("IpAddressAllocationMode")) { } else if (qName.endsWith("IpAddressAllocationMode")) {
this.ipAddressAllocationMode = IpAddressAllocationMode.valueOf(currentOrNull()); this.ipAddressAllocationMode = IpAddressAllocationMode.valueOf(currentOrNull());
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -82,7 +82,7 @@ public class NetworkConnectionSectionHandler extends ParseSax.HandlerWithResult<
} else if (qName.endsWith("PrimaryNetworkConnectionIndex")) { } else if (qName.endsWith("PrimaryNetworkConnectionIndex")) {
this.primaryNetworkConnectionIndex = Integer.valueOf(currentOrNull()); this.primaryNetworkConnectionIndex = Integer.valueOf(currentOrNull());
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
@Override @Override

View File

@ -95,7 +95,7 @@ public class OrgHandler extends ParseSax.HandlerWithResult<Org> {
} else if (qName.endsWith("FullName")) { } else if (qName.endsWith("FullName")) {
fullName = currentOrNull(); fullName = currentOrNull();
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -308,7 +308,7 @@ public class OrgNetworkHandler extends ParseSax.HandlerWithResult<OrgNetwork> {
} else if (SaxUtils.equalsOrSuffix(qName, "AllowedExternalIpAddress")) { } else if (SaxUtils.equalsOrSuffix(qName, "AllowedExternalIpAddress")) {
allowedExternalIpAddresses.add(currentOrNull()); allowedExternalIpAddresses.add(currentOrNull());
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -43,7 +43,7 @@ public class SupportedVersionsHandler extends ParseSax.HandlerWithResult<SortedM
} else if (SaxUtils.equalsOrSuffix(qName, "VersionInfo")) { } else if (SaxUtils.equalsOrSuffix(qName, "VersionInfo")) {
contents.put(version, location); contents.put(version, location);
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -131,7 +131,7 @@ public class VAppHandler extends ParseSax.HandlerWithResult<VApp> {
} else if (equalsOrSuffix(qName, "ovfDescriptorUploaded")) { } else if (equalsOrSuffix(qName, "ovfDescriptorUploaded")) {
ovfDescriptorUploaded = Boolean.parseBoolean(SaxUtils.currentOrNull(currentText)); ovfDescriptorUploaded = Boolean.parseBoolean(SaxUtils.currentOrNull(currentText));
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -128,7 +128,7 @@ public class VAppTemplateHandler extends ParseSax.HandlerWithResult<VAppTemplate
} else if (equalsOrSuffix(qName, "ovfDescriptorUploaded")) { } else if (equalsOrSuffix(qName, "ovfDescriptorUploaded")) {
ovfDescriptorUploaded = Boolean.parseBoolean(currentOrNull()); ovfDescriptorUploaded = Boolean.parseBoolean(currentOrNull());
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -150,7 +150,7 @@ public class VDCHandler extends ParseSax.HandlerWithResult<VDC> {
} else if (qName.endsWith("IsEnabled")) { } else if (qName.endsWith("IsEnabled")) {
isEnabled = Boolean.parseBoolean(currentOrNull()); isEnabled = Boolean.parseBoolean(currentOrNull());
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -150,7 +150,7 @@ public class VmHandler extends ParseSax.HandlerWithResult<Vm> {
} else if (SaxUtils.equalsOrSuffix(qName, "VAppScopedLocalId")) { } else if (SaxUtils.equalsOrSuffix(qName, "VAppScopedLocalId")) {
vAppScopedLocalId = currentOrNull(); vAppScopedLocalId = currentOrNull();
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -69,7 +69,7 @@ public class VCloudOperatingSystemHandler extends ParseSax.HandlerWithResult<VCl
} else if (qName.endsWith("Description")) { } else if (qName.endsWith("Description")) {
this.description = currentText.toString().trim(); this.description = currentText.toString().trim();
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -44,7 +44,7 @@ public class ErrorHandler extends ParseSax.HandlerWithResult<AzureStorageError>
} else if (!qName.equals("Error")) { } else if (!qName.equals("Error")) {
error.getDetails().put(qName, currentText.toString()); error.getDetails().put(qName, currentText.toString());
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -95,7 +95,7 @@ public class ResourceAllocationSettingDataHandler extends ParseSax.HandlerWithRe
builder.hostResource(current); builder.hostResource(current);
} }
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -97,7 +97,7 @@ public class VirtualSystemSettingDataHandler extends ParseSax.HandlerWithResult<
builder.notes(current); builder.notes(current);
} }
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -61,7 +61,7 @@ public class SectionHandler<T extends Section<T>, B extends Section.Builder<T>>
if (equalsOrSuffix(qName, "Info")) { if (equalsOrSuffix(qName, "Info")) {
builder.info(currentOrNull(currentText)); builder.info(currentOrNull(currentText));
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -54,7 +54,7 @@ public class UriTemplates {
builder.append(value); builder.append(value);
else else
builder.append('{').append(key).append('}'); builder.append('{').append(key).append('}');
var = new StringBuilder(); var.setLength(0);
break; break;
default: default:
if (inVar) if (inVar)

View File

@ -179,7 +179,7 @@ public interface IntegrationTestAsyncClient extends Closeable {
if (qName.equals("bar")) { if (qName.equals("bar")) {
bar = currentText.toString(); bar = currentText.toString();
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
@Override @Override

View File

@ -177,7 +177,7 @@ public interface IntegrationTestClient extends Closeable {
if (qName.equals("bar")) { if (qName.equals("bar")) {
bar = currentText.toString(); bar = currentText.toString();
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
@Override @Override

View File

@ -97,7 +97,7 @@ public class AWSEC2DescribeSecurityGroupsResponseHandler extends
} else if (inSecurityGroupInfo) { } else if (inSecurityGroupInfo) {
securityGroupHandler.endElement(uri, name, qName); securityGroupHandler.endElement(uri, name, qName);
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
protected void endItem(String uri, String name, String qName) throws SAXException { protected void endItem(String uri, String name, String qName) throws SAXException {

View File

@ -72,7 +72,7 @@ public class AWSEC2IpPermissionHandler extends ParseSax.HandlerForGeneratedReque
builder.tenantIdGroupNamePair(userId, groupId); builder.tenantIdGroupNamePair(userId, groupId);
userId = groupId = null; userId = groupId = null;
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
private static String currentOrNegative(StringBuilder currentText) { private static String currentOrNegative(StringBuilder currentText) {

View File

@ -112,7 +112,7 @@ public class AWSEC2SecurityGroupHandler extends HandlerForGeneratedRequestWithRe
} else if (equalsOrSuffix(qName, "groupDescription")) { } else if (equalsOrSuffix(qName, "groupDescription")) {
builder.description(currentOrNull(currentText)); builder.description(currentOrNull(currentText));
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
protected void endItem(String uri, String name, String qName) throws SAXException { protected void endItem(String uri, String name, String qName) throws SAXException {

View File

@ -208,7 +208,7 @@ public abstract class BaseAWSReservationHandler<T> extends HandlerForGeneratedRe
this.attachTime = null; this.attachTime = null;
this.deleteOnTermination = true; this.deleteOnTermination = true;
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
protected void inItem() { protected void inItem() {

View File

@ -31,7 +31,7 @@ public class CreateSecurityGroupResponseHandler extends ParseSax.HandlerWithResu
if (qName.equals("groupId")) { if (qName.equals("groupId")) {
id = currentText.toString().trim(); id = currentText.toString().trim();
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -124,7 +124,7 @@ public class LaunchSpecificationHandler extends HandlerForGeneratedRequestWithRe
if (monitoringEnabled != null) if (monitoringEnabled != null)
builder.monitoringEnabled(Boolean.valueOf(monitoringEnabled)); builder.monitoringEnabled(Boolean.valueOf(monitoringEnabled));
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -45,7 +45,7 @@ public class MonitoringStateHandler extends
this.instanceId = null; this.instanceId = null;
this.state = null; this.state = null;
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -57,7 +57,7 @@ public class PlacementGroupHandler extends
} else if (qName.equals("state")) { } else if (qName.equals("state")) {
state = PlacementGroup.State.fromValue(currentText.toString().trim()); state = PlacementGroup.State.fromValue(currentText.toString().trim());
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -41,7 +41,7 @@ public class ProductCodesHandler extends ParseSax.HandlerWithResult<Set<String>>
if (qName.equalsIgnoreCase("productCode")) { if (qName.equalsIgnoreCase("productCode")) {
productCodes.add(currentText.toString().trim()); productCodes.add(currentText.toString().trim());
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -80,7 +80,7 @@ public class ReservedInstancesOfferingHandler extends
} else if (qName.equalsIgnoreCase("usagePrice")) { } else if (qName.equalsIgnoreCase("usagePrice")) {
this.usagePrice = Float.parseFloat(currentText.toString().trim()); this.usagePrice = Float.parseFloat(currentText.toString().trim());
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -64,7 +64,7 @@ public class SpotHandler extends ParseSax.HandlerForGeneratedRequestWithResult<S
} else if (qName.equals("availabilityZone")) { } else if (qName.equals("availabilityZone")) {
builder.availabilityZone(currentText.toString().trim()); builder.availabilityZone(currentText.toString().trim());
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -132,7 +132,7 @@ public class SpotInstanceHandler extends ParseSax.HandlerForGeneratedRequestWith
} else if (qName.equals("productDescription")) { } else if (qName.equals("productDescription")) {
builder.productDescription(currentOrNull(currentText)); builder.productDescription(currentOrNull(currentText));
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
@Override @Override

View File

@ -60,7 +60,7 @@ public class DeleteResultHandler extends ParseSax.HandlerForGeneratedRequestWith
} }
if (parsingDeletedEntry) { if (parsingDeletedEntry) {
deletedEntryAccumulator = new StringBuilder(); deletedEntryAccumulator.setLength(0);
} else if (parsingErrorEntry) { } else if (parsingErrorEntry) {
errorEntryHandler.startElement(uri, name, qName, attributes); errorEntryHandler.startElement(uri, name, qName, attributes);
} }

View File

@ -47,7 +47,7 @@ public class ErrorEntryHandler extends ParseSax.HandlerForGeneratedRequestWithRe
} else if (equalsOrSuffix(qName, "Message")) { } else if (equalsOrSuffix(qName, "Message")) {
message = accumulator.toString().trim(); message = accumulator.toString().trim();
} }
accumulator = new StringBuilder(); accumulator.setLength(0);
} }
@Override @Override

View File

@ -114,7 +114,7 @@ public class AccountNameEnumerationResultsHandler extends
} else if (qName.equals("Etag")) { } else if (qName.equals("Etag")) {
currentETag = currentText.toString().trim(); currentETag = currentText.toString().trim();
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -90,7 +90,7 @@ public class BlobBlocksResultsHandler extends ParseSax.HandlerWithResult<ListBlo
size = Long.parseLong(currentText.toString().trim()); size = Long.parseLong(currentText.toString().trim());
inSize = false; inSize = false;
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

View File

@ -183,7 +183,7 @@ public class ContainerNameEnumerationResultsHandler extends ParseSax.HandlerWith
currentExpires = contentMetadataCodec.parseExpires(trimmedCurrentText); currentExpires = contentMetadataCodec.parseExpires(trimmedCurrentText);
} }
} }
currentText = new StringBuilder(); currentText.setLength(0);
} }
public void characters(char ch[], int start, int length) { public void characters(char ch[], int start, int length) {

Some files were not shown because too many files have changed in this diff Show More