tune collectionElementName() live template macro to work better in Jinja2 templates

This commit is contained in:
Dmitry Jemerov
2012-08-15 14:41:52 +02:00
parent 9b9d11b4b0
commit 8352e59133
@@ -39,6 +39,12 @@ public class CollectionElementNameMacro extends Macro {
if (lastDot >= 0) {
param = param.substring(lastDot+1);
}
if (param.endsWith(")")) {
int lastParen = param.lastIndexOf('(');
if (lastParen > 0) {
param = param.substring(0, lastParen);
}
}
final String result = smartUnpluralize(param);
return new TextResult(result);
}