diff options
author | Claude Brisson <cbrisson@apache.org> | 2017-01-26 01:57:00 +0000 |
---|---|---|
committer | Claude Brisson <cbrisson@apache.org> | 2017-01-26 01:57:00 +0000 |
commit | 2880a3c02ddc0b4aa8990c04d2580ea9db0d2acf (patch) | |
tree | 3c497ef634c983117b8d6e31ee65d0d7e8c55789 /velocity-engine-core/src/main/java/org/apache/velocity/runtime/directive/Evaluate.java | |
parent | 5d9277c7481bb878babc6e3680b2b2124ca04867 (diff) | |
download | apache-velocity-engine-2880a3c02ddc0b4aa8990c04d2580ea9db0d2acf.tar.gz |
[engine] fix trailing whitespaces
git-svn-id: https://svn.apache.org/repos/asf/velocity/engine/trunk@1780307 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'velocity-engine-core/src/main/java/org/apache/velocity/runtime/directive/Evaluate.java')
-rw-r--r-- | velocity-engine-core/src/main/java/org/apache/velocity/runtime/directive/Evaluate.java | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/velocity-engine-core/src/main/java/org/apache/velocity/runtime/directive/Evaluate.java b/velocity-engine-core/src/main/java/org/apache/velocity/runtime/directive/Evaluate.java index 2366ce27..0d60d449 100644 --- a/velocity-engine-core/src/main/java/org/apache/velocity/runtime/directive/Evaluate.java +++ b/velocity-engine-core/src/main/java/org/apache/velocity/runtime/directive/Evaluate.java @@ -16,7 +16,7 @@ package org.apache.velocity.runtime.directive; * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations - * under the License. + * under the License. */ import org.apache.velocity.Template; @@ -80,44 +80,44 @@ public class Evaluate extends Directive /** * Check that there is exactly one argument and it is a string or reference. - */ - + */ + int argCount = node.jjtGetNumChildren(); if (argCount == 0) { throw new TemplateInitException( - "#" + getName() + "() requires exactly one argument", + "#" + getName() + "() requires exactly one argument", context.getCurrentTemplateName(), node.getColumn(), - node.getLine()); + node.getLine()); } if (argCount > 1) { - /* + /* * use line/col of second argument */ - + throw new TemplateInitException( - "#" + getName() + "() requires exactly one argument", + "#" + getName() + "() requires exactly one argument", context.getCurrentTemplateName(), node.jjtGetChild(1).getColumn(), node.jjtGetChild(1).getLine()); } - + Node childNode = node.jjtGetChild(0); if ( childNode.getType() != ParserTreeConstants.JJTSTRINGLITERAL && childNode.getType() != ParserTreeConstants.JJTREFERENCE ) { throw new TemplateInitException( - "#" + getName() + "() argument must be a string literal or reference", + "#" + getName() + "() argument must be a string literal or reference", context.getCurrentTemplateName(), childNode.getColumn(), childNode.getLine()); } } - + /** - * Evaluate the argument, convert to a String, and evaluate again + * Evaluate the argument, convert to a String, and evaluate again * (with the same context). * @param context * @param writer @@ -125,7 +125,7 @@ public class Evaluate extends Directive * @return True if the directive rendered successfully. * @throws IOException * @throws ResourceNotFoundException - * @throws ParseErrorException + * @throws ParseErrorException * @throws MethodInvocationException */ public boolean render(InternalContextAdapter context, Writer writer, @@ -137,18 +137,18 @@ public class Evaluate extends Directive * Evaluate the string with the current context. We know there is * exactly one argument and it is a string or reference. */ - + Object value = node.jjtGetChild(0).value( context ); String sourceText; if ( value != null ) { sourceText = value.toString(); - } + } else { sourceText = ""; } - + /* * The new string needs to be parsed since the text has been dynamically generated. */ @@ -198,7 +198,7 @@ public class Evaluate extends Directive throw new ParseErrorException( pex.getMessage(), info ); } - try + try { preRender(context); |