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")) {
this.message = currentText.toString().trim();
}
currentText = new StringBuilder();
currentText.setLength(0);
}
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")) {
entries.add(new DirectoryEntry(currentObjectId, currentType, currentName));
}
currentText = new StringBuilder();
currentText.setLength(0);
}
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());
}
currentText = new StringBuilder();
currentText.setLength(0);
}
@Override

View File

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

View File

@ -54,7 +54,7 @@ public class DimensionHandler extends ParseSax.HandlerForGeneratedRequestWithRes
} else if (qName.equals("Value")) {
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);
}
currentText = new StringBuilder();
currentText.setLength(0);
}
public void characters(char ch[], int start, int length) {

View File

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

View File

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

View File

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

View File

@ -84,7 +84,7 @@ public class ListMetricsResponseHandler extends ParseSax.HandlerForGeneratedRequ
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));
}
currentText = new StringBuilder();
currentText.setLength(0);
}
@Override

View File

@ -96,7 +96,7 @@ public class MetricHandler extends ParseSax.HandlerForGeneratedRequestWithResult
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")) {
ipAddress = currentOrNull();
}
currentText = new StringBuilder();
currentText.setLength(0);
}
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")) {
attachTime = dateCodec.toDate(currentText.toString().trim());
}
currentText = new StringBuilder();
currentText.setLength(0);
}
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.deleteOnTermination = true;
}
currentText = new StringBuilder();
currentText.setLength(0);
}

View File

@ -69,7 +69,7 @@ public class BlockDeviceMappingHandler extends
this.attachmentStatus = null;
this.attachTime = null;
}
currentText = new StringBuilder();
currentText.setLength(0);
}
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")) {
this.value = Boolean.parseBoolean(currentText.toString().trim());
}
currentText = new StringBuilder();
currentText.setLength(0);
}
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")) {
updateTime = dateCodec.toDate(currentText.toString().trim());
}
currentText = new StringBuilder();
currentText.setLength(0);
}
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() {

View File

@ -61,7 +61,7 @@ public class DescribeAddressesResponseHandler extends
ipAddress = null;
instanceId = null;
}
currentText = new StringBuilder();
currentText.setLength(0);
}
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.messages = Sets.newHashSet();
}
currentText = new StringBuilder();
currentText.setLength(0);
}
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) {

View File

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

View File

@ -98,7 +98,7 @@ public class DescribeSecurityGroupsResponseHandler extends
} else if (inSecurityGroupInfo) {
securityGroupHandler.endElement(uri, name, qName);
}
currentText = new StringBuilder();
currentText.setLength(0);
}
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);
}
currentText = new StringBuilder();
currentText.setLength(0);
}
@Override

View File

@ -79,7 +79,7 @@ public class DescribeTagsResponseHandler extends ParseSax.HandlerForGeneratedReq
} else if (inTags) {
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")) {
this.output = new String(base64().decode(whitespace.matcher(currentText).replaceAll("")), UTF_8);
}
currentText = new StringBuilder();
currentText.setLength(0);
}
@Override

View File

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

View File

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

View File

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

View File

@ -37,7 +37,7 @@ public class InstanceTypeHandler extends
if (qName.equalsIgnoreCase("value")) {
this.type = currentText.toString().trim();
}
currentText = new StringBuilder();
currentText.setLength(0);
}
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);
userId = groupId = null;
}
currentText = new StringBuilder();
currentText.setLength(0);
}
private static String currentOrNegative(StringBuilder currentText) {

View File

@ -69,7 +69,7 @@ public class KeyPairResponseHandler extends ParseSax.HandlerForGeneratedRequestW
} else if (qName.equals("keyName")) {
builder.keyName(currentOrNull(currentText));
}
currentText = new StringBuilder();
currentText.setLength(0);
}
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")) {
userIds.add(currentText.toString().trim());
}
currentText = new StringBuilder();
currentText.setLength(0);
}
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")) {
builder.description(currentOrNull(currentText));
}
currentText = new StringBuilder();
currentText.setLength(0);
}
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")) {
ownerAlias = currentText.toString().trim();
}
currentText = new StringBuilder();
currentText.setLength(0);
}
public void characters(char ch[], int start, int length) {

View File

@ -37,7 +37,7 @@ public class StringValueHandler extends
if (qName.equalsIgnoreCase("value")) {
this.value = currentText.toString().trim();
}
currentText = new StringBuilder();
currentText.setLength(0);
}
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")) {
builder.availabilityZone(currentOrNull(currentText));
}
currentText = new StringBuilder();
currentText.setLength(0);
}
@Override

View File

@ -62,7 +62,7 @@ public class TagHandler extends ParseSax.HandlerForGeneratedRequestWithResult<Ta
// empty is same as not present
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;
value = null;
}
currentText = new StringBuilder();
currentText.setLength(0);
}
@Override

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -83,7 +83,7 @@ public class AccessControlListHandler extends ParseSax.HandlerWithResult<AccessC
} else if (qName.equals("Permission")) {
currentPermission = currentOrNull(currentText);
}
currentText = new StringBuilder();
currentText.setLength(0);
}
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")) {
currentPermission = currentOrNull(currentText);
}
currentText = new StringBuilder();
currentText.setLength(0);
}
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")) {
metadata = new CopyObjectResult(currentLastModified, currentETag);
}
currentText = new StringBuilder();
currentText.setLength(0);
}
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
.iso8601DateOrSecondsDateParse(currentOrNull(currentText));
}
currentText = new StringBuilder();
currentText.setLength(0);
}
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")) {
this.isTruncated = Boolean.parseBoolean(currentOrNull(currentText));
}
currentText = new StringBuilder();
currentText.setLength(0);
}
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));
this.name = null;
}
currentText = new StringBuilder();
currentText.setLength(0);
}
@Override

View File

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

View File

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

View File

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

View File

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

View File

@ -46,7 +46,7 @@ public class ErrorHandler extends ParseSax.HandlerWithResult<AWSError> {
} else if (!qName.equals("Error")) {
error.getDetails().put(qName, currentText.toString().trim());
}
currentText = new StringBuilder();
currentText.setLength(0);
}
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)));
}
}
currentText = new StringBuilder();
currentText.setLength(0);
}
@Override

View File

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

View File

@ -87,7 +87,7 @@ public class CatalogHandler extends ParseSax.HandlerWithResult<Catalog> {
} else if (SaxUtils.equalsOrSuffix(qName, "IsPublished")) {
published = Boolean.parseBoolean(currentOrNull());
}
currentText = new StringBuilder();
currentText.setLength(0);
}
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());
key = null;
}
currentText = new StringBuilder();
currentText.setLength(0);
}
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) {
Map<String, String> attributes = SaxUtils.cleanseAttributes(attrs);
this.currentText = new StringBuilder();
this.currentText.setLength(0);
if (qName.endsWith("GuestCustomizationSection")) {
guest = newReferenceType(attributes);
} 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")) {
this.name = currentOrNull();
}
currentText = new StringBuilder();
currentText.setLength(0);
}
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")) {
this.ipAddressAllocationMode = IpAddressAllocationMode.valueOf(currentOrNull());
}
currentText = new StringBuilder();
currentText.setLength(0);
}
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")) {
this.primaryNetworkConnectionIndex = Integer.valueOf(currentOrNull());
}
currentText = new StringBuilder();
currentText.setLength(0);
}
@Override

View File

@ -95,7 +95,7 @@ public class OrgHandler extends ParseSax.HandlerWithResult<Org> {
} else if (qName.endsWith("FullName")) {
fullName = currentOrNull();
}
currentText = new StringBuilder();
currentText.setLength(0);
}
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")) {
allowedExternalIpAddresses.add(currentOrNull());
}
currentText = new StringBuilder();
currentText.setLength(0);
}
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")) {
contents.put(version, location);
}
currentText = new StringBuilder();
currentText.setLength(0);
}
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")) {
ovfDescriptorUploaded = Boolean.parseBoolean(SaxUtils.currentOrNull(currentText));
}
currentText = new StringBuilder();
currentText.setLength(0);
}
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")) {
ovfDescriptorUploaded = Boolean.parseBoolean(currentOrNull());
}
currentText = new StringBuilder();
currentText.setLength(0);
}
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")) {
isEnabled = Boolean.parseBoolean(currentOrNull());
}
currentText = new StringBuilder();
currentText.setLength(0);
}
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")) {
vAppScopedLocalId = currentOrNull();
}
currentText = new StringBuilder();
currentText.setLength(0);
}
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")) {
this.description = currentText.toString().trim();
}
currentText = new StringBuilder();
currentText.setLength(0);
}
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")) {
error.getDetails().put(qName, currentText.toString());
}
currentText = new StringBuilder();
currentText.setLength(0);
}
public void characters(char ch[], int start, int length) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -97,7 +97,7 @@ public class AWSEC2DescribeSecurityGroupsResponseHandler extends
} else if (inSecurityGroupInfo) {
securityGroupHandler.endElement(uri, name, qName);
}
currentText = new StringBuilder();
currentText.setLength(0);
}
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);
userId = groupId = null;
}
currentText = new StringBuilder();
currentText.setLength(0);
}
private static String currentOrNegative(StringBuilder currentText) {

View File

@ -112,7 +112,7 @@ public class AWSEC2SecurityGroupHandler extends HandlerForGeneratedRequestWithRe
} else if (equalsOrSuffix(qName, "groupDescription")) {
builder.description(currentOrNull(currentText));
}
currentText = new StringBuilder();
currentText.setLength(0);
}
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.deleteOnTermination = true;
}
currentText = new StringBuilder();
currentText.setLength(0);
}
protected void inItem() {

View File

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

View File

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

View File

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

View File

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

View File

@ -80,7 +80,7 @@ public class ReservedInstancesOfferingHandler extends
} else if (qName.equalsIgnoreCase("usagePrice")) {
this.usagePrice = Float.parseFloat(currentText.toString().trim());
}
currentText = new StringBuilder();
currentText.setLength(0);
}
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")) {
builder.availabilityZone(currentText.toString().trim());
}
currentText = new StringBuilder();
currentText.setLength(0);
}
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")) {
builder.productDescription(currentOrNull(currentText));
}
currentText = new StringBuilder();
currentText.setLength(0);
}
@Override

View File

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

View File

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

View File

@ -114,7 +114,7 @@ public class AccountNameEnumerationResultsHandler extends
} else if (qName.equals("Etag")) {
currentETag = currentText.toString().trim();
}
currentText = new StringBuilder();
currentText.setLength(0);
}
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());
inSize = false;
}
currentText = new StringBuilder();
currentText.setLength(0);
}
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);
}
}
currentText = new StringBuilder();
currentText.setLength(0);
}
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