Code formatter has chewed on it a bit

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@37 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
Andy Clement 2008-08-15 00:25:46 +00:00
parent 540ca861df
commit 4a24abb21d
1 changed files with 11 additions and 7 deletions

View File

@ -61,27 +61,31 @@ public class SpelExpressionParser extends TemplateAwareExpressionParser {
* @return a parsed expression object * @return a parsed expression object
* @throws ParseException if the expression is invalid * @throws ParseException if the expression is invalid
*/ */
protected Expression doParseExpression(String expressionString, ParserContext context) @Override
throws ParseException { protected Expression doParseExpression(String expressionString, ParserContext context) throws ParseException {
try { try {
lexer.setCharStream(new ANTLRStringStream(expressionString)); lexer.setCharStream(new ANTLRStringStream(expressionString));
CommonTokenStream tokens = new CommonTokenStream(lexer); CommonTokenStream tokens = new CommonTokenStream(lexer);
parser.setTokenStream(tokens); parser.setTokenStream(tokens);
expr_return exprReturn = parser.expr(); expr_return exprReturn = parser.expr();
return new SpelExpression(expressionString, (SpelNode) exprReturn.getTree()); SpelExpression newExpression = new SpelExpression(expressionString, (SpelNode) exprReturn.getTree());
return newExpression;
} catch (RecognitionException re) { } catch (RecognitionException re) {
ParseException exception = new ParseException(expressionString, "Recognition error at position: "+re.charPositionInLine+": "+re.getMessage(), re); ParseException exception = new ParseException(expressionString, "Recognition error at position: "
+ re.charPositionInLine + ": " + re.getMessage(), re);
throw exception; throw exception;
} catch (InternalELException e) { } catch (InternalELException e) {
SpelException wrappedException = e.getCause(); SpelException wrappedException = e.getCause();
throw new ParseException(expressionString,"Parsing problem: "+wrappedException.getMessage(),wrappedException); throw new ParseException(expressionString, "Parsing problem: " + wrappedException.getMessage(),
wrappedException);
} }
} }
/** /**
* Simple override with covariance to return a nicer type * Simple override with covariance to return a nicer type
*/ */
@Override
public SpelExpression parseExpression(String expressionString) throws ParseException { public SpelExpression parseExpression(String expressionString) throws ParseException {
return (SpelExpression)super.parseExpression(expressionString, DefaultNonTemplateParserContext.INSTANCE); return (SpelExpression) super.parseExpression(expressionString, DefaultNonTemplateParserContext.INSTANCE);
} }
} }