Browse Source

Fix inconsistent synchronization

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274933 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 22 years ago
parent
commit
3ca7c90999
2 changed files with 8 additions and 7 deletions
  1. +4
    -4
      src/main/org/apache/tools/ant/Project.java
  2. +4
    -3
      src/main/org/apache/tools/ant/PropertyHelper.java

+ 4
- 4
src/main/org/apache/tools/ant/Project.java View File

@@ -452,7 +452,7 @@ public class Project {
* @param value The new value of the property.
* Must not be <code>null</code>.
*/
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 <code>null</code>.
* @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 <code>null</code>.
* @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 <code>null</code>.
* @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);
}


+ 4
- 3
src/main/org/apache/tools/ant/PropertyHelper.java View File

@@ -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 <code>null</code> for no match
* or if a <code>null</code> 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 <code>null</code> for no match
* or if a <code>null</code> name is provided.
*/
public Object getUserProperty(String ns, String name) {
public synchronized Object getUserProperty(String ns, String name) {
if (name == null) {
return null;
}


Loading…
Cancel
Save