You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by gs...@apache.org on 2008/08/25 15:53:07 UTC
svn commit: r688725 -
/ant/core/trunk/src/main/org/apache/tools/ant/IntrospectionHelper.java
Author: gscokart
Date: Mon Aug 25 06:53:06 2008
New Revision: 688725
URL: http://svn.apache.org/viewvc?rev=688725&view=rev
Log:
Fix possible raise condition when modifying/reading restrictedDefinitions (missing from previous checkin)
Modified:
ant/core/trunk/src/main/org/apache/tools/ant/IntrospectionHelper.java
Modified: ant/core/trunk/src/main/org/apache/tools/ant/IntrospectionHelper.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/IntrospectionHelper.java?rev=688725&r1=688724&r2=688725&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/IntrospectionHelper.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/IntrospectionHelper.java Mon Aug 25 06:53:06 2008
@@ -1585,24 +1585,26 @@
if (definitions == null) {
return null;
}
- for (int i = 0; i < definitions.size(); ++i) {
- AntTypeDefinition d = (AntTypeDefinition) definitions.get(i);
- Class exposedClass = d.getExposedClass(helper.getProject());
- if (exposedClass == null) {
- continue;
+ synchronized (definitions) {
+ for (int i = 0; i < definitions.size(); ++i) {
+ AntTypeDefinition d = (AntTypeDefinition) definitions.get(i);
+ Class exposedClass = d.getExposedClass(helper.getProject());
+ if (exposedClass == null) {
+ continue;
+ }
+ Method method = findMatchingMethod(exposedClass, methods);
+ if (method == null) {
+ continue;
+ }
+ if (matchedDefinitionClass != null) {
+ throw new BuildException(
+ "ambiguous: restricted definitions for "
+ + componentName + " "
+ + matchedDefinitionClass + " and " + exposedClass);
+ }
+ matchedDefinitionClass = exposedClass;
+ definition = d;
}
- Method method = findMatchingMethod(exposedClass, methods);
- if (method == null) {
- continue;
- }
- if (matchedDefinitionClass != null) {
- throw new BuildException(
- "ambiguous: restricted definitions for "
- + componentName + " "
- + matchedDefinitionClass + " and " + exposedClass);
- }
- matchedDefinitionClass = exposedClass;
- definition = d;
}
return definition;
}