Browse Source

Fix possible raise condition when modifying/reading restrictedDefinitions (missing from previous checkin)

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@688725 13f79535-47bb-0310-9956-ffa450edef68
master
Scokart Gilles 17 years ago
parent
commit
6aa8785e32
1 changed files with 19 additions and 17 deletions
  1. +19
    -17
      src/main/org/apache/tools/ant/IntrospectionHelper.java

+ 19
- 17
src/main/org/apache/tools/ant/IntrospectionHelper.java View File

@@ -1585,24 +1585,26 @@ public final class IntrospectionHelper {
if (definitions == null) { if (definitions == null) {
return 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;
}
Method method = findMatchingMethod(exposedClass, methods);
if (method == null) {
continue;
}
if (matchedDefinitionClass != null) {
throw new BuildException(
"ambiguous: restricted definitions for "
+ componentName + " "
+ matchedDefinitionClass + " and " + exposedClass);
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;
} }
matchedDefinitionClass = exposedClass;
definition = d;
} }
return definition; return definition;
} }


Loading…
Cancel
Save