the propertyEvaluator eats everything between e.g. anyText${token1}FOO${token2} - FOO gets lost
This patch fixes it:
Index: ../ebean/src/com/avaje/ebean/server/lib/PropertyEvaluator.java===================================================================--- ../ebean/src/com/avaje/ebean/server/lib/PropertyEvaluator.java (revision 141)+++ ../ebean/src/com/avaje/ebean/server/lib/PropertyEvaluator.java Tue Feb 24 12:28:30 CET 2009@@ -158,6 +157,8 @@ if (sp > -1) { int ep = val.indexOf(END, sp + 1); if (ep > -1) {+ // append what is between the last token and the new one (if startPos == sp nothing gets added)+ sb.append(val.substring(startPos, sp)); String cal = evalExpression(val, sp, ep); sb.append(cal); eval(val, ep + 1, sb);
Confirmed and fixed in HEAD.
you added it right afterif (sp > -1) {while I had it afterif (ep > -1) {
so, only if the token will be replaced, the content between two tokens gets readded.In any other case, no starting ${ found or no ending } found it falls through to "append whats left" which was already there.
If, for some reason one has an errorneous config like param=my${strange}and${wrong configthe word "and" will be added twice, once by the new "in between text append" and once by the already existing append at the end of the method.
But as I wrote in the summary. A VERY minor issue ;-)