From 3ca7c90999ae1665925ab2d7b4255cd950f33238 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Thu, 24 Jul 2003 14:05:49 +0000 Subject: [PATCH] Fix inconsistent synchronization git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274933 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/ant/Project.java | 8 ++++---- src/main/org/apache/tools/ant/PropertyHelper.java | 7 ++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main/org/apache/tools/ant/Project.java b/src/main/org/apache/tools/ant/Project.java index a59831c77..26794082b 100644 --- a/src/main/org/apache/tools/ant/Project.java +++ b/src/main/org/apache/tools/ant/Project.java @@ -452,7 +452,7 @@ public class Project { * @param value The new value of the property. * Must not be null. */ - public synchronized void setProperty(String name, String value) { + public void setProperty(String name, String value) { PropertyHelper.getPropertyHelper(this). setProperty(null, name, value, true); } @@ -468,7 +468,7 @@ public class Project { * Must not be null. * @since 1.5 */ - public synchronized void setNewProperty(String name, String value) { + public void setNewProperty(String name, String value) { PropertyHelper.getPropertyHelper(this).setNewProperty(null, name, value); } @@ -482,7 +482,7 @@ public class Project { * Must not be null. * @see #setProperty(String,String) */ - public synchronized void setUserProperty(String name, String value) { + public void setUserProperty(String name, String value) { PropertyHelper.getPropertyHelper(this).setUserProperty(null, name, value); } @@ -499,7 +499,7 @@ public class Project { * Must not be null. * @see #setProperty(String,String) */ - public synchronized void setInheritedProperty(String name, String value) { + public void setInheritedProperty(String name, String value) { PropertyHelper ph = PropertyHelper.getPropertyHelper(this); ph.setInheritedProperty(null, name, value); } diff --git a/src/main/org/apache/tools/ant/PropertyHelper.java b/src/main/org/apache/tools/ant/PropertyHelper.java index 59b6e9916..da6e11113 100644 --- a/src/main/org/apache/tools/ant/PropertyHelper.java +++ b/src/main/org/apache/tools/ant/PropertyHelper.java @@ -156,7 +156,8 @@ public class PropertyHelper { * * @return the project's property helper. */ - public static PropertyHelper getPropertyHelper(Project project) { + public synchronized static + PropertyHelper getPropertyHelper(Project project) { PropertyHelper helper = (PropertyHelper) project.getReference("ant.PropertyHelper"); if (helper != null) { @@ -451,7 +452,7 @@ public class PropertyHelper { * @return the property value, or null for no match * or if a null name is provided. */ - public Object getProperty(String ns, String name) { + public synchronized Object getProperty(String ns, String name) { if (name == null) { return null; } @@ -472,7 +473,7 @@ public class PropertyHelper { * @return the property value, or null for no match * or if a null name is provided. */ - public Object getUserProperty(String ns, String name) { + public synchronized Object getUserProperty(String ns, String name) { if (name == null) { return null; }