Java 5 code style

This commit is contained in:
Juergen Hoeller
2008-11-27 00:27:52 +00:00
parent 6bbc966a21
commit b0790bf5e7
248 changed files with 2374 additions and 3208 deletions

View File

@@ -44,7 +44,7 @@ public class SpelUtilities {
*/
private static void printAST(PrintStream out, SpelNode t, String indent) {
if (t != null) {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
String s = (t.getType() == -1 ? "EOF" : t.getClass().getSimpleName());
sb.append(indent).append(s);
sb.append(" value=").append(t.getText());

View File

@@ -110,7 +110,7 @@ public class CompoundExpression extends SpelNode {
@Override
public String toStringAST() {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < getChildCount(); i++) {
sb.append(getChild(i).toStringAST());
}

View File

@@ -54,16 +54,18 @@ public abstract class Operator extends SpelNode {
*/
@Override
public String toStringAST() {
StringBuffer sb = new StringBuffer();
if (getChildCount() > 0)
StringBuilder sb = new StringBuilder();
if (getChildCount() > 0) {
sb.append("(");
}
sb.append(getChild(0).toStringAST());
for (int i = 1; i < getChildCount(); i++) {
sb.append(" ").append(getOperatorName()).append(" ");
sb.append(getChild(i).toStringAST());
}
if (getChildCount() > 0)
if (getChildCount() > 0) {
sb.append(")");
}
return sb.toString();
}

View File

@@ -86,7 +86,7 @@ public class Projection extends SpelNode {
@Override
public String toStringAST() {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
return sb.append("!{").append(getChild(0).toStringAST()).append("}").toString();
}

View File

@@ -123,7 +123,7 @@ public class Selection extends SpelNode {
@Override
public String toStringAST() {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
switch (variant) {
case ALL:
sb.append("?{");

View File

@@ -198,7 +198,7 @@ public class TestScenarioCreator {
}
public static String reverseString(String input) {
StringBuffer backwards = new StringBuffer();
StringBuilder backwards = new StringBuilder();
for (int i = 0; i < input.length(); i++) {
backwards.append(input.charAt(input.length() - 1 - i));
}