mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Replace space indentation with tabs
Issue: SPR-10127
This commit is contained in:
committed by
Chris Beams
parent
1762157ad1
commit
2cf45bad86
+1
-1
@@ -192,7 +192,7 @@ public class ConstructorInvocationTests extends ExpressionTestCase {
|
||||
|
||||
@Test
|
||||
public void testVarargsInvocation02() {
|
||||
// Calling 'Fruit(int i, String... strings)' - returns int+length_of_strings
|
||||
// Calling 'Fruit(int i, String... strings)' - returns int+length_of_strings
|
||||
evaluate("new org.springframework.expression.spel.testresources.Fruit(5,'a','b','c').stringscount()", 8, Integer.class);
|
||||
evaluate("new org.springframework.expression.spel.testresources.Fruit(2,'a').stringscount()", 3, Integer.class);
|
||||
evaluate("new org.springframework.expression.spel.testresources.Fruit(4).stringscount()", 4, Integer.class);
|
||||
|
||||
+20
-20
@@ -435,8 +435,8 @@ public class SpelDocumentationTests extends ExpressionTestCase {
|
||||
ExpressionParser parser = new SpelExpressionParser();
|
||||
StandardEvaluationContext context = new StandardEvaluationContext();
|
||||
|
||||
context.registerFunction("reverseString",
|
||||
StringUtils.class.getDeclaredMethod("reverseString", new Class[] { String.class }));
|
||||
context.registerFunction("reverseString", StringUtils.class.getDeclaredMethod(
|
||||
"reverseString", new Class[] { String.class }));
|
||||
|
||||
String helloWorldReversed = parser.parseExpression("#reverseString('hello world')").getValue(context, String.class);
|
||||
Assert.assertEquals("dlrow olleh",helloWorldReversed);
|
||||
@@ -456,8 +456,8 @@ public class SpelDocumentationTests extends ExpressionTestCase {
|
||||
parser.parseExpression("Name").setValue(societyContext, "IEEE");
|
||||
societyContext.setVariable("queryName", "Nikola Tesla");
|
||||
|
||||
String expression = "isMember(#queryName)? #queryName + ' is a member of the ' " +
|
||||
"+ Name + ' Society' : #queryName + ' is not a member of the ' + Name + ' Society'";
|
||||
String expression = "isMember(#queryName)? #queryName + ' is a member of the ' "
|
||||
+ "+ Name + ' Society' : #queryName + ' is not a member of the ' + Name + ' Society'";
|
||||
|
||||
String queryResultString = parser.parseExpression(expression).getValue(societyContext, String.class);
|
||||
Assert.assertEquals("Nikola Tesla is a member of the IEEE Society",queryResultString);
|
||||
@@ -487,28 +487,28 @@ public class SpelDocumentationTests extends ExpressionTestCase {
|
||||
|
||||
static class TemplatedParserContext implements ParserContext {
|
||||
|
||||
public String getExpressionPrefix() {
|
||||
return "${";
|
||||
}
|
||||
public String getExpressionPrefix() {
|
||||
return "${";
|
||||
}
|
||||
|
||||
public String getExpressionSuffix() {
|
||||
return "}";
|
||||
}
|
||||
public String getExpressionSuffix() {
|
||||
return "}";
|
||||
}
|
||||
|
||||
public boolean isTemplate() {
|
||||
return true;
|
||||
}
|
||||
public boolean isTemplate() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
static class StringUtils {
|
||||
|
||||
public static String reverseString(String input) {
|
||||
StringBuilder backwards = new StringBuilder();
|
||||
for (int i = 0; i < input.length(); i++) {
|
||||
backwards.append(input.charAt(input.length() - 1 - i));
|
||||
}
|
||||
return backwards.toString();
|
||||
}
|
||||
public static String reverseString(String input) {
|
||||
StringBuilder backwards = new StringBuilder();
|
||||
for (int i = 0; i < input.length(); i++) {
|
||||
backwards.append(input.charAt(input.length() - 1 - i));
|
||||
}
|
||||
return backwards.toString();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user