You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by st...@apache.org on 2006/06/11 23:49:42 UTC

svn commit: r413537 - in /ant/core/trunk/src/main/org/apache/tools/ant/types/resources: PropertyResource.java StringResource.java

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: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org