Skip to content
Permalink
Browse files
Use StringBuilder instead of StringBuffer. (#284)
  • Loading branch information
arturobernalg committed Apr 22, 2022
1 parent c28d4ec commit 6542912a5e80b261de8831cfaed271b3ec23d5b8
Showing 7 changed files with 10 additions and 10 deletions.
@@ -422,7 +422,7 @@ private long calculateSmallest() {
*/
@Override
public String toString() {
final StringBuffer buffer = new StringBuffer(11);
final StringBuilder buffer = new StringBuilder(11);
buffer.append('(');
buffer.append(b);
buffer.append(',');
@@ -471,11 +471,11 @@ public CPSignature getCPSignature(final String signature) {
if (signature.length() > 1 && signature.indexOf('L') != -1) {
final List classes = new ArrayList();
final char[] chars = signature.toCharArray();
final StringBuffer signatureString = new StringBuffer();
final StringBuilder signatureString = new StringBuilder();
for (int i = 0; i < chars.length; i++) {
signatureString.append(chars[i]);
if (chars[i] == 'L') {
final StringBuffer className = new StringBuffer();
final StringBuilder className = new StringBuilder();
for (int j = i + 1; j < chars.length; j++) {
final char c = chars[j];
if (!Character.isLetter(c) && !Character.isDigit(c) && (c != '/') && (c != '$')
@@ -805,7 +805,7 @@ public List getBody() {
* @throws IOException If an I/O error occurs.
*/
private StringReader getStreamUpToMatchingBracket(final StringReader stream) throws IOException {
final StringBuffer sb = new StringBuffer();
final StringBuilder sb = new StringBuilder();
int foundBracket = -1;
while (foundBracket != 0) {
final char c = (char) stream.read();
@@ -872,7 +872,7 @@ private BHSDCodec getCodec(final String layoutElement) {
* @throws IOException If an I/O error occurs.
*/
private String readUpToMatchingBracket(final StringReader stream) throws IOException {
final StringBuffer sb = new StringBuffer();
final StringBuilder sb = new StringBuilder();
int foundBracket = -1;
while (foundBracket != 0) {
final char c = (char) stream.read();
@@ -305,7 +305,7 @@ private void parseCpSignature(final InputStream in) throws IOException, Pack200E
for (int i = 0; i < cpSignatureCount; i++) {
final String form = cpSignatureForm[i];
final int len = form.length();
final StringBuffer signature = new StringBuffer(64);
final StringBuilder signature = new StringBuilder(64);
final ArrayList list = new ArrayList();
for (int j = 0; j < len; j++) {
final char c = form.charAt(j);
@@ -269,7 +269,7 @@ private boolean isAllDigits(final String nameString) {

@Override
public String toString() {
final StringBuffer result = new StringBuffer();
final StringBuilder result = new StringBuilder();
result.append("IcTuple ");
result.append('(');
result.append(simpleClassName());
@@ -870,7 +870,7 @@ public List getBody() {
* @throws IOException If an I/O error occurs.
*/
private StringReader getStreamUpToMatchingBracket(final StringReader stream) throws IOException {
final StringBuffer sb = new StringBuffer();
final StringBuilder sb = new StringBuilder();
int foundBracket = -1;
while (foundBracket != 0) {
final char c = (char) stream.read();
@@ -918,7 +918,7 @@ public BHSDCodec getCodec(final String layoutElement) {
* @throws IOException If an I/O error occurs.
*/
private String readUpToMatchingBracket(final StringReader stream) throws IOException {
final StringBuffer sb = new StringBuffer();
final StringBuilder sb = new StringBuilder();
int foundBracket = -1;
while (foundBracket != 0) {
final char c = (char) stream.read();
@@ -99,7 +99,7 @@ protected void resolve(final ClassConstantPool pool) {

@Override
public String toString() {
final StringBuffer sb = new StringBuffer();
final StringBuilder sb = new StringBuilder();
sb.append("Exceptions: ");
for (CPClass exception : exceptions) {
sb.append(exception);

0 comments on commit 6542912

Please sign in to comment.