From 88c370ad5d1898244b56d096f3de7bd21041de84 Mon Sep 17 00:00:00 2001 From: Andy Clement Date: Sun, 17 Aug 2008 01:26:45 +0000 Subject: [PATCH] fixing TODOs --- .../springframework/expression/spel/ast/Indexer.java | 6 +++--- .../expression/spel/ast/OperatorSoundsLike.java | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/org.springframework.expression/src/main/java/org/springframework/expression/spel/ast/Indexer.java b/org.springframework.expression/src/main/java/org/springframework/expression/spel/ast/Indexer.java index c2382cbcb69..8ed93fc9dc7 100644 --- a/org.springframework.expression/src/main/java/org/springframework/expression/spel/ast/Indexer.java +++ b/org.springframework.expression/src/main/java/org/springframework/expression/spel/ast/Indexer.java @@ -20,12 +20,12 @@ import java.util.Map; import org.antlr.runtime.Token; import org.springframework.expression.EvaluationException; +import org.springframework.expression.spel.ExpressionState; import org.springframework.expression.spel.SpelException; import org.springframework.expression.spel.SpelMessages; -import org.springframework.expression.spel.ExpressionState; -// TODO 2 support multidimensional arrays -// TODO 3 support correct syntax for multidimensional [][][] and not [,,,] +// TODO support multidimensional arrays +// TODO support correct syntax for multidimensional [][][] and not [,,,] /** * An Indexer can index into some proceeding structure to access a particular piece of it. Supported structures are: * strings/collections (lists/sets)/arrays diff --git a/org.springframework.expression/src/main/java/org/springframework/expression/spel/ast/OperatorSoundsLike.java b/org.springframework.expression/src/main/java/org/springframework/expression/spel/ast/OperatorSoundsLike.java index c82bb4a21ee..ba4b8df8336 100644 --- a/org.springframework.expression/src/main/java/org/springframework/expression/spel/ast/OperatorSoundsLike.java +++ b/org.springframework.expression/src/main/java/org/springframework/expression/spel/ast/OperatorSoundsLike.java @@ -17,9 +17,9 @@ package org.springframework.expression.spel.ast; import org.antlr.runtime.Token; import org.springframework.expression.EvaluationException; +import org.springframework.expression.spel.ExpressionState; import org.springframework.expression.spel.SpelException; import org.springframework.expression.spel.SpelMessages; -import org.springframework.expression.spel.ExpressionState; public class OperatorSoundsLike extends Operator { @@ -32,19 +32,19 @@ public class OperatorSoundsLike extends Operator { Object left = getLeftOperand().getValue(state); Object right = getRightOperand().getValue(state); if (!(left instanceof String)) { - throw new SpelException(getCharPositionInLine(), SpelMessages.SOUNDSLIKE_NEEDS_STRING_OPERAND, left.getClass() - .getName()); + throw new SpelException(getCharPositionInLine(), SpelMessages.SOUNDSLIKE_NEEDS_STRING_OPERAND, left + .getClass().getName()); } if (!(right instanceof String)) { - throw new SpelException(getCharPositionInLine(), SpelMessages.SOUNDSLIKE_NEEDS_STRING_OPERAND, right.getClass() - .getName()); + throw new SpelException(getCharPositionInLine(), SpelMessages.SOUNDSLIKE_NEEDS_STRING_OPERAND, right + .getClass().getName()); } String leftSoundex = computeSoundex((String) left); String rightSoundex = computeSoundex((String) right); return state.getTypeComparator().compare(leftSoundex, rightSoundex) == 0; } - // TODO OPTIMIZE better algorithm implementation is possible for soundex + // TODO if we keep soundslike, improve upon this basic implementation private String computeSoundex(String input) { if (input == null || input.length() == 0) return "0000";