mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-21 07:55:24 +02:00
StringBuilder instead of StringBuffer.
This commit is contained in:
parent
53ecdbbc27
commit
da432ec64b
1 changed files with 10 additions and 14 deletions
|
@ -17,7 +17,6 @@ package org.eclipse.cdt.internal.formatter.align;
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
public class AlignmentException extends RuntimeException {
|
public class AlignmentException extends RuntimeException {
|
||||||
|
|
||||||
private static final long serialVersionUID= -1081237230006524966L;
|
private static final long serialVersionUID= -1081237230006524966L;
|
||||||
public static final int LINE_TOO_LONG = 1;
|
public static final int LINE_TOO_LONG = 1;
|
||||||
public static final int ALIGN_TOO_SMALL = 2;
|
public static final int ALIGN_TOO_SMALL = 2;
|
||||||
|
@ -37,20 +36,17 @@ public class AlignmentException extends RuntimeException {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString(){
|
public String toString() {
|
||||||
StringBuffer buffer = new StringBuffer(10);
|
StringBuilder buffer = new StringBuilder(40);
|
||||||
switch(this.reason){
|
switch (reason) {
|
||||||
case LINE_TOO_LONG :
|
case LINE_TOO_LONG:
|
||||||
buffer.append("LINE_TOO_LONG"); //$NON-NLS-1$
|
buffer.append("LINE_TOO_LONG"); //$NON-NLS-1$
|
||||||
break;
|
break;
|
||||||
case ALIGN_TOO_SMALL :
|
case ALIGN_TOO_SMALL:
|
||||||
buffer.append("ALIGN_TOO_SMALL"); //$NON-NLS-1$
|
buffer.append("ALIGN_TOO_SMALL"); //$NON-NLS-1$
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
buffer
|
buffer.append("<relativeDepth: ").append(relativeDepth).append(">\n"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
.append("<relativeDepth: ") //$NON-NLS-1$
|
|
||||||
.append(this.relativeDepth)
|
|
||||||
.append(">\n"); //$NON-NLS-1$
|
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue