Browse Source

refine clone()

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@557045 13f79535-47bb-0310-9956-ffa450edef68
master
Matthew Jason Benson 18 years ago
parent
commit
73ebd04c68
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      src/main/org/apache/tools/ant/PropertyHelper.java

+ 5
- 1
src/main/org/apache/tools/ant/PropertyHelper.java View File

@@ -950,10 +950,14 @@ public class PropertyHelper implements Cloneable {
* @return the cloned PropertyHelper.
* @since Ant 1.8
*/
public Object clone() {
public synchronized Object clone() {
PropertyHelper result;
try {
result = (PropertyHelper) super.clone();
result.delegates = (Hashtable) delegates.clone();
result.properties = (Hashtable) properties.clone();
result.userProperties = (Hashtable) userProperties.clone();
result.inheritedProperties = (Hashtable) inheritedProperties.clone();
} catch (CloneNotSupportedException e) {
throw new BuildException(e);
}


Loading…
Cancel
Save