Author: henning Date: Sat Oct 1 06:11:39 2005 New Revision: 292980 URL: http://svn.apache.org/viewcvs?rev=292980&view=rev Log: Remove String(String) C'tor.
Can anyone tell me whether this whole code segment is actually correct? Because a method returning 'null' and not having a void return type might cause this code to return 'null' to the caller. According to the comment on top of this block, this might actually be a bad idea. Maybe we can just remove the whole method.getReturnType() check and return unconditionally "" when the result is null? Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTMethod.java Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTMethod.java URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTMethod.java?rev=292980&r1=292979&r2=292980&view=diff ============================================================================== --- jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTMethod.java (original) +++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTMethod.java Sat Oct 1 06:11:39 2005 @@ -209,7 +209,9 @@ if (obj == null) { if( method.getReturnType() == Void.TYPE) - return new String(""); + { + return ""; + } } return obj; --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]