Author: stevel Date: Sun Jun 11 14:49:42 2006 New Revision: 413537 URL: http://svn.apache.org/viewvc?rev=413537&view=rev Log: toString() override. Debuggers like them.
Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/resources/PropertyResource.java ant/core/trunk/src/main/org/apache/tools/ant/types/resources/StringResource.java Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/resources/PropertyResource.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/resources/PropertyResource.java?rev=413537&r1=413536&r2=413537&view=diff ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/types/resources/PropertyResource.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/types/resources/PropertyResource.java Sun Jun 11 14:49:42 2006 @@ -98,6 +98,20 @@ } /** + * Get the string. + * + * @return the string contents of the resource. + * @since Ant 1.7 + */ + public String toString() { + if (isReference()) { + return getCheckedRef().toString(); + } + return getName()!=null?("${"+getName()+"}") + :"null"; + } + + /** * Get an InputStream for the Resource. * @return an InputStream containing this Resource's content. * @throws IOException if unable to provide the content of this Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/resources/StringResource.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/resources/StringResource.java?rev=413537&r1=413536&r2=413537&view=diff ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/types/resources/StringResource.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/types/resources/StringResource.java Sun Jun 11 14:49:42 2006 @@ -128,6 +128,19 @@ } /** + * Get the string. + * + * @return the string contents of the resource. + * @since Ant 1.7 + */ + public String toString() { + if (isReference()) { + return getCheckedRef().toString(); + } + return String.valueOf(getContent()); + } + + /** * Get an InputStream for the Resource. * @return an InputStream containing this Resource's content. * @throws IOException if unable to provide the content of this --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]