Browse Source

toString() override. Debuggers like them.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@413537 13f79535-47bb-0310-9956-ffa450edef68
master
Steve Loughran 19 years ago
parent
commit
55a2554cc8
2 changed files with 27 additions and 0 deletions
  1. +14
    -0
      src/main/org/apache/tools/ant/types/resources/PropertyResource.java
  2. +13
    -0
      src/main/org/apache/tools/ant/types/resources/StringResource.java

+ 14
- 0
src/main/org/apache/tools/ant/types/resources/PropertyResource.java View File

@@ -97,6 +97,20 @@ public class PropertyResource extends Resource {
return super.hashCode() * PROPERTY_MAGIC;
}

/**
* 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.


+ 13
- 0
src/main/org/apache/tools/ant/types/resources/StringResource.java View File

@@ -127,6 +127,19 @@ public class StringResource extends Resource {
return super.hashCode() * STRING_MAGIC;
}

/**
* 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.


Loading…
Cancel
Save